diff options
author | qctecmdr <qctecmdr@localhost> | 2020-08-31 07:36:43 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2020-08-31 07:36:43 -0700 |
commit | 26eabdff742ad12d43b196915ba2953ed1cde4e4 (patch) | |
tree | aca259b37fc3bfde678b3d4b7bc9a79893b1f152 /gralloc/gr_utils.cpp | |
parent | 310364e783b38739350d84b8855c2b37caa130f4 (diff) | |
parent | 63b01d062a9171a084d48addad0fd83ebb33e946 (diff) |
Merge "gralloc: modify YV12 color format handle"
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r-- | gralloc/gr_utils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp index 21e504a3..98e60e2c 100644 --- a/gralloc/gr_utils.cpp +++ b/gralloc/gr_utils.cpp @@ -1029,6 +1029,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: |