osal: added USE_IMPROVED_BUFFER support
authorTaehwan Kim <t_h.kim@samsung.com>
Fri, 28 Dec 2012 02:10:19 +0000 (02:10 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 3 Jan 2013 23:53:23 +0000 (23:53 +0000)
in case of USE_IMPROVED_BUFFER,
flag about SYSTEM_MEMORY is changed
for improved performance.

Change-Id: Id0c7c194e76b67a1a0f032d1909550e4b1631be4
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
osal/Android.mk
osal/Exynos_OSAL_Android.cpp
osal/Exynos_OSAL_SharedMemory.c

index 287dded31ffd4941ef2df6eed3e00fd043c3f4b7..2f654246ec1de9ddae7abf1bb9c06a4fb1e59ca3 100644 (file)
@@ -29,6 +29,14 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_IMPROVED_BUFFER), true)
+LOCAL_CFLAGS += -DUSE_IMPROVED_BUFFER
+endif
+
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_STATIC_LIBRARIES := liblog libcutils libExynosVideoApi
 
 LOCAL_C_INCLUDES := \
index 9c9a6e2745296aecbbb236d4f36da208659baa21..985ba0aa2f5088c59d3f293c8f8a3443dc560323 100644 (file)
@@ -367,6 +367,9 @@ OMX_ERRORTYPE Exynos_OSAL_GetANBParameter(
          * modifications since currently not defined what the 'nUsage' is for.
          */
         pANBParams->nUsage |= (GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_EXTERNAL_DISP);
+#if defined(USE_IMPROVED_BUFFER) && !defined(USE_CSC_HW)
+        pANBParams->nUsage |= (GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_SW_WRITE_OFTEN);
+#endif
     }
         break;
 
index fd4748d0eb98114100535c71e6815f171ee82cd1..cbae00b73aa1fac7fb6e0400ab552e1ad4231552 100644 (file)
@@ -19,6 +19,7 @@
  * @file        Exynos_OSAL_SharedMemory.c
  * @brief
  * @author      SeungBeom Kim (sbcrux.kim@samsung.com)
+ *              Jinsung Yang (jsgood.yang@samsung.com)
  *              Taehwan Kim (t_h.kim@samsung.com)
  * @version     2.0.0
  * @history
@@ -165,8 +166,13 @@ OMX_PTR Exynos_OSAL_SharedMemory_Alloc(OMX_HANDLETYPE handle, OMX_U32 size, MEMO
         flag = 0;
         break;
     case SYSTEM_MEMORY:
+#ifdef USE_IMPROVED_BUFFER
+        mask = ION_HEAP_SYSTEM_MASK;
+        flag = ION_FLAG_CACHED | ION_FLAG_CACHED_NEEDS_SYNC | ION_FLAG_PRESERVE_KMAP;
+#else
         mask = ION_HEAP_SYSTEM_MASK;
         flag = ION_FLAG_CACHED;
+#endif
         break;
     default:
         pBuffer = NULL;