]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/repo-libdce.git/commitdiff
[QNX] Remove dependency on QNX TILER for memory allocation
authorBuddy Liong <buddy.budiono@ti.com>
Thu, 9 Apr 2015 17:40:16 +0000 (12:40 -0500)
committerBuddy Liong <buddy.budiono@ti.com>
Tue, 21 Apr 2015 15:01:18 +0000 (10:01 -0500)
Previously dce_alloc() call will always reserve the memory from QNX
TILER 1D. The same case happens when it calls memplugin_alloc since the
definition of DEFAULT_REGION is set to MEM_TILER_1D for QNX.

Since there is a known issue of DMA lockup due to MPU side performing memory copy
into the TILER memory, this patch limits the use of QNX TILER.
With this patch, dce_test and dce_enc_test can be executed without QNX TILER
allocation.

DCE test apps are also updated to allocate the memory through
shmemallocator instead of QNX TILER.

The capability to:
   allocate TILER output buffer for decoder and
   allocate TILER input buffer and output buffer for encoder
are still existed as part of the dce_test or dce_enc_test input parameter 'tiler'
vs 'nontiler'

Change-Id: I33e2a9dd83c791cc2621e548628715abaeae871d
Signed-off-by: Buddy Liong <buddy.budiono@ti.com>
libdce.c
memplugin.h
test_qnx/dce_enc_test/dce_enc_test.c
test_qnx/dce_test/dce_test.c

index 881516ea3aded610b8a09e84ae3a38fc040ca56e..7704613774f192d938b563a4072eaedbd980ed77 100644 (file)
--- a/libdce.c
+++ b/libdce.c
@@ -153,7 +153,7 @@ void *dce_alloc(int sz)
       Beware: The last argument is a bit field. As of now only core ID
       is considered to be there in the last 4 bits of the word
     */
-    return (memplugin_alloc(sz, 1, MEM_TILER_1D, 0, IPU));
+    return (memplugin_alloc(sz, 1, DEFAULT_REGION, 0, IPU));
 }
 
 void dce_free(void *ptr)
index 0073cf1206ac9d8521da6e263292b477b2247a95..26562e34161b5127d8f34d66cd76f82285f28c8e 100644 (file)
@@ -49,7 +49,7 @@
 #include <tilermem.h>
 #include <SharedMemoryAllocatorUsr.h>
 #include <memmgr.h>
-#define DEFAULT_REGION MEM_TILER_1D
+#define DEFAULT_REGION MEM_SHARED
 
 #elif defined (BUILDOS_ANDROID)
 #define DEFAULT_REGION MEM_CARVEOUT
index cbc80e3c5cfaad5dbf9110166b89ded48a3bc6fe..092703a364a19f409527442c6400daaed7657ebb 100644 (file)
@@ -264,9 +264,10 @@ int read_input(const char *pattern, int cnt, char *input)
 
     sz = width * height * 3 / 2;
 
-    // Filling the input in TILER 2D mode; where
-    // Luma has size of Stride "4096" * height.
-    // and Chroma has size of Stride "4096 * height / 2.
+    // Filling the input in NV12 format; where
+    // Luma has size of Stride "4096" * height for TILER or width * height
+    // and Chroma has size of Stride "4096 * height / 2 for TILER or
+    // width * height / 2
     for( num_planes = 0; num_planes < 2; num_planes++ ) {
         if( num_planes ) { //UV location
             buf_height = height / 2;
@@ -519,7 +520,7 @@ int main(int argc, char * *argv)
 
     DEBUG("width=%d, height=%d", width, height);
 
-    /* output buffer parameters is TILER with width and height */
+    /* output buffer parameters is aligned */
     width  = ALIGN2(width, 4);         /* round up to MB */
     height = ALIGN2(height, 1);        /* round up to MB */
 
@@ -607,7 +608,6 @@ int main(int argc, char * *argv)
             DEBUG("INPUT TILER buf=%p, buf->buf=%p y=%08x, uv=%08x", buf, buf->buf, buf->y, buf->uv);
         } else {
             ERROR("DCE_ENCODE_TEST_FAIL: TILER ALLOCATION FAILED");
-            free(buf);
             goto shutdown;
         }
     } else {
@@ -987,9 +987,9 @@ int main(int argc, char * *argv)
     dynParams->lateAcquireArg = -1;
 
 #ifdef GETVERSION
-    // Allocating TILER 1D to store the Codec version information from Codec.
+    // Allocating memory to store the Codec version information from Codec.
     char *codec_version = NULL;
-    codec_version = tiler_alloc(VERSION_SIZE, 0);
+    codec_version = dce_alloc(VERSION_SIZE);
 #endif
 
     switch( codec_switch ) {
@@ -1151,7 +1151,7 @@ int main(int argc, char * *argv)
 
 #ifdef GETVERSION
     if( codec_version ) {
-        MemMgr_Free(codec_version);
+        dce_free(codec_version);
     }
 #endif
 
index 3b640a5b991f5fada9d091f4f2fe24b300b3af27..33d4f03e0916b29fe55171662ca7b442a473edd1 100644 (file)
@@ -988,9 +988,10 @@ int main(int argc, char * *argv)
  */
 
 #ifdef GETVERSION
-    // Allocating TILER 1D to store the Codec version information from Codec.
+    // Allocating memory to store the Codec version information from Codec.
     char *codec_version = NULL;
-    codec_version = tiler_alloc(VERSION_SIZE, 0);
+    codec_version = dce_alloc(VERSION_SIZE);
+    DEBUG("codec_version 0x%x", codec_version);
 #endif
 
     switch( codec_switch ) {
@@ -1131,7 +1132,7 @@ int main(int argc, char * *argv)
 
 #ifdef GETVERSION
     if( codec_version ) {
-        MemMgr_Free(codec_version);
+        dce_free(codec_version);
     }
 #endif
 
@@ -1145,7 +1146,7 @@ int main(int argc, char * *argv)
     DEBUG("input buffer configuration width %d height %d", width, height);
     inBufs = dce_alloc(sizeof(XDM2_BufDesc));
     inBufs->numBufs = 1;
-    input = tiler_alloc(width * height, 0);
+    input = dce_alloc(width * height);
     inBufs->descs[0].buf = (XDAS_Int8 *)input;
     inBufs->descs[0].memType = XDM_MEMTYPE_RAW;
 
@@ -1485,7 +1486,7 @@ out:
         dce_free(outArgs);
     }
     if( input ) {
-        MemMgr_Free(input);
+        dce_free(input);
     }
 
     output_free();