osal: add RGB lock support
authorJinsung Yang <jsgood.yang@samsung.com>
Wed, 5 Dec 2012 14:23:28 +0000 (23:23 +0900)
committerjung-min.oh <jung-min.oh@samsung.com>
Fri, 7 Dec 2012 12:06:21 +0000 (21:06 +0900)
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>
osal/Exynos_OSAL_Android.cpp

index b4f7f3d66f9af3c0bda438e89850f54955e9e803..364c490a02ec2983d050fef1f26217f325b800a4 100644 (file)
@@ -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;