]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/libdce2.git/commitdiff
[DCE] Modify approach to pass parameters to IPC
authorSaurabh Bipin Chandra <a0131926@ti.com>
Wed, 31 Jul 2013 14:50:49 +0000 (20:20 +0530)
committerSaurabh Bipin Chandra <a0131926@ti.com>
Tue, 27 Aug 2013 21:12:42 +0000 (02:42 +0530)
Three approaches were followed for IPC MmRpc calls.
1. All the parameters which need to be sent and received to/from IPU are coupled in a struct
   allocated from Shared/Tiler Memory. Only the adrress of the struct is passed to MmRpc
   as a pointer argument. This approach is useful as MmRpc in some cases to avoid multiple
   translations. This approach is followed for :
   Engine_open(), Engine_close(), create(), control(), delete()
2. All the parameters which need to be sent are given as separate arguments to
   MmRpc. This approach is needed when you need to translate an address which is
   ofsetted from a pointer which in itself needs to be translated.
   This apporach is followed for : process()
   For understanding, take the example of inbufs argument in process call(). Inbufs
   allocated in Shared memory and needs to be translated, has the address of Input
   buffer (allocated from Tiler). It is not possible to give the Input buffer as an argument
   to Mmrpc for translation until inbufs is given as a parameter to Mmrpc. Therefore inbuf
   can't be populated inside another Shared/Tiler memory struct.
3. This approach is a workaround to use approach [1] by solving the issue posed by [2].
   This approach is followed for : get_version()
   Taking the example of inbufs to explain, the Input buffer address will be one of the
   parameters of the struct (explained in [1]) along with inbufs address. Therefore the
   Input buffer address will get translated here. At the IPU, this address needs to be
   copied back to inbufs.

This patch aligns all DCE calls except Engine_Open to use Approach [2].
Engine_open still follows Approach [1] because:
1. Engine open takes in pointers to Engine_attrs and Error_code structures. The client may
   set both, none or either one of them to NULL (as allowed by CE). So that implies either
   I'll have to pass NULL as param_pointer to IPU or decide not to pass them at all. In the
   second case, I'll have to pass extra arguments to inform IPU that I have not passed Attrs
   or ErrorCode or both.

I tried passing NULL but mmrpc_write failed.

Dependent on ipumm patch:
https://gerrit.ext.ti.com/gerrit/omap/#/c/12773

Change-Id: Ic770aaa99a56ea559efe9446e6e98d70726cc7c5
Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
dce_rpc.h
libdce.c

index 8082d76d151e40ae768bc829f6bb2d4e7e271077..d487ba45bebb408e39a51a62b8d28eddb5c4d9db 100644 (file)
--- a/dce_rpc.h
+++ b/dce_rpc.h
 
 #define DCE_DEVICE_NAME "rpmsg-dce"
 
+#define MAX_NAME_LENGTH 32
+#define MAX_INPUT_BUF 2 // Need to confirm for interlaced YUVs for Encoders
+#define MAX_OUTPUT_BUF 2
+#define MAX_TOTAl_BUF (MAX_INPUT_BUF + MAX_OUTPUT_BUF)
+
 /* Message-Ids:
  */
 //#define DCE_RPC_CONNECT         (0x80000000 | 00) Connect not needed anymore.
@@ -70,76 +75,10 @@ typedef struct dce_connect {
 } dce_connect;
 
 typedef struct dce_engine_open {
-    char          name[32]; /* engine name (in) */
-    Engine_Error  error_code;   /* error code (out) */
-    Engine_Handle eng_handle;   /* engine handle (out) */
+    char          name[MAX_NAME_LENGTH];      /* engine name (in) */
+    Engine_Attrs *engine_attrs;  /* engine attributes (out) */
+    Engine_Error  error_code;    /* error code (out) */
 } dce_engine_open;
 
-typedef struct dce_engine_close {
-    Engine_Handle eng_handle;   /* engine handle (in) */
-} dce_engine_close;
-
-typedef struct dce_codec_create {
-    Engine_Handle  engine;
-    char           codec_name[32];
-    void          *static_params;
-    dce_codec_type codec_id;
-    void          *codec_handle;
-} dce_codec_create;
-
-typedef struct dce_codec_control {
-    void          *codec_handle;
-    uint32_t       cmd_id;
-    void          *dyn_params;
-    void          *status;
-    dce_codec_type codec_id;
-    int32_t        result;
-} dce_codec_control;
-
-typedef struct dce_codec_get_version {
-    void          *codec_handle;
-    void          *dyn_params;
-    void          *status;
-    void          *version;
-    dce_codec_type codec_id;
-    int32_t        result;
-} dce_codec_get_version;
-
-typedef struct dce_codec_delete {
-    void          *codec_handle;
-    dce_codec_type codec_id;
-} dce_codec_delete;
-
-/*  ---------------------- For GLP DCE -----------------------------*/
-/* NOTE: CODEC_PROCESS does somewhat more than the other ioctls, in that it
- * handles buffer mapping/unmapping.  So the inBufs/outBufs are copied inline
- * (with translated addresses in the copy sent inline with codec_process_req).
- * Since we need the inputID from inArgs, and it is a small struct, it is also
- * copied inline.
- *
- * Therefore, the variable length data[] section has the format:
- *    uint8_t reloc[reloc_length * 4];
- *    uint8_t inargs[in_args_length * 4];
- *    uint8_t outbufs[in_bufs_length * 4];
- *    uint8_t inbufs[in_bufs_length * 4];
- */
-
-#define MAX_INPUT_BUF 2 // Need to confirm for interlaced YUVs for Encoders
-#define MAX_OUTPUT_BUF 2
-#define MAX_TOTAl_BUF (MAX_INPUT_BUF + MAX_OUTPUT_BUF)
-
-/* Struct to be used if approach [3] of Mmrpc call is followed */
-typedef struct dce_codec_process {
-    void          *codec_handle;
-    void          *inBufs;
-    void          *outBufs;
-    void          *inArgs;
-    void          *outArgs;
-    int32_t        input_Buf[MAX_INPUT_BUF];
-    int32_t        output_Buf[MAX_OUTPUT_BUF];
-    dce_codec_type codec_id;
-    int32_t        result;
-} dce_codec_process;
-
 #endif /* __DCE_RPC_H__ */
 
index 550e85a3f2747ad9e85fe4c70c0c2d0a10a0db13..ed02fcfea7c6cd47ba5a81134593eef932919431 100644 (file)
--- a/libdce.c
+++ b/libdce.c
@@ -216,10 +216,10 @@ EXIT:
 Engine_Handle Engine_open(String name, Engine_Attrs *attrs, Engine_Error *ec)
 {
     MmRpc_FxnCtx        fxnCtx;
-    int32_t             fxnRet;
     dce_error_status    eError = DCE_EOK;
     dce_engine_open    *engine_open_msg = NULL;
-    Engine_Handle       eng_handle = NULL;
+    Engine_Attrs       *engine_attrs = NULL;
+    Engine_Handle       engine_handle = NULL;
 
     _ASSERT(name != '\0', DCE_EINVALID_INPUT);
 
@@ -228,34 +228,39 @@ Engine_Handle Engine_open(String name, Engine_Attrs *attrs, Engine_Error *ec)
 
     printf(">> Engine_open Params::name = %s size = %d\n", name, strlen(name));
     /* Allocate Shared memory for the engine_open rpc msg structure*/
-    /* Tiler Memory preferred for now for First level testing */
+    /* Tiler Memory preferred in QNX */
     engine_open_msg = memplugin_alloc(sizeof(dce_engine_open), 0, TILER_1D_BUFFER);
+    _ASSERT_AND_EXECUTE(engine_open_msg != NULL, DCE_EOUT_OF_MEMORY, engine_handle = NULL);
 
-    _ASSERT_AND_EXECUTE(engine_open_msg != NULL, DCE_EOUT_OF_MEMORY, eng_handle = NULL);
-
+    if( attrs ) {
+        engine_attrs = memplugin_alloc(sizeof(Engine_Attrs), 0, TILER_1D_BUFFER);
+        _ASSERT_AND_EXECUTE(engine_attrs != NULL, DCE_EOUT_OF_MEMORY, engine_handle = NULL);
+        *engine_attrs = *attrs;
+    }
     /* Populating the msg structure with all the params */
     /* Populating all params into a struct avoid individual address translations of name, ec */
     strncpy(engine_open_msg->name, name, strlen(name));
-    engine_open_msg->eng_handle = NULL;
+    engine_open_msg->engine_attrs = engine_attrs;
 
     /* Marshall function arguments into the send buffer */
     Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_ENGINE_OPEN, 1, 0, NULL);
     Fill_MmRpc_fxnCtx_Ptr_Params(fxnCtx.params, sizeof(dce_engine_open), engine_open_msg, NULL);
 
     /* Invoke the Remote function through MmRpc */
-    eError = MmRpc_call(MmRpcHandle, &fxnCtx, &fxnRet);
+    eError = MmRpc_call(MmRpcHandle, &fxnCtx, (int32_t *)(&engine_handle));
 
     /* In case of Error, the Application will get a NULL Engine Handle */
-    _ASSERT_AND_EXECUTE(eError == DCE_EOK, DCE_EIPC_CALL_FAIL, eng_handle = NULL);
-
-    /* Populate return arguments */
-    eng_handle = engine_open_msg->eng_handle;
-    ec[0] = engine_open_msg->error_code;
+    _ASSERT_AND_EXECUTE(eError == DCE_EOK, DCE_EIPC_CALL_FAIL, engine_handle = NULL);
 
+    if( ec ) {
+        *ec = engine_open_msg->error_code;
+    }
 EXIT:
     memplugin_free(engine_open_msg, TILER_1D_BUFFER);
-
-    return (eng_handle);
+    if( engine_attrs ) {
+        memplugin_free(engine_attrs, TILER_1D_BUFFER);
+    }
+    return ((Engine_Handle)engine_handle);
 }
 
 /*===============================================================*/
@@ -268,21 +273,12 @@ Void Engine_close(Engine_Handle engine)
     MmRpc_FxnCtx        fxnCtx;
     int32_t             fxnRet;
     dce_error_status    eError = DCE_EOK;
-    dce_engine_close   *engine_close_msg = NULL;
 
     _ASSERT(engine != NULL, DCE_EINVALID_INPUT);
 
-    /* Allocate Shared/Tiler memory for the engine_close rpc msg structure*/
-    engine_close_msg = memplugin_alloc(sizeof(dce_engine_close), 0, TILER_1D_BUFFER);
-
-    _ASSERT(engine_close_msg != NULL, DCE_EOUT_OF_MEMORY);
-
-    /* Populating the msg structure with all the params */
-    engine_close_msg->eng_handle = engine;
-
     /* Marshall function arguments into the send buffer */
     Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_ENGINE_CLOSE, 1, 0, NULL);
-    Fill_MmRpc_fxnCtx_Ptr_Params(fxnCtx.params, sizeof(dce_engine_close), engine_close_msg, NULL);
+    Fill_MmRpc_fxnCtx_Scalar_Params(fxnCtx.params, sizeof(Engine_Handle), (int32_t)engine);
 
     /* Invoke the Remote function through MmRpc */
     eError = MmRpc_call(MmRpcHandle, &fxnCtx, &fxnRet);
@@ -290,8 +286,6 @@ Void Engine_close(Engine_Handle engine)
     _ASSERT(eError == DCE_EOK, DCE_EIPC_CALL_FAIL);
 
 EXIT:
-    memplugin_free(engine_close_msg, TILER_1D_BUFFER);
-
     dce_deinit();
     return;
 }
@@ -313,49 +307,36 @@ EXIT:
 static void *create(Engine_Handle engine, String name, void *params, dce_codec_type codec_id)
 {
     MmRpc_FxnCtx        fxnCtx;
-    MmRpc_Xlt           xltAry;
-    int32_t             fxnRet;
     dce_error_status    eError = DCE_EOK;
-    dce_codec_create   *codec_create_msg = NULL;
     void               *codec_handle = NULL;
+    char               *codec_name = NULL;
 
     _ASSERT(name != '\0', DCE_EINVALID_INPUT);
     _ASSERT(engine != NULL, DCE_EINVALID_INPUT);
     _ASSERT(params != NULL, DCE_EINVALID_INPUT);
 
-    /* Allocate Shared/Tiler memory for the codec_create rpc msg structure*/
-    codec_create_msg = memplugin_alloc(sizeof(dce_codec_create), 0, TILER_1D_BUFFER);
+    /* Allocate shared memory for translating codec name to IPU */
+    codec_name = memplugin_alloc(MAX_NAME_LENGTH * sizeof(char), 0, TILER_1D_BUFFER);
+    _ASSERT_AND_EXECUTE(codec_name != NULL, DCE_EOUT_OF_MEMORY, codec_handle = NULL);
 
-    _ASSERT_AND_EXECUTE(codec_create_msg != NULL, DCE_EOUT_OF_MEMORY, codec_handle = NULL);
-
-    /* Populating the msg structure with all the params */
-    codec_create_msg->engine = engine;
-    strncpy(codec_create_msg->codec_name, name, strlen(name));
-    codec_create_msg->codec_id = codec_id;
-    codec_create_msg->codec_handle = NULL;
-    codec_create_msg->static_params = params;
+    strncpy(codec_name, name, strlen(name));
 
     /* Marshall function arguments into the send buffer */
-    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_CREATE, 1, 1, &xltAry);
-    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[0]), sizeof(dce_codec_create), codec_create_msg, NULL);
-
-    /* Mention the virtual pointers that need translation */
-    /* Allocations through dce_alloc need translation     */
-    /* In this case the static params buffer need translation */
-    Fill_MmRpc_fxnCtx_Xlt_Array(fxnCtx.xltAry, 0, (int32_t)codec_create_msg, (int32_t)&(codec_create_msg->static_params), NULL);
+    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_CREATE, 4, 0, NULL);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[0]), sizeof(int32_t), codec_id);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[1]), sizeof(Engine_Handle), (int32_t)engine);
+    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[2]), (P2H(codec_name))->size, codec_name, NULL);
+    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[3]), (P2H(params))->size, params, NULL);
 
     /* Invoke the Remote function through MmRpc */
-    eError = MmRpc_call(MmRpcHandle, &fxnCtx, &fxnRet);
+    eError = MmRpc_call(MmRpcHandle, &fxnCtx, (int32_t *)(&codec_handle));
 
     /* In case of Error, the Application will get a NULL Codec Handle */
     _ASSERT_AND_EXECUTE(eError == DCE_EOK, DCE_EIPC_CALL_FAIL, codec_handle = NULL);
 
-    codec_handle = codec_create_msg->codec_handle;
-
 EXIT:
-    memplugin_free(codec_create_msg, TILER_1D_BUFFER);
-
-    return (codec_handle);
+    memplugin_free(codec_name, TILER_1D_BUFFER);
+    return ((void *)codec_handle);
 }
 
 /*===============================================================*/
@@ -375,47 +356,30 @@ EXIT:
  */
 static XDAS_Int32 control(void *codec, int id, void *dynParams, void *status, dce_codec_type codec_id)
 {
-    MmRpc_FxnCtx         fxnCtx;
-    MmRpc_Xlt            xltAry[2];
-    int32_t              fxnRet;
-    dce_error_status     eError = DCE_EOK;
-    dce_codec_control   *codec_control_msg = NULL;
+    MmRpc_FxnCtx        fxnCtx;
+    int32_t             fxnRet;
+    dce_error_status    eError = DCE_EOK;
 
     _ASSERT(codec != NULL, DCE_EINVALID_INPUT);
     _ASSERT(dynParams != NULL, DCE_EINVALID_INPUT);
     _ASSERT(status != NULL, DCE_EINVALID_INPUT);
 
-    /* Allocate Shared/Tiler memory for the codec_control rpc msg structure*/
-    codec_control_msg = memplugin_alloc(sizeof(dce_codec_control), 0, TILER_1D_BUFFER);
-
-    _ASSERT(codec_control_msg != NULL, DCE_EOUT_OF_MEMORY);
-
-    /* Populating the msg structure with all the params */
-    codec_control_msg->codec_handle = codec;
-    codec_control_msg->cmd_id = id;
-    codec_control_msg->codec_id = codec_id;
-    codec_control_msg->dyn_params = dynParams;
-    codec_control_msg->status = status;
-
     /* Marshall function arguments into the send buffer */
-    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_CONTROL, 1, 2, xltAry);
-    Fill_MmRpc_fxnCtx_Ptr_Params(fxnCtx.params, sizeof(dce_codec_control), codec_control_msg, NULL);
-
-    /* Dynamic and status params buffer need translation */
-    Fill_MmRpc_fxnCtx_Xlt_Array(fxnCtx.xltAry, 0, (int32_t)codec_control_msg, (int32_t)&(codec_control_msg->dyn_params), NULL);
-    Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[1]), 0, (int32_t)codec_control_msg, (int32_t)&(codec_control_msg->status), NULL);
+    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_CONTROL, 5, 0, NULL);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[0]), sizeof(int32_t), codec_id);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[1]), sizeof(int32_t), (int32_t)codec);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[2]), sizeof(int32_t), (int32_t)id);
+    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[3]), (P2H(dynParams))->size, dynParams, NULL);
+    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[4]), (P2H(status))->size, status, NULL);
 
     /* Invoke the Remote function through MmRpc */
     eError = MmRpc_call(MmRpcHandle, &fxnCtx, &fxnRet);
 
     _ASSERT(eError == DCE_EOK, DCE_EIPC_CALL_FAIL);
 
-    eError = codec_control_msg->result;
-
 EXIT:
-    memplugin_free(codec_control_msg, TILER_1D_BUFFER);
+    return (fxnRet);
 
-    return (eError);
 }
 
 /*===============================================================*/
@@ -437,61 +401,49 @@ EXIT:
  */
 static XDAS_Int32 get_version(void *codec, void *dynParams, void *status, dce_codec_type codec_id)
 {
-    MmRpc_FxnCtx             fxnCtx;
-    MmRpc_Xlt                xltAry[3];
-    int32_t                  fxnRet;
-    dce_error_status         eError = DCE_EOK;
-    dce_codec_get_version   *codec_get_version_msg = NULL;
+    MmRpc_FxnCtx        fxnCtx;
+    MmRpc_Xlt           xltAry;
+    void             * *version_buf = NULL;
+    int32_t             fxnRet;
+    dce_error_status    eError = DCE_EOK;
 
     _ASSERT(codec != NULL, DCE_EINVALID_INPUT);
     _ASSERT(dynParams != NULL, DCE_EINVALID_INPUT);
     _ASSERT(status != NULL, DCE_EINVALID_INPUT);
 
-    /* Allocate Shared/Tiler memory for the codec_get_version rpc msg structure*/
-    codec_get_version_msg = memplugin_alloc(sizeof(dce_codec_get_version), 0, TILER_1D_BUFFER);
-
-    _ASSERT(codec_get_version_msg != NULL, DCE_EOUT_OF_MEMORY);
-
-    /* Populating the msg structure with all the params */
-    codec_get_version_msg->codec_handle = codec;
-    codec_get_version_msg->codec_id = codec_id;
-    codec_get_version_msg->dyn_params = dynParams;
-    codec_get_version_msg->status = status;
     if( codec_id == OMAP_DCE_VIDDEC3 ) {
-        codec_get_version_msg->version = ((IVIDDEC3_Status *)status)->data.buf;
+        version_buf = (void * *)(&(((IVIDDEC3_Status *)status)->data.buf));
     } else if( codec_id == OMAP_DCE_VIDENC2 ) {
-        codec_get_version_msg->version = ((IVIDDEC3_Status *)status)->data.buf;
+        version_buf = (void * *)(&(((IVIDENC2_Status *)status)->data.buf));
     }
+    _ASSERT(*version_buf != NULL, DCE_EINVALID_INPUT);
 
     /* Marshall function arguments into the send buffer */
-    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_CONTROL, 1, 3, xltAry);
-    Fill_MmRpc_fxnCtx_Ptr_Params(fxnCtx.params, sizeof(dce_codec_get_version), codec_get_version_msg, NULL);
+    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_GET_VERSION, 4, 1, &xltAry);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[0]), sizeof(int32_t), codec_id);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[1]), sizeof(int32_t), (int32_t)codec);
+    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[2]), (P2H(dynParams))->size, dynParams, NULL);
+    Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[3]), (P2H(status))->size, status, NULL);
 
-    /* Dynamic, status params and version info buffer need translation */
-    Fill_MmRpc_fxnCtx_Xlt_Array(fxnCtx.xltAry, 0, (int32_t)codec_get_version_msg, (int32_t)&(codec_get_version_msg->dyn_params), NULL);
-    Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[1]), 0, (int32_t)codec_get_version_msg, (int32_t)&(codec_get_version_msg->status), NULL);
-    Fill_MmRpc_fxnCtx_Xlt_Array(&(fxnCtx.xltAry[2]), 0, (int32_t)codec_get_version_msg, (int32_t)&(codec_get_version_msg->version), NULL);
+    /* Address Translation needed for buffer for version Info */
+    Fill_MmRpc_fxnCtx_Xlt_Array(fxnCtx.xltAry, 3, (int32_t)status, (int32_t)version_buf, NULL);
 
     /* Invoke the Remote function through MmRpc */
     eError = MmRpc_call(MmRpcHandle, &fxnCtx, &fxnRet);
 
     _ASSERT(eError == DCE_EOK, DCE_EIPC_CALL_FAIL);
 
-    eError = codec_get_version_msg->result;
-
 EXIT:
-    memplugin_free(codec_get_version_msg, TILER_1D_BUFFER);
-
-    return (eError);
+    return (fxnRet);
 }
 
 typedef enum process_call_params {
-    CODEC_HANDLE_INDEX = 0,
+    CODEC_ID_INDEX = 0,
+    CODEC_HANDLE_INDEX,
     INBUFS_INDEX,
     OUTBUFS_INDEX,
     INARGS_INDEX,
-    OUTARGS_INDEX,
-    CODEC_ID_INDEX
+    OUTARGS_INDEX
 } process_call_params;
 
 /*===============================================================*/
@@ -514,7 +466,7 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
 {
     MmRpc_FxnCtx        fxnCtx;
     MmRpc_Xlt           xltAry[MAX_TOTAl_BUF];
-    int                 fxnRet, count, total_count, numInBufs = 0, numOutBufs = 0, sz[5] = { 0 };
+    int                 fxnRet, count, total_count, numInBufs = 0, numOutBufs = 0, sz[OUTARGS_INDEX + 1] = { 0 };
     dce_error_status    eError = DCE_EOK;
 
     _ASSERT(codec != NULL, DCE_EINVALID_INPUT);
@@ -542,12 +494,12 @@ static XDAS_Int32 process(void *codec, void *inBufs, void *outBufs,
     /* marshall function arguments into the send buffer                       */
     /* Approach [2] as explained in "Notes" used for process               */
     Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_PROCESS, 6, numInBufs + numOutBufs, xltAry);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[CODEC_ID_INDEX]), sizeof(int32_t), codec_id);
     Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[CODEC_HANDLE_INDEX]), sizeof(int32_t), (int32_t)codec);
     Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[INBUFS_INDEX]), sz[INBUFS_INDEX], inBufs, NULL);
     Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[OUTBUFS_INDEX]), sz[OUTBUFS_INDEX], outBufs, NULL);
     Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[INARGS_INDEX]), sz[INARGS_INDEX], inArgs, NULL);
     Fill_MmRpc_fxnCtx_Ptr_Params(&(fxnCtx.params[OUTARGS_INDEX]), sz[OUTARGS_INDEX], outArgs, NULL);
-    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[CODEC_ID_INDEX]), sizeof(int32_t), codec_id);
 
     /* InBufs, OutBufs, InArgs, OutArgs buffer need translation but since they have been */
     /* individually mentioned as fxnCtx Params, they need not be mentioned below again */
@@ -586,22 +538,13 @@ static void delete(void *codec, dce_codec_type codec_id)
     MmRpc_FxnCtx        fxnCtx;
     int32_t             fxnRet;
     dce_error_status    eError = DCE_EOK;
-    dce_codec_delete   *codec_delete_msg = NULL;
 
     _ASSERT(codec != NULL, DCE_EINVALID_INPUT);
 
-    /* Allocate Shared/Tiler memory for the codec_delete rpc msg structure*/
-    codec_delete_msg = memplugin_alloc(sizeof(dce_codec_delete), 0, TILER_1D_BUFFER);
-
-    _ASSERT(codec_delete_msg != NULL, DCE_EOUT_OF_MEMORY);
-
-    /* Populating the msg structure with all the params */
-    codec_delete_msg->codec_handle = codec;
-    codec_delete_msg->codec_id = codec_id;
-
     /* Marshall function arguments into the send buffer */
-    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_DELETE, 1, 0, NULL);
-    Fill_MmRpc_fxnCtx_Ptr_Params(fxnCtx.params, sizeof(dce_codec_delete), codec_delete_msg, NULL);
+    Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_CODEC_DELETE, 2, 0, NULL);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[0]), sizeof(int32_t), codec_id);
+    Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[1]), sizeof(int32_t), (int32_t)codec);
 
     /* Invoke the Remote function through MmRpc */
     eError = MmRpc_call(MmRpcHandle, &fxnCtx, &fxnRet);
@@ -609,8 +552,6 @@ static void delete(void *codec, dce_codec_type codec_id)
     _ASSERT(eError == DCE_EOK, DCE_EIPC_CALL_FAIL);
 
 EXIT:
-    memplugin_free(codec_delete_msg, TILER_1D_BUFFER);
-
     return;
 }