Merge "gralloc: Add support for 8-bit RAW MIPI stream"

This commit is contained in:
Linux Build Service Account
2017-03-05 21:39:05 -08:00
committed by Gerrit - the friendly Code Review server
4 changed files with 16 additions and 1 deletions

View File

@@ -260,6 +260,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;
@@ -571,7 +574,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);
@@ -810,6 +815,7 @@ int getYUVPlaneInfo(private_handle_t* hnd, struct android_ycbcr* ycbcr)
case HAL_PIXEL_FORMAT_RAW16:
case HAL_PIXEL_FORMAT_RAW12:
case HAL_PIXEL_FORMAT_RAW10:
case HAL_PIXEL_FORMAT_RAW8:
getYuvSPPlaneInfo(hnd->base, width, height, 1, ycbcr);
std::swap(ycbcr->cb, ycbcr->cr);
break;

View File

@@ -120,6 +120,7 @@
#define HAL_PIXEL_FORMAT_YCbCr_420_P010 0x11F
#define HAL_PIXEL_FORMAT_CbYCrY_422_I 0x120
#define HAL_PIXEL_FORMAT_BGR_888 0x121
#define HAL_PIXEL_FORMAT_RAW8 0x123
#define HAL_PIXEL_FORMAT_INTERLACE 0x180

View File

@@ -218,6 +218,9 @@ unsigned int Allocator::GetSize(const BufferDescriptor &descriptor, unsigned int
case HAL_PIXEL_FORMAT_RAW10:
size = ALIGN(alignedw * alignedh, SIZE_4K);
break;
case HAX_PIXEL_FORMAT_RAW8:
size = alignedw * alignedh * 1;
break;
// adreno formats
case HAL_PIXEL_FORMAT_YCrCb_420_SP_ADRENO: // NV21
@@ -402,6 +405,7 @@ int Allocator::GetYUVPlaneInfo(const private_handle_t *hnd, struct android_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;
@@ -777,6 +781,9 @@ void Allocator::GetAlignedWidthAndHeight(const BufferDescriptor &descriptor, uns
case HAL_PIXEL_FORMAT_RAW10:
aligned_w = ALIGN(width * 10 / 8, 16);
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;

View File

@@ -116,6 +116,7 @@ inline int roundUpToPageSize(int x) {
#define HAL_PIXEL_FORMAT_NV21_ZSL 0x113
#define HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS 0x114
#define HAL_PIXEL_FORMAT_BGR_565 0x115
#define HAX_PIXEL_FORMAT_RAW8 0x116
// 10 bit
#define HAL_PIXEL_FORMAT_ARGB_2101010 0x117