osal: added CONTIG_MEMORY type
authorTaehwan Kim <t_h.kim@samsung.com>
Thu, 3 Jan 2013 09:01:43 +0000 (09:01 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Wed, 16 Jan 2013 08:45:58 +0000 (08:45 +0000)
If use the CONTIG_MEMORY,
OMX allocates the buffer that is contiguous physically.

Change-Id: I7bbf08578b33eeb4f8ee7dd019323197fca54aae
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
osal/Exynos_OSAL_SharedMemory.c
osal/Exynos_OSAL_SharedMemory.h

index cbae00b73aa1fac7fb6e0400ab552e1ad4231552..42cc3bf3f9ae8adf00b5805dd365722bea05fddb 100644 (file)
@@ -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);
index 6b644c786cce2eaebeac95f27d71f6acee3c3866..d667d805c1c1b880e3d5d3bce97fd90d1b369d07 100644 (file)
@@ -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