diff options
author | Ankit Goyal <layog@google.com> | 2022-05-27 18:22:48 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-27 18:22:48 +0000 |
commit | 4a2de4c98903bb23e04fb4444944b454543364da (patch) | |
tree | 64c291c2e4e66779c8ca4d35676183c6ae6294f5 | |
parent | e88c9283ebf8e7290ce5bed4f6d99ca8942868ec (diff) | |
parent | e906482211a84e4bb1f50a0f152576862c0afc65 (diff) | |
download | gchips-4a2de4c98903bb23e04fb4444944b454543364da.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: I35869e50c794d8742ce40c80f96dd3a5e731f9e6
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 { |