From 49c9889d8376558fd72e5ce6031a67545645ff42 Mon Sep 17 00:00:00 2001 From: Taehwan Kim Date: Fri, 28 Dec 2012 02:10:19 +0000 Subject: [PATCH] osal: added USE_IMPROVED_BUFFER support in case of USE_IMPROVED_BUFFER, flag about SYSTEM_MEMORY is changed for improved performance. Change-Id: Id0c7c194e76b67a1a0f032d1909550e4b1631be4 Signed-off-by: Taehwan Kim --- osal/Android.mk | 8 ++++++++ osal/Exynos_OSAL_Android.cpp | 3 +++ osal/Exynos_OSAL_SharedMemory.c | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/osal/Android.mk b/osal/Android.mk index 287dded..2f65424 100644 --- a/osal/Android.mk +++ b/osal/Android.mk @@ -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 := \ diff --git a/osal/Exynos_OSAL_Android.cpp b/osal/Exynos_OSAL_Android.cpp index 9c9a6e2..985ba0a 100644 --- a/osal/Exynos_OSAL_Android.cpp +++ b/osal/Exynos_OSAL_Android.cpp @@ -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; diff --git a/osal/Exynos_OSAL_SharedMemory.c b/osal/Exynos_OSAL_SharedMemory.c index fd4748d..cbae00b 100644 --- a/osal/Exynos_OSAL_SharedMemory.c +++ b/osal/Exynos_OSAL_SharedMemory.c @@ -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; -- 2.20.1