summaryrefslogtreecommitdiff
path: root/libgralloc
diff options
context:
space:
mode:
authorZhu Bin <cbinz@codeaurora.org>2016-12-21 16:24:49 +0800
committerPramodh Kumar Mukunda <pkmuku@codeaurora.org>2017-02-21 14:49:02 +0530
commite2422e0e7c78d6c43a5520b09900f859f15988d1 (patch)
treec21c59637465f54ddfb32e608c7e2a5fb5567515 /libgralloc
parent13321553e518cf8a18200bb29a9aa760062d2ab9 (diff)
downloaddisplay-e2422e0e7c78d6c43a5520b09900f859f15988d1.tar.gz
gralloc: Add support for raw12
When the output of the sensor is raw12 format, errors occur in gralloc. So raw12 format needs to be supported in gralloc. Change-Id: If9f7808713bae2fb1efb774e65ae742ca20fb201 CRs-Fixed: 2005966 Signed-off-by: Zhu Bin <cbinz@codeaurora.org>
Diffstat (limited to 'libgralloc')
-rw-r--r--libgralloc/alloc_controller.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 805948b4..87d4c1e9 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -245,6 +245,9 @@ void AdrenoMemInfo::getAlignedWidthAndHeight(int width, int height, int format,
case HAL_PIXEL_FORMAT_RAW16:
aligned_w = ALIGN(width, 16);
break;
+ case HAL_PIXEL_FORMAT_RAW12:
+ aligned_w = ALIGN(width * 12 / 8, 8);
+ break;
case HAL_PIXEL_FORMAT_RAW10:
aligned_w = ALIGN(width * 10 / 8, 8);
break;
@@ -553,6 +556,9 @@ unsigned int getSize(int format, int width, int height, int usage,
case HAL_PIXEL_FORMAT_RAW16:
size = alignedw * alignedh * 2;
break;
+ case HAL_PIXEL_FORMAT_RAW12:
+ size = ALIGN(alignedw * alignedh, 4096);
+ break;
case HAL_PIXEL_FORMAT_RAW10:
size = ALIGN(alignedw * alignedh, 4096);
break;
@@ -793,6 +799,7 @@ int getYUVPlaneInfo(private_handle_t* hnd, struct android_ycbcr* ycbcr)
case HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS:
case HAL_PIXEL_FORMAT_NV21_ZSL:
case HAL_PIXEL_FORMAT_RAW16:
+ case HAL_PIXEL_FORMAT_RAW12:
case HAL_PIXEL_FORMAT_RAW10:
getYuvSPPlaneInfo(hnd->base, width, height, 1, ycbcr);
std::swap(ycbcr->cb, ycbcr->cr);