display: Add support to HAL_PIXEL_FORMAT_NV21_ZSL format

Add Support to HAL_PIXEL_FORMAT_NV21_ZSL format in gralloc for
camera capture usecase.
This support is required because, CPP module requires 64 byte
aligned width and height to resolve corruption in bottom/left edge
of the landscape/portrait buffer.

Change-Id: Id3e0e5f3d695d5111f3469f78a1d52aad9bea4f4
(cherry picked from commit 512ee1dcef6fa47dfdcf3990fea29bd85f967f02)
This commit is contained in:
Ramkumar Radhakrishnan
2013-07-23 16:12:08 -07:00
committed by Arun Kumar K.R
parent 62e1d731cd
commit ff511027c4
3 changed files with 12 additions and 1 deletions

View File

@@ -161,6 +161,9 @@ int AdrenoMemInfo::getStride(int width, int format)
case HAL_PIXEL_FORMAT_BLOB:
stride = width;
break;
case HAL_PIXEL_FORMAT_NV21_ZSL:
stride = ALIGN(width, 64);
break;
default: break;
}
}
@@ -340,6 +343,10 @@ size_t getBufferSizeAndDimensions(int width, int height, int format,
alignedw = width;
size = width;
break;
case HAL_PIXEL_FORMAT_NV21_ZSL:
alignedh = ALIGN(height, 64);
size = ALIGN((alignedw*alignedh) + (alignedw* alignedh)/2, 4096);
break;
default:
ALOGE("unrecognized pixel format: 0x%x", format);
return -EINVAL;