support gfx format HAL_PIXEL_FORMAT_NV12 new alignment rule
BZ: 180802
for camera v3, if gfx buffer usage is set GRALLOC_USAGE_HW_CAMERA_WRITE
or GRALLOC_USAGE_HW_CAMERA_READ, then alignment is 64 on MRFLD
Change-Id: I848b3b140b5227672b16e730156a8959dd5dd998
Signed-off-by: Zhao Liang <leo.zhao@intel.com>
diff --git a/videoencoder/VideoEncoderUtils.cpp b/videoencoder/VideoEncoderUtils.cpp
index 2657e01..0612ce6 100644
--- a/videoencoder/VideoEncoderUtils.cpp
+++ b/videoencoder/VideoEncoderUtils.cpp
@@ -177,7 +177,10 @@
if (h->iFormat == HAL_PIXEL_FORMAT_NV12) {
#ifdef MRFLD_GFX
- vinfo.lumaStride = (h->iWidth + 31) & ~31; //32 aligned
+ if((h->usage | GRALLOC_USAGE_HW_CAMERA_READ) || (h->usage | GRALLOC_USAGE_HW_CAMERA_WRITE) )
+ vinfo.lumaStride = (h->iWidth + 63) & ~63; //64 aligned
+ else
+ vinfo.lumaStride = (h->iWidth + 31) & ~31; //32 aligned
#else //on CTP
if (h->iWidth > 512)
vinfo.lumaStride = (h->iWidth + 63) & ~63; //64 aligned