aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunita Nadampalli2013-09-13 06:05:29 -0500
committerSunita Nadampalli2013-09-13 06:05:29 -0500
commite6859266dde6d2c5a85b43fd1ca27ce093b93eb8 (patch)
tree76e5e158b6016e57a26f00421c49fa8b39f301fd /libdce.c
parent71a368d4d01d0dd7bd80f1189fe205f4645fd320 (diff)
downloadrepo-libdce-e6859266dde6d2c5a85b43fd1ca27ce093b93eb8.tar.gz
repo-libdce-e6859266dde6d2c5a85b43fd1ca27ce093b93eb8.tar.xz
repo-libdce-e6859266dde6d2c5a85b43fd1ca27ce093b93eb8.zip
[LIBDCE] update memplugin headers and apis
memheader and memplugin apis are extended to meet the requirements for mem allocations/free/share for all OSes. Change-Id: Ide911d1654ccd0807ace37de9576299cbb860d07 Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Diffstat (limited to 'libdce.c')
-rw-r--r--libdce.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libdce.c b/libdce.c
index b781972..61d1d9d 100644
--- a/libdce.c
+++ b/libdce.c
@@ -137,12 +137,12 @@ static inline void Fill_MmRpc_fxnCtx_Xlt_Array(MmRpc_Xlt *mmrpc_xlt, int index,
137/* These interfaces are implemented to maintain Backward Compatability */ 137/* These interfaces are implemented to maintain Backward Compatability */
138void *dce_alloc(int sz) 138void *dce_alloc(int sz)
139{ 139{
140 return (memplugin_alloc(sz, 0, TILER_1D_BUFFER)); 140 return (memplugin_alloc(sz, 1, MEM_TILER_1D, 0, 0));
141} 141}
142 142
143void dce_free(void *ptr) 143void dce_free(void *ptr)
144{ 144{
145 memplugin_free(ptr, TILER_1D_BUFFER); 145 memplugin_free(ptr);
146} 146}
147 147
148/*=====================================================================================*/ 148/*=====================================================================================*/
@@ -225,11 +225,11 @@ Engine_Handle Engine_open(String name, Engine_Attrs *attrs, Engine_Error *ec)
225 printf(">> Engine_open Params::name = %s size = %d\n", name, strlen(name)); 225 printf(">> Engine_open Params::name = %s size = %d\n", name, strlen(name));
226 /* Allocate Shared memory for the engine_open rpc msg structure*/ 226 /* Allocate Shared memory for the engine_open rpc msg structure*/
227 /* Tiler Memory preferred in QNX */ 227 /* Tiler Memory preferred in QNX */
228 engine_open_msg = memplugin_alloc(sizeof(dce_engine_open), 0, TILER_1D_BUFFER); 228 engine_open_msg = memplugin_alloc(sizeof(dce_engine_open), 1, DEFAULT_REGION, 0, 0);
229 _ASSERT_AND_EXECUTE(engine_open_msg != NULL, DCE_EOUT_OF_MEMORY, engine_handle = NULL); 229 _ASSERT_AND_EXECUTE(engine_open_msg != NULL, DCE_EOUT_OF_MEMORY, engine_handle = NULL);
230 230
231 if( attrs ) { 231 if( attrs ) {
232 engine_attrs = memplugin_alloc(sizeof(Engine_Attrs), 0, TILER_1D_BUFFER); 232 engine_attrs = memplugin_alloc(sizeof(Engine_Attrs), 1, DEFAULT_REGION, 0, 0);
233 _ASSERT_AND_EXECUTE(engine_attrs != NULL, DCE_EOUT_OF_MEMORY, engine_handle = NULL); 233 _ASSERT_AND_EXECUTE(engine_attrs != NULL, DCE_EOUT_OF_MEMORY, engine_handle = NULL);
234 *engine_attrs = *attrs; 234 *engine_attrs = *attrs;
235 } 235 }
@@ -257,9 +257,9 @@ EXIT:
257 /* Unlock dce_ipc_init() and Engine_open() IPU call */ 257 /* Unlock dce_ipc_init() and Engine_open() IPU call */
258 _ASSERT(sem_post(dce_semaphore) == DCE_EOK, DCE_ESEMAPHORE_FAIL); 258 _ASSERT(sem_post(dce_semaphore) == DCE_EOK, DCE_ESEMAPHORE_FAIL);
259 259
260 memplugin_free(engine_open_msg, TILER_1D_BUFFER); 260 memplugin_free(engine_open_msg);
261 if( engine_attrs ) { 261 if( engine_attrs ) {
262 memplugin_free(engine_attrs, TILER_1D_BUFFER); 262 memplugin_free(engine_attrs);
263 } 263 }
264 return ((Engine_Handle)engine_handle); 264 return ((Engine_Handle)engine_handle);
265} 265}
@@ -325,7 +325,7 @@ static void *create(Engine_Handle engine, String name, void *params, dce_codec_t
325 _ASSERT(params != NULL, DCE_EINVALID_INPUT); 325 _ASSERT(params != NULL, DCE_EINVALID_INPUT);
326 326
327 /* Allocate shared memory for translating codec name to IPU */ 327 /* Allocate shared memory for translating codec name to IPU */
328 codec_name = memplugin_alloc(MAX_NAME_LENGTH * sizeof(char), 0, TILER_1D_BUFFER); 328 codec_name = memplugin_alloc(MAX_NAME_LENGTH * sizeof(char), 1, DEFAULT_REGION, 0, 0);
329 _ASSERT_AND_EXECUTE(codec_name != NULL, DCE_EOUT_OF_MEMORY, codec_handle = NULL); 329 _ASSERT_AND_EXECUTE(codec_name != NULL, DCE_EOUT_OF_MEMORY, codec_handle = NULL);
330 330
331 strncpy(codec_name, name, strlen(name)); 331 strncpy(codec_name, name, strlen(name));
@@ -345,7 +345,7 @@ static void *create(Engine_Handle engine, String name, void *params, dce_codec_t
345 _ASSERT_AND_EXECUTE(eError == DCE_EOK, DCE_EIPC_CALL_FAIL, codec_handle = NULL); 345 _ASSERT_AND_EXECUTE(eError == DCE_EOK, DCE_EIPC_CALL_FAIL, codec_handle = NULL);
346 346
347EXIT: 347EXIT:
348 memplugin_free(codec_name, TILER_1D_BUFFER); 348 memplugin_free(codec_name);
349 return ((void *)codec_handle); 349 return ((void *)codec_handle);
350} 350}
351 351