From: Jinsung Yang Date: Wed, 5 Dec 2012 14:23:28 +0000 (+0900) Subject: osal: add RGB lock support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4f86e7359822109cd72e459722b6ad65ed23476d;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git osal: add RGB lock support 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 --- diff --git a/osal/Exynos_OSAL_Android.cpp b/osal/Exynos_OSAL_Android.cpp index b4f7f3d..364c490 100644 --- a/osal/Exynos_OSAL_Android.cpp +++ b/osal/Exynos_OSAL_Android.cpp @@ -91,6 +91,17 @@ OMX_ERRORTYPE Exynos_OSAL_LockANBHandle( 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;