diff options
author | Yiwei Zhang <zzyiwei@chromium.org> | 2021-11-05 20:27:38 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-10 22:22:30 +0000 |
commit | 848fc371574fdfa46b225a981d8c1d325741958f (patch) | |
tree | 256c1b9be9e229767a556a37dca6a19571dfcb37 /cros_gralloc | |
parent | f4c1725d386779e44bf753205ecec8b37fc5be52 (diff) | |
download | minigbm-848fc371574fdfa46b225a981d8c1d325741958f.tar.gz |
gralloc: claim no support of GPU_MIPMAP_COMPLETE usage
Previously with gralloc0, mapper2.0 impl of the passthrough HAL has
helped return no support for GPU_MIPMAP_COMPLETE. When we upgrade to
gralloc4, minigbm gralloc driver must reject instead. That usage
was never supported by minigbm, and is also optional.
BUG=b:195673105
TEST=atest AHardwareBufferNativeTests
Change-Id: I964f5fae66e7be953e1bc25aa7e587f4fc5efe88
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3265444
Tested-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Dominik Behr <dbehr@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Diffstat (limited to 'cros_gralloc')
-rw-r--r-- | cros_gralloc/cros_gralloc_helpers.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cros_gralloc/cros_gralloc_helpers.cc b/cros_gralloc/cros_gralloc_helpers.cc index 86b4c8c..5f650fc 100644 --- a/cros_gralloc/cros_gralloc_helpers.cc +++ b/cros_gralloc/cros_gralloc_helpers.cc @@ -15,6 +15,9 @@ /* Define to match AIDL BufferUsage::GPU_DATA_BUFFER. */ #define BUFFER_USAGE_GPU_DATA_BUFFER (1 << 24) +/* Define to match AIDL BufferUsage::GPU_MIPMAP_COMPLETE. */ +#define BUFFER_USAGE_GPU_MIPMAP_COMPLETE (1 << 26) + uint32_t cros_gralloc_convert_format(int format) { /* @@ -71,6 +74,9 @@ uint64_t cros_gralloc_convert_usage(uint64_t usage) { uint64_t use_flags = BO_USE_NONE; + if (usage & BUFFER_USAGE_GPU_MIPMAP_COMPLETE) + return BO_USE_NONE; + if (usage & GRALLOC_USAGE_CURSOR) use_flags |= BO_USE_NONE; if ((usage & GRALLOC_USAGE_SW_READ_MASK) == GRALLOC_USAGE_SW_READ_RARELY) |