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)
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 3b6bf20..94ca3d4 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -161,6 +161,9 @@
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 @@
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;