diff options
author | Ankit Goyal <layog@google.com> | 2022-05-27 18:41:52 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-27 18:41:52 +0000 |
commit | e81fdfab036fbe87002f4f222276223d6a5ef35e (patch) | |
tree | 382e141738b13c7e44711a0a1c3a29fa71b6fb94 | |
parent | 0c8d38d28ad068751e316e912bd495b72498873e (diff) | |
parent | e6ebf0a1bcc8220d5d1002042364d018f91c5111 (diff) | |
download | gchips-e81fdfab036fbe87002f4f222276223d6a5ef35e.tar.gz |
Disable support for front buffer allocation am: e906482211 am: e6ebf0a1bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/18625673
Change-Id: I74a5a4d803583b078d1970d5af4c73c5203e2908
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | gralloc4/src/core/mali_gralloc_bufferallocation.cpp | 15 | ||||
-rw-r--r-- | gralloc4/src/hidl_common/Mapper.cpp | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp index 12e4494..3718816 100644 --- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp +++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp @@ -977,6 +977,16 @@ static int prepare_descriptor_exynos_formats( return 0; } +static bool validate_usage(const uint64_t usage) { + if (usage & GRALLOC_USAGE_FRONT_BUFFER) { + /* TODO(b/218383959): Enable front buffer rendering */ + MALI_GRALLOC_LOGW("Front buffer rendering is disabled."); + return false; + } + + return true; +} + int mali_gralloc_derive_format_and_size(buffer_descriptor_t * const bufDescriptor) { alloc_type_t alloc_type{}; @@ -985,6 +995,11 @@ int mali_gralloc_derive_format_and_size(buffer_descriptor_t * const bufDescripto int alloc_height = bufDescriptor->height; uint64_t usage = bufDescriptor->producer_usage | bufDescriptor->consumer_usage; + if (!validate_usage(usage)) { + MALI_GRALLOC_LOGE("Usage flag validation failed."); + return -EINVAL; + } + /* * Select optimal internal pixel format based upon * usage and requested format. diff --git a/gralloc4/src/hidl_common/Mapper.cpp b/gralloc4/src/hidl_common/Mapper.cpp index e8f5b10..f6ebe6f 100644 --- a/gralloc4/src/hidl_common/Mapper.cpp +++ b/gralloc4/src/hidl_common/Mapper.cpp @@ -563,7 +563,7 @@ void isSupported(const IMapper::BufferDescriptorInfo& description, IMapper::isSu if (result != 0) { MALI_GRALLOC_LOGV("Allocation for the given description will not succeed. error: %d", result); - hidl_cb(Error::NO_RESOURCES, false); + hidl_cb(Error::NONE, false); } else { |