diff options
author | Ankit Goyal <layog@google.com> | 2022-05-27 18:23:15 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-27 18:23:15 +0000 |
commit | 29b6138062263411445c07264cda011caf974cca (patch) | |
tree | 2912df6ce12eeeec3fbb365f40fd3a2317ae23df | |
parent | e39aace4138c244657166f20e3c99c4f5f55a163 (diff) | |
parent | e906482211a84e4bb1f50a0f152576862c0afc65 (diff) | |
download | gchips-29b6138062263411445c07264cda011caf974cca.tar.gz |
Disable support for front buffer allocation am: e906482211
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/18625673
Change-Id: Ia88c5cbb4ec42284f2647d12c9607d37b55a4a47
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 { |