summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2022-06-08 23:30:58 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-06-08 23:30:58 +0000
commit50c1a2e047c994b21eb8165533dfd3257081b1fc (patch)
tree645a8bfbae353e9bed8e023935cbc17e3e65e601
parente6ebf0a1bcc8220d5d1002042364d018f91c5111 (diff)
parenta156ce85ab8192925dba099f507826d9c350bdc0 (diff)
downloadgchips-50c1a2e047c994b21eb8165533dfd3257081b1fc.tar.gz
Merge "Disable CPU alignment for Camera's RAW10 when not explicitly specified" into tm-dev am: a156ce85ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/google/gchips/+/18800938 Change-Id: I866b95e233253eee0062802324b1368c2d06988f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--gralloc4/src/core/mali_gralloc_bufferallocation.cpp16
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);