summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-01-08 06:28:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-01-08 06:28:19 +0000
commit7e2c516f5b78c1f5e2302fc0fa77709d67da6c6b (patch)
tree1ec9ec49e6fcd046e669a5e8f57a1e7d01463ea2
parentdd060ff0fd590700d279b9d298ca774cb2b067ca (diff)
parente38cdcdf095a48590a0a2ad44163894feb0f6174 (diff)
downloaddisplay-7e2c516f5b78c1f5e2302fc0fa77709d67da6c6b.tar.gz
Merge "gralloc: 64-bytes row alignment for RAW10 buffers" into qt-qpr1-dev
-rw-r--r--gralloc/gr_utils.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 9eca92df..263eb3ea 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -930,7 +930,13 @@ void GetAlignedWidthAndHeight(const BufferInfo &info, unsigned int *alignedw,
aligned_w = ALIGN(width * 12 / 8, 16);
break;
case HAL_PIXEL_FORMAT_RAW10:
- aligned_w = ALIGN(width * 10 / 8, 16);
+ {
+ const unsigned int gpu_alignment =
+ AdrenoMemInfo::GetInstance()->GetGpuPixelAlignment();
+ // gpu_alignment can return 1. Make sure it's at least 64.
+ const unsigned int raw10_alignment = std::max(gpu_alignment, 64u);
+ aligned_w = ALIGN(width * 10 / 8, raw10_alignment);
+ }
break;
case HAL_PIXEL_FORMAT_RAW8:
aligned_w = ALIGN(width, 16);