gralloc: Add support for 8-bit RAW MIPI stream

Define new HAL color format for RAW-8 stream and
add support for buffer allocation with RAW-8 format.

Change-Id: I1ee1dbd270d25c27e52c5dd023345c8283c658d2
This commit is contained in:
Prabhanjan Kandula
2017-02-10 15:46:04 -08:00
parent b08b43ff0b
commit f48302a611
4 changed files with 16 additions and 1 deletions

View File

@@ -248,6 +248,9 @@ void AdrenoMemInfo::getAlignedWidthAndHeight(int width, int height, int format,
case HAL_PIXEL_FORMAT_RAW10:
aligned_w = ALIGN(width * 10 / 8, 8);
break;
case HAL_PIXEL_FORMAT_RAW8:
aligned_w = ALIGN(width, 8);
break;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED:
aligned_w = ALIGN(width, 128);
break;
@@ -556,7 +559,9 @@ unsigned int getSize(int format, int width, int height, int usage,
case HAL_PIXEL_FORMAT_RAW10:
size = ALIGN(alignedw * alignedh, 4096);
break;
case HAL_PIXEL_FORMAT_RAW8:
size = alignedw * alignedh;
break;
// adreno formats
case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO: // NV21
size = ALIGN(alignedw*alignedh, 4096);
@@ -794,6 +799,7 @@ int getYUVPlaneInfo(private_handle_t* hnd, struct android_ycbcr* ycbcr)
case HAL_PIXEL_FORMAT_NV21_ZSL:
case HAL_PIXEL_FORMAT_RAW16:
case HAL_PIXEL_FORMAT_RAW10:
case HAL_PIXEL_FORMAT_RAW8:
getYuvSPPlaneInfo(hnd->base, width, height, 1, ycbcr);
std::swap(ycbcr->cb, ycbcr->cr);
break;