From: Taehwan Kim Date: Thu, 3 Jan 2013 09:01:43 +0000 (+0000) Subject: osal: added CONTIG_MEMORY type X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d8c4488214cd923af40506afd41ff0b37ec0e191;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_openmax.git osal: added CONTIG_MEMORY type If use the CONTIG_MEMORY, OMX allocates the buffer that is contiguous physically. Change-Id: I7bbf08578b33eeb4f8ee7dd019323197fca54aae Signed-off-by: Taehwan Kim --- diff --git a/osal/Exynos_OSAL_SharedMemory.c b/osal/Exynos_OSAL_SharedMemory.c index cbae00b..42cc3bf 100644 --- a/osal/Exynos_OSAL_SharedMemory.c +++ b/osal/Exynos_OSAL_SharedMemory.c @@ -174,6 +174,10 @@ OMX_PTR Exynos_OSAL_SharedMemory_Alloc(OMX_HANDLETYPE handle, OMX_U32 size, MEMO flag = ION_FLAG_CACHED; #endif break; + case CONTIG_MEMORY: + mask = ION_HEAP_EXYNOS_CONTIG_MASK; + flag = 0; + break; default: pBuffer = NULL; goto EXIT; @@ -181,6 +185,12 @@ OMX_PTR Exynos_OSAL_SharedMemory_Alloc(OMX_HANDLETYPE handle, OMX_U32 size, MEMO } IONBuffer = ion_alloc((ion_client)pHandle->hIONHandle, size, 0, mask, flag); + if ((IONBuffer <= 0) && + (memoryType == CONTIG_MEMORY)) { + flag = ION_EXYNOS_MFC_INPUT_MASK; + IONBuffer = ion_alloc((ion_client)pHandle->hIONHandle, size, 0, mask, flag); + } + if (IONBuffer <= 0) { Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "ion_alloc Error: %d", IONBuffer); Exynos_OSAL_Free((OMX_PTR)pElement); diff --git a/osal/Exynos_OSAL_SharedMemory.h b/osal/Exynos_OSAL_SharedMemory.h index 6b644c7..d667d80 100644 --- a/osal/Exynos_OSAL_SharedMemory.h +++ b/osal/Exynos_OSAL_SharedMemory.h @@ -34,7 +34,8 @@ typedef enum _MEMORY_TYPE { NORMAL_MEMORY = 0x00, SECURE_MEMORY = 0x01, - SYSTEM_MEMORY = 0x02 + SYSTEM_MEMORY = 0x02, + CONTIG_MEMORY = 0x03, } MEMORY_TYPE; #ifdef __cplusplus