aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaurabh Bipin Chandra2013-07-31 09:50:49 -0500
committerSaurabh Bipin Chandra2013-08-27 16:12:42 -0500
commit17668bcb5a1f7f9db2ba225b1825bc55365c3e66 (patch)
tree20a4d47c840afbb44a6c232e6aac05e0c8ffa77a /dce_rpc.h
parent2bda487ad3ce775777d03cf2b7cfd31d9ec9329a (diff)
downloadhardware-ti-libdce-17668bcb5a1f7f9db2ba225b1825bc55365c3e66.tar.gz
hardware-ti-libdce-17668bcb5a1f7f9db2ba225b1825bc55365c3e66.tar.xz
hardware-ti-libdce-17668bcb5a1f7f9db2ba225b1825bc55365c3e66.zip
[DCE] Modify approach to pass parameters to IPC
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>
Diffstat (limited to 'dce_rpc.h')
-rw-r--r--dce_rpc.h77
1 files changed, 8 insertions, 69 deletions
diff --git a/dce_rpc.h b/dce_rpc.h
index 8082d76..d487ba4 100644
--- a/dce_rpc.h
+++ b/dce_rpc.h
@@ -44,6 +44,11 @@
44 44
45#define DCE_DEVICE_NAME "rpmsg-dce" 45#define DCE_DEVICE_NAME "rpmsg-dce"
46 46
47#define MAX_NAME_LENGTH 32
48#define MAX_INPUT_BUF 2 // Need to confirm for interlaced YUVs for Encoders
49#define MAX_OUTPUT_BUF 2
50#define MAX_TOTAl_BUF (MAX_INPUT_BUF + MAX_OUTPUT_BUF)
51
47/* Message-Ids: 52/* Message-Ids:
48 */ 53 */
49//#define DCE_RPC_CONNECT (0x80000000 | 00) Connect not needed anymore. 54//#define DCE_RPC_CONNECT (0x80000000 | 00) Connect not needed anymore.
@@ -70,76 +75,10 @@ typedef struct dce_connect {
70} dce_connect; 75} dce_connect;
71 76
72typedef struct dce_engine_open { 77typedef struct dce_engine_open {
73 char name[32]; /* engine name (in) */ 78 char name[MAX_NAME_LENGTH]; /* engine name (in) */
74 Engine_Error error_code; /* error code (out) */ 79 Engine_Attrs *engine_attrs; /* engine attributes (out) */
75 Engine_Handle eng_handle; /* engine handle (out) */ 80 Engine_Error error_code; /* error code (out) */
76} dce_engine_open; 81} dce_engine_open;
77 82
78typedef struct dce_engine_close {
79 Engine_Handle eng_handle; /* engine handle (in) */
80} dce_engine_close;
81
82typedef struct dce_codec_create {
83 Engine_Handle engine;
84 char codec_name[32];
85 void *static_params;
86 dce_codec_type codec_id;
87 void *codec_handle;
88} dce_codec_create;
89
90typedef struct dce_codec_control {
91 void *codec_handle;
92 uint32_t cmd_id;
93 void *dyn_params;
94 void *status;
95 dce_codec_type codec_id;
96 int32_t result;
97} dce_codec_control;
98
99typedef struct dce_codec_get_version {
100 void *codec_handle;
101 void *dyn_params;
102 void *status;
103 void *version;
104 dce_codec_type codec_id;
105 int32_t result;
106} dce_codec_get_version;
107
108typedef struct dce_codec_delete {
109 void *codec_handle;
110 dce_codec_type codec_id;
111} dce_codec_delete;
112
113/* ---------------------- For GLP DCE -----------------------------*/
114/* NOTE: CODEC_PROCESS does somewhat more than the other ioctls, in that it
115 * handles buffer mapping/unmapping. So the inBufs/outBufs are copied inline
116 * (with translated addresses in the copy sent inline with codec_process_req).
117 * Since we need the inputID from inArgs, and it is a small struct, it is also
118 * copied inline.
119 *
120 * Therefore, the variable length data[] section has the format:
121 * uint8_t reloc[reloc_length * 4];
122 * uint8_t inargs[in_args_length * 4];
123 * uint8_t outbufs[in_bufs_length * 4];
124 * uint8_t inbufs[in_bufs_length * 4];
125 */
126
127#define MAX_INPUT_BUF 2 // Need to confirm for interlaced YUVs for Encoders
128#define MAX_OUTPUT_BUF 2
129#define MAX_TOTAl_BUF (MAX_INPUT_BUF + MAX_OUTPUT_BUF)
130
131/* Struct to be used if approach [3] of Mmrpc call is followed */
132typedef struct dce_codec_process {
133 void *codec_handle;
134 void *inBufs;
135 void *outBufs;
136 void *inArgs;
137 void *outArgs;
138 int32_t input_Buf[MAX_INPUT_BUF];
139 int32_t output_Buf[MAX_OUTPUT_BUF];
140 dce_codec_type codec_id;
141 int32_t result;
142} dce_codec_process;
143
144#endif /* __DCE_RPC_H__ */ 83#endif /* __DCE_RPC_H__ */
145 84