diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-10 01:17:59 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-10 01:17:59 +0000 |
commit | 321125a8a81137c925559987999e77d25c4c8d9c (patch) | |
tree | 3c382b4c0523041dfd2d5a02767641cd1192afbb | |
parent | 3bbdb2c7c91c05453d8ff92e114467b89d94c751 (diff) | |
parent | a156ce85ab8192925dba099f507826d9c350bdc0 (diff) | |
download | gchips-android13-s1-release.tar.gz |
Snap for 8704672 from a156ce85ab8192925dba099f507826d9c350bdc0 to tm-releaseandroid-vts-13.0_r8android-vts-13.0_r7android-vts-13.0_r6android-vts-13.0_r5android-vts-13.0_r4android-vts-13.0_r3android-vts-13.0_r2android-vts-13.0_r1android-security-13.0.0_r9android-security-13.0.0_r8android-security-13.0.0_r7android-security-13.0.0_r6android-security-13.0.0_r5android-security-13.0.0_r4android-security-13.0.0_r3android-security-13.0.0_r2android-security-13.0.0_r17android-security-13.0.0_r16android-security-13.0.0_r15android-security-13.0.0_r14android-security-13.0.0_r13android-security-13.0.0_r12android-security-13.0.0_r11android-security-13.0.0_r10android-security-13.0.0_r1android-cts-13.0_r8android-cts-13.0_r7android-cts-13.0_r6android-cts-13.0_r5android-cts-13.0_r4android-cts-13.0_r3android-cts-13.0_r2android-cts-13.0_r1android-13.0.0_r8android-13.0.0_r7android-13.0.0_r6android-13.0.0_r5android-13.0.0_r4android-13.0.0_r31android-13.0.0_r3android-13.0.0_r2android-13.0.0_r12android-13.0.0_r1android13-tests-releaseandroid13-security-releaseandroid13-s3-releaseandroid13-s2-releaseandroid13-s1-releaseandroid13-release
Change-Id: I1f98ea74f75db81919aa54971964fa84504bb6fa
-rw-r--r-- | gralloc4/src/core/mali_gralloc_bufferallocation.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp index 3718816..7656fcf 100644 --- a/gralloc4/src/core/mali_gralloc_bufferallocation.cpp +++ b/gralloc4/src/core/mali_gralloc_bufferallocation.cpp @@ -535,6 +535,7 @@ static void calc_allocation_size(const int width, const bool has_cpu_usage, const bool has_hw_usage, const bool has_gpu_usage, + const bool has_camera_usage, int * const pixel_stride, uint64_t * const size, plane_info_t plane_info[MAX_PLANES]) @@ -606,15 +607,17 @@ static void calc_allocation_size(const int width, uint32_t cpu_align = 0; + if (!(has_camera_usage && !has_cpu_usage && format.id == MALI_GRALLOC_FORMAT_INTERNAL_RAW10)) { #if CAN_SKIP_CPU_ALIGN == 1 - if (has_cpu_usage) + if (has_cpu_usage) #endif - { - assert((format.bpp[plane] * format.align_w_cpu) % 8 == 0); - const bool is_primary_plane = (plane == 0 || !format.planes_contiguous); - if (is_primary_plane) { - cpu_align = (format.bpp[plane] * format.align_w_cpu) / 8; + assert((format.bpp[plane] * format.align_w_cpu) % 8 == 0); + const bool is_primary_plane = (plane == 0 || !format.planes_contiguous); + if (is_primary_plane) + { + cpu_align = (format.bpp[plane] * format.align_w_cpu) / 8; + } } } @@ -1063,6 +1066,7 @@ int mali_gralloc_derive_format_and_size(buffer_descriptor_t * const bufDescripto usage & (GRALLOC_USAGE_SW_READ_MASK | GRALLOC_USAGE_SW_WRITE_MASK), usage & ~(GRALLOC_USAGE_PRIVATE_MASK | GRALLOC_USAGE_SW_READ_MASK | GRALLOC_USAGE_SW_WRITE_MASK), usage & (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_GPU_DATA_BUFFER), + usage & (GRALLOC_USAGE_HW_CAMERA_WRITE | GRALLOC_USAGE_HW_CAMERA_READ), &bufDescriptor->pixel_stride, &bufDescriptor->alloc_sizes[0], bufDescriptor->plane_info); |