gralloc: add support for RGBA_1010102 and FP16

RGBA_1010102 is more likely to work since what this change does is
to replace the private value (0x116) by the public value (0x2b).
According to Naseer, the private value is never used on 8996.

RGBA_FP16 is harder to say.

Bug: 34715768
Test: allocate and lock both formats work
Change-Id: I4a37a34434186f2348c6ad1aae17d34317e961df
This commit is contained in:
Chia-I Wu 2017-02-10 12:47:28 -08:00
parent 92d0cf39ca
commit ba8670421c
2 changed files with 7 additions and 1 deletions

View File

@ -191,6 +191,7 @@ bool isUncompressedRgbFormat(int format)
case HAL_PIXEL_FORMAT_RGB_565:
case HAL_PIXEL_FORMAT_BGR_565:
case HAL_PIXEL_FORMAT_BGRA_8888:
case HAL_PIXEL_FORMAT_RGBA_FP16:
case HAL_PIXEL_FORMAT_RGBA_5551:
case HAL_PIXEL_FORMAT_RGBA_4444:
case HAL_PIXEL_FORMAT_R_8:
@ -338,6 +339,9 @@ void AdrenoMemInfo::getGpuAlignedWidthHeight(int width, int height, int format,
int bpp = 4;
switch(format)
{
case HAL_PIXEL_FORMAT_RGBA_FP16:
bpp = 8;
break;
case HAL_PIXEL_FORMAT_RGB_888:
bpp = 3;
break;
@ -555,6 +559,9 @@ unsigned int getSize(int format, int width, int height, int usage,
unsigned int size = 0;
switch (format) {
case HAL_PIXEL_FORMAT_RGBA_FP16:
size = alignedw * alignedh * 8;
break;
case HAL_PIXEL_FORMAT_RGBA_8888:
case HAL_PIXEL_FORMAT_RGBX_8888:
case HAL_PIXEL_FORMAT_BGRA_8888:

View File

@ -109,7 +109,6 @@
#define HAL_PIXEL_FORMAT_NV21_ZSL 0x113
#define HAL_PIXEL_FORMAT_YCrCb_420_SP_VENUS 0x114
#define HAL_PIXEL_FORMAT_BGR_565 0x115
#define HAL_PIXEL_FORMAT_RGBA_1010102 0x116
#define HAL_PIXEL_FORMAT_ARGB_2101010 0x117
#define HAL_PIXEL_FORMAT_RGBX_1010102 0x118
#define HAL_PIXEL_FORMAT_XRGB_2101010 0x119