When RGB buffer is allocated by gralloc, this patch allows to lock
for this buffer with ion_map() since that for the RGB format buffer,
gralloc uses PVR own function to virtual address mapping instead of
ion_map().
The flag GRALLOC_USAGE_HW_VIDEO_ENCODER is used to aware the buffer
is RGB format in gralloc.
Change-Id: Iae92296751cc1bb1015aa33ec7f3b4ccc78955d7
Signed-off-by: Jinsung Yang <jsgood.yang@samsung.com>
case OMX_SEC_COLOR_FormatNV12Tiled:
usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
break;
+ case OMX_COLOR_FormatAndroidOpaque:
+ {
+ OMX_COLOR_FORMATTYPE formatType;
+ formatType = Exynos_OSAL_GetANBColorFormat(priv_hnd);
+ if ((formatType == OMX_COLOR_FormatYUV420SemiPlanar) ||
+ (formatType == OMX_SEC_COLOR_FormatNV12Tiled))
+ usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
+ else
+ usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_HW_VIDEO_ENCODER;
+ }
+ break;
default:
usage = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN;
break;