Merge "gralloc: modify YV12 color format handle"
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 21e504a..98e60e2 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -1029,6 +1029,16 @@
aligned_w = ALIGN(width, 128);
break;
case HAL_PIXEL_FORMAT_YV12:
+ if ((usage & BufferUsage::GPU_TEXTURE) || (usage & BufferUsage::GPU_RENDER_TARGET)) {
+ if (AdrenoMemInfo::GetInstance() == nullptr) {
+ return;
+ }
+ alignment = AdrenoMemInfo::GetInstance()->GetGpuPixelAlignment();
+ aligned_w = ALIGN(width, alignment);
+ } else {
+ aligned_w = ALIGN(width, 16);
+ }
+ break;
case HAL_PIXEL_FORMAT_YCbCr_422_SP:
case HAL_PIXEL_FORMAT_YCrCb_422_SP:
case HAL_PIXEL_FORMAT_YCbCr_422_I: