Merge "sdm: Add support for new pixel formats in HAL"

This commit is contained in:
Linux Build Service Account
2017-02-05 18:41:24 -08:00
committed by Gerrit - the friendly Code Review server
8 changed files with 23 additions and 0 deletions

View File

@@ -197,6 +197,7 @@ bool isUncompressedRgbFormat(int format)
case HAL_PIXEL_FORMAT_R_8:
case HAL_PIXEL_FORMAT_RG_88:
case HAL_PIXEL_FORMAT_BGRX_8888:
case HAL_PIXEL_FORMAT_BGR_888:
case HAL_PIXEL_FORMAT_RGBA_1010102:
case HAL_PIXEL_FORMAT_ARGB_2101010:
case HAL_PIXEL_FORMAT_RGBX_1010102:
@@ -256,6 +257,7 @@ void AdrenoMemInfo::getAlignedWidthAndHeight(int width, int height, int format,
case HAL_PIXEL_FORMAT_YCbCr_422_I:
case HAL_PIXEL_FORMAT_YCrCb_422_I:
case HAL_PIXEL_FORMAT_YCbCr_420_P010:
case HAL_PIXEL_FORMAT_CbYCrY_422_I:
aligned_w = ALIGN(width, 16);
break;
case HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS:
@@ -587,6 +589,7 @@ unsigned int getSize(int format, int width, int height, int usage,
case HAL_PIXEL_FORMAT_YCrCb_422_SP:
case HAL_PIXEL_FORMAT_YCbCr_422_I:
case HAL_PIXEL_FORMAT_YCrCb_422_I:
case HAL_PIXEL_FORMAT_CbYCrY_422_I:
if(width & 1) {
ALOGE("width is odd for the YUV422_SP format");
return 0;
@@ -807,6 +810,16 @@ int getYUVPlaneInfo(private_handle_t* hnd, struct android_ycbcr* ycbcr)
ycbcr->cstride = cstride;
ycbcr->chroma_step = 1;
break;
case HAL_PIXEL_FORMAT_CbYCrY_422_I:
ystride = width * 2;
cstride = 0;
ycbcr->y = (void*)hnd->base;
ycbcr->cr = NULL;
ycbcr->cb = NULL;
ycbcr->ystride = ystride;
ycbcr->cstride = 0;
ycbcr->chroma_step = 0;
break;
//Unsupported formats
case HAL_PIXEL_FORMAT_YCbCr_422_I:
case HAL_PIXEL_FORMAT_YCrCb_422_I: