summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'libdce.c')
-rw-r--r--libdce.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/libdce.c b/libdce.c
index bd7fb17..d490847 100644
--- a/libdce.c
+++ b/libdce.c
@@ -129,6 +129,7 @@ static inline void Fill_MmRpc_fxnCtx_OffPtr_Params(MmRpc_Param *mmrpc_params, in
129 mmrpc_params->param.offPtr.handle = handle; 129 mmrpc_params->param.offPtr.handle = handle;
130} 130}
131 131
132/*
132static inline void Fill_MmRpc_fxnCtx_Ptr_Params(MmRpc_Param *mmrpc_params, int size, void *addr, size_t handle) 133static inline void Fill_MmRpc_fxnCtx_Ptr_Params(MmRpc_Param *mmrpc_params, int size, void *addr, size_t handle)
133{ 134{
134 mmrpc_params->type = MmRpc_ParamType_Ptr; 135 mmrpc_params->type = MmRpc_ParamType_Ptr;
@@ -136,6 +137,7 @@ static inline void Fill_MmRpc_fxnCtx_Ptr_Params(MmRpc_Param *mmrpc_params, int s
136 mmrpc_params->param.ptr.addr = (size_t)addr; 137 mmrpc_params->param.ptr.addr = (size_t)addr;
137 mmrpc_params->param.ptr.handle = handle; 138 mmrpc_params->param.ptr.handle = handle;
138} 139}
140*/
139 141
140static inline void Fill_MmRpc_fxnCtx_Scalar_Params(MmRpc_Param *mmrpc_params, int size, int data) 142static inline void Fill_MmRpc_fxnCtx_Scalar_Params(MmRpc_Param *mmrpc_params, int size, int data)
141{ 143{
@@ -238,7 +240,7 @@ int dce_callback_putDataFxn(void *codec)
238 /* Call the callback function specified in the dynParams->putDataFxn */ 240 /* Call the callback function specified in the dynParams->putDataFxn */
239 while (1) { 241 while (1) {
240 if( (callbackmsg[id]).putDataFlag == 1 ) { 242 if( (callbackmsg[id]).putDataFlag == 1 ) {
241 DEBUG("lock (callbackmsg[%d]).putDataFxn_thread 0x%x (callbackmsg[%d]).local_dataSyncHandle 0x%x", 243 DEBUG("lock (callbackmsg[%d]).putDataFxn_thread 0x%lx (callbackmsg[%d]).local_dataSyncHandle 0x%x",
242 id, (callbackmsg[id]).putDataFxn_thread, id, (unsigned int) (callbackmsg[id]).local_dataSyncHandle); 244 id, (callbackmsg[id]).putDataFxn_thread, id, (unsigned int) (callbackmsg[id]).local_dataSyncHandle);
243 pthread_mutex_lock(&dce_callback_mutex); 245 pthread_mutex_lock(&dce_callback_mutex);
244 if( (callbackmsg[id]).row_mode ) { 246 if( (callbackmsg[id]).row_mode ) {
@@ -275,7 +277,7 @@ int dce_callback_putDataFxn(void *codec)
275 (callbackmsg[id]).putDataFlag = 0; 277 (callbackmsg[id]).putDataFlag = 0;
276 } 278 }
277 279
278 DEBUG("unlock (callbackmsg[%d]).putDataFxn_thread 0x%x (callbackmsg[%d]).local_dataSyncHandle %p", 280 DEBUG("unlock (callbackmsg[%d]).putDataFxn_thread 0x%lx (callbackmsg[%d]).local_dataSyncHandle %p",
279 id, (callbackmsg[id]).putDataFxn_thread, id, (callbackmsg[id]).local_dataSyncHandle); 281 id, (callbackmsg[id]).putDataFxn_thread, id, (callbackmsg[id]).local_dataSyncHandle);
280 pthread_mutex_unlock(&dce_callback_mutex); 282 pthread_mutex_unlock(&dce_callback_mutex);
281 } 283 }
@@ -326,7 +328,7 @@ int dce_callback_getDataFxn(void *codec)
326 /* Call the callback function specified in the dynParams->getDataFxn */ 328 /* Call the callback function specified in the dynParams->getDataFxn */
327 while( 1 ) { 329 while( 1 ) {
328 if( (callbackmsg[id]).getDataFlag == 1 ) { 330 if( (callbackmsg[id]).getDataFlag == 1 ) {
329 DEBUG("lock (callbackmsg[%d]).getDataFxn_thread 0x%x (callbackmsg[%d]).local_dataSyncHandle %p", 331 DEBUG("lock (callbackmsg[%d]).getDataFxn_thread 0x%lx (callbackmsg[%d]).local_dataSyncHandle %p",
330 id, (callbackmsg[id]).getDataFxn_thread, id, (callbackmsg[id]).local_dataSyncHandle); 332 id, (callbackmsg[id]).getDataFxn_thread, id, (callbackmsg[id]).local_dataSyncHandle);
331 pthread_mutex_lock(&dce_callback_mutex); 333 pthread_mutex_lock(&dce_callback_mutex);
332 if( (callbackmsg[id]).row_mode ) { 334 if( (callbackmsg[id]).row_mode ) {
@@ -363,7 +365,7 @@ int dce_callback_getDataFxn(void *codec)
363 DEBUG("Received dataSyncDesc->numBlocks == 0 meaning the callback thread has no data -ignore."); 365 DEBUG("Received dataSyncDesc->numBlocks == 0 meaning the callback thread has no data -ignore.");
364 } 366 }
365 } 367 }
366 DEBUG("unlock (callbackmsg[%d]).getDataFxn_thread 0x%x (callbackmsg[%d]).local_dataSyncHandle %p", 368 DEBUG("unlock (callbackmsg[%d]).getDataFxn_thread 0x%lx (callbackmsg[%d]).local_dataSyncHandle %p",
367 id, (callbackmsg[id]).getDataFxn_thread, id, (callbackmsg[id]).local_dataSyncHandle); 369 id, (callbackmsg[id]).getDataFxn_thread, id, (callbackmsg[id]).local_dataSyncHandle);
368 pthread_mutex_unlock(&dce_callback_mutex); 370 pthread_mutex_unlock(&dce_callback_mutex);
369 } 371 }
@@ -574,7 +576,7 @@ EXIT:
574int32_t get_rproc_info(Engine_Handle engine, rproc_info_type info_type) 576int32_t get_rproc_info(Engine_Handle engine, rproc_info_type info_type)
575{ 577{
576 MmRpc_FxnCtx fxnCtx; 578 MmRpc_FxnCtx fxnCtx;
577 int32_t fxnRet; 579 int32_t fxnRet = 0;
578 dce_error_status eError = DCE_EOK; 580 dce_error_status eError = DCE_EOK;
579 int32_t coreIdx = INVALID_CORE; 581 int32_t coreIdx = INVALID_CORE;
580 int tableIdx = -1; 582 int tableIdx = -1;
@@ -803,9 +805,9 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
803 MmRpc_Xlt xltAry[MAX_TOTAL_BUF]; 805 MmRpc_Xlt xltAry[MAX_TOTAL_BUF];
804 int fxnRet, count, total_count, numInBufs = 0, numOutBufs = 0; 806 int fxnRet, count, total_count, numInBufs = 0, numOutBufs = 0;
805 dce_error_status eError = DCE_EOK; 807 dce_error_status eError = DCE_EOK;
806 void **data_buf = NULL; 808 XDAS_Int8 **data_buf = NULL;
807 void **buf_arry = NULL; 809 XDAS_Int8 **buf_arry = NULL;
808 void **bufSize_arry = NULL; 810 XDAS_Int32 **bufSize_arry = NULL;
809 int numXltAry, numParams; 811 int numXltAry, numParams;
810 int coreIdx = INVALID_CORE; 812 int coreIdx = INVALID_CORE;
811 813
@@ -863,11 +865,11 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
863 /* Input and Output Buffers have to be mentioned for translation */ 865 /* Input and Output Buffers have to be mentioned for translation */
864 for( count = 0, total_count = 0; count < numInBufs; count++, total_count++ ) { 866 for( count = 0, total_count = 0; count < numInBufs; count++, total_count++ ) {
865 if( codec_id == OMAP_DCE_VIDDEC3 ) { 867 if( codec_id == OMAP_DCE_VIDDEC3 ) {
866 data_buf = (void * *)(&(((XDM2_BufDesc *)inBufs)->descs[count].buf)); 868 data_buf = (XDAS_Int8 * *)(&(((XDM2_BufDesc *)inBufs)->descs[count].buf));
867 } else if( codec_id == OMAP_DCE_VIDENC2 ) { 869 } else if( codec_id == OMAP_DCE_VIDENC2 ) {
868 data_buf = (void * *)(&(((IVIDEO2_BufDesc *)inBufs)->planeDesc[count].buf)); 870 data_buf = (XDAS_Int8 * *)(&(((IVIDEO2_BufDesc *)inBufs)->planeDesc[count].buf));
869 } else if( codec_id == OMAP_DCE_VIDDEC2 ) { 871 } else if( codec_id == OMAP_DCE_VIDDEC2 ) {
870 data_buf = (void * *)(&(((XDM1_BufDesc *)inBufs)->descs[count].buf)); 872 data_buf = (XDAS_Int8 * *)(&(((XDM1_BufDesc *)inBufs)->descs[count].buf));
871 } 873 }
872#ifdef BUILDOS_ANDROID 874#ifdef BUILDOS_ANDROID
873 inbuf_offset[count] = ((MemHeader*)(*data_buf))->offset; 875 inbuf_offset[count] = ((MemHeader*)(*data_buf))->offset;
@@ -898,7 +900,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
898 if( codec_id == OMAP_DCE_VIDENC2 || codec_id == OMAP_DCE_VIDDEC3 ) { 900 if( codec_id == OMAP_DCE_VIDENC2 || codec_id == OMAP_DCE_VIDDEC3 ) {
899 if( ((XDM2_BufDesc *)outBufs)->descs[LUMA_BUF].buf != ((XDM2_BufDesc *)outBufs)->descs[CHROMA_BUF].buf ) { 901 if( ((XDM2_BufDesc *)outBufs)->descs[LUMA_BUF].buf != ((XDM2_BufDesc *)outBufs)->descs[CHROMA_BUF].buf ) {
900 /* Either Encode usecase or MultiPlanar Buffers for Decode usecase */ 902 /* Either Encode usecase or MultiPlanar Buffers for Decode usecase */
901 data_buf = (void * *)(&(((XDM2_BufDesc *)outBufs)->descs[count].buf)); 903 data_buf = (XDAS_Int8 * *)(&(((XDM2_BufDesc *)outBufs)->descs[count].buf));
902#ifdef BUILDOS_ANDROID 904#ifdef BUILDOS_ANDROID
903 outbuf_offset[count] = ((MemHeader*)(*data_buf))->offset; 905 outbuf_offset[count] = ((MemHeader*)(*data_buf))->offset;
904 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX, MmRpc_OFFSET((int32_t)outBufs, 906 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX, MmRpc_OFFSET((int32_t)outBufs,
@@ -933,7 +935,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
933#endif 935#endif
934 } else if( codec_id == OMAP_DCE_VIDDEC2 ) { 936 } else if( codec_id == OMAP_DCE_VIDDEC2 ) {
935 if( count == LUMA_BUF ) { 937 if( count == LUMA_BUF ) {
936 buf_arry = (void * *)(&(((XDM_BufDesc *)outBufs)->bufs)); 938 buf_arry = (XDAS_Int8 * *)(&(((XDM_BufDesc *)outBufs)->bufs));
937 939
938 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX, 940 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX,
939 MmRpc_OFFSET((int32_t)outBufs, (int32_t)buf_arry), 941 MmRpc_OFFSET((int32_t)outBufs, (int32_t)buf_arry),
@@ -941,7 +943,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
941 943
942 total_count++; 944 total_count++;
943 945
944 bufSize_arry = (void * *)(&(((XDM_BufDesc *)outBufs)->bufSizes)); 946 bufSize_arry = (XDAS_Int32 * *)(&(((XDM_BufDesc *)outBufs)->bufSizes));
945 947
946 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX, 948 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_INDEX,
947 MmRpc_OFFSET((int32_t)outBufs, (int32_t)bufSize_arry), 949 MmRpc_OFFSET((int32_t)outBufs, (int32_t)bufSize_arry),
@@ -953,7 +955,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
953 Fill_MmRpc_fxnCtx_OffPtr_Params(&(fxnCtx.params[OUTBUFS_PTR_INDEX]), GetSz(*buf_arry), P2H(*buf_arry), 955 Fill_MmRpc_fxnCtx_OffPtr_Params(&(fxnCtx.params[OUTBUFS_PTR_INDEX]), GetSz(*buf_arry), P2H(*buf_arry),
954 sizeof(MemHeader), memplugin_share(*buf_arry)); 956 sizeof(MemHeader), memplugin_share(*buf_arry));
955 957
956 data_buf = (void * *)(&(((XDM_BufDesc *)outBufs)->bufs[count])); 958 data_buf = (XDAS_Int8 * *)(&(((XDM_BufDesc *)outBufs)->bufs[count]));
957 959
958 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_PTR_INDEX, 960 Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[total_count]), OUTBUFS_PTR_INDEX,
959 MmRpc_OFFSET((int32_t)*buf_arry, (int32_t)data_buf), (size_t)*data_buf, (size_t)*data_buf); 961 MmRpc_OFFSET((int32_t)*buf_arry, (int32_t)data_buf), (size_t)*data_buf, (size_t)*data_buf);
@@ -968,15 +970,15 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
968 for( count = 0; count < numInBufs; count++ ) { 970 for( count = 0; count < numInBufs; count++ ) {
969 if( codec_id == OMAP_DCE_VIDDEC3 ) { 971 if( codec_id == OMAP_DCE_VIDDEC3 ) {
970 /* restore the actual buf ptr before returing to the mmf */ 972 /* restore the actual buf ptr before returing to the mmf */
971 data_buf = (void * *)(&(((XDM2_BufDesc *)inBufs)->descs[count].buf)); 973 data_buf = (XDAS_Int8 * *)(&(((XDM2_BufDesc *)inBufs)->descs[count].buf));
972 } else if( codec_id == OMAP_DCE_VIDDEC2 ) { 974 } else if( codec_id == OMAP_DCE_VIDDEC2 ) {
973 /* restore the actual buf ptr before returing to the mmf */ 975 /* restore the actual buf ptr before returing to the mmf */
974 data_buf = (void * *)(&(((XDM1_BufDesc *)inBufs)->descs[count].buf)); 976 data_buf = (XDAS_Int8 * *)(&(((XDM1_BufDesc *)inBufs)->descs[count].buf));
975 } 977 }
976 *data_buf -= inbuf_offset[count]; 978 *data_buf -= inbuf_offset[count];
977 } 979 }
978 for (count = 0; count < numOutBufs; count++){ 980 for (count = 0; count < numOutBufs; count++){
979 data_buf = (void * *)(&(((XDM2_BufDesc *)outBufs)->descs[count].buf)); 981 data_buf = (XDAS_Int8 * *)(&(((XDM2_BufDesc *)outBufs)->descs[count].buf));
980 *data_buf -= outbuf_offset[count]; 982 *data_buf -= outbuf_offset[count];
981 } 983 }
982#endif 984#endif
@@ -1363,7 +1365,7 @@ XDAS_Int32 VIDENC2_process(VIDENC2_Handle codec,
1363 DEBUG("Checking row_mode %d", (callbackmsg[id]).row_mode); 1365 DEBUG("Checking row_mode %d", (callbackmsg[id]).row_mode);
1364 if( (callbackmsg[id]).row_mode ) { 1366 if( (callbackmsg[id]).row_mode ) {
1365 (callbackmsg[id]).getDataFlag = 0; 1367 (callbackmsg[id]).getDataFlag = 0;
1366 DEBUG("Checking callbackmsg[%d]->getDataFxn_thread 0x%x", id, (callbackmsg[id]).getDataFxn_thread); 1368 DEBUG("Checking callbackmsg[%d]->getDataFxn_thread 0x%lx", id, (callbackmsg[id]).getDataFxn_thread);
1367 if( !(callbackmsg[id]).getDataFxn_thread ) { 1369 if( !(callbackmsg[id]).getDataFxn_thread ) {
1368 /* Need to start a new thread for the callback handling to request for data - process call will be synchronous. */ 1370 /* Need to start a new thread for the callback handling to request for data - process call will be synchronous. */
1369 pthread_attr_init(&attr); 1371 pthread_attr_init(&attr);