summaryrefslogtreecommitdiff
path: root/gralloc/gr_utils.cpp
diff options
context:
space:
mode:
authorVenkat Thogaru <vthogaru@codeaurora.org>2020-06-12 14:28:01 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2020-08-19 01:51:39 -0700
commit63b01d062a9171a084d48addad0fd83ebb33e946 (patch)
treec5d40164404b072057236aa24e66bf9b99814ad8 /gralloc/gr_utils.cpp
parent3b1c8dc4013ae3d9c47933dd27a02b72ecfe3814 (diff)
gralloc: modify YV12 color format handle
Change-Id: Ib8b6a80b1f39d11e2c9c7f9949c0c0323d7e6be3
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r--gralloc/gr_utils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 312058ed..6ceabcb4 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -1011,6 +1011,16 @@ void GetAlignedWidthAndHeight(const BufferInfo &info, unsigned int *alignedw,
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: