diff options
author | Sunita Nadampalli | 2014-11-14 11:50:08 -0600 |
---|---|---|
committer | Sunita Nadampalli | 2014-11-14 11:50:08 -0600 |
commit | 5693201c37da9070928a751d79cbfed6bb8dd051 (patch) | |
tree | f604218e7f0c87438bcc0bab44455b2b3f8d4507 | |
parent | 830a4d36e8c6e9eb2ac97f9a1472e04b71832987 (diff) | |
download | repo-libdce-5693201c37da9070928a751d79cbfed6bb8dd051.tar.gz repo-libdce-5693201c37da9070928a751d79cbfed6bb8dd051.tar.xz repo-libdce-5693201c37da9070928a751d79cbfed6bb8dd051.zip |
libdce: Changes to make dce_ipc_init/deinit external
dce_ipc_init and dce_ipc_deinit are required by
android memplugin even before DCE engine open happens.
This is required to use MmRpc interface for DRM/GEM
buffer locking.
Change-Id: Ia11af04658c367242c33ab8acffaa4b522aa0716
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
-rw-r--r-- | Android.mk | 6 | ||||
-rw-r--r-- | libdce.c | 13 | ||||
-rw-r--r-- | libdce.h | 16 |
3 files changed, 23 insertions, 12 deletions
@@ -27,17 +27,15 @@ LOCAL_C_INCLUDES += \ | |||
27 | $(LOCAL_PATH)/packages/xdais/ \ | 27 | $(LOCAL_PATH)/packages/xdais/ \ |
28 | $(LOCAL_PATH)/packages/xdctools/ \ | 28 | $(LOCAL_PATH)/packages/xdctools/ \ |
29 | $(LOCAL_PATH)/ \ | 29 | $(LOCAL_PATH)/ \ |
30 | hardware/ti/omap4xxx/omx/osal/inc \ | 30 | hardware/ti/ipc/packages/ \ |
31 | hardware/ti/ipc/packages/ti/ipc/mm | ||
32 | 31 | ||
33 | LOCAL_SHARED_LIBRARIES := \ | 32 | LOCAL_SHARED_LIBRARIES := \ |
34 | libmmrpc \ | 33 | libmmrpc \ |
35 | libc \ | 34 | libc \ |
36 | libcutils \ | 35 | libcutils \ |
37 | liblog \ | 36 | liblog \ |
38 | libosal | ||
39 | 37 | ||
40 | LOCAL_CFLAGS += -Dxdc_target_types__=google/targets/arm/std.h -DBUILDOS_ANDROID -DDCE_DEBUG_ENABLE=1 -DDCE_DEBUG_LEVEL=1 | 38 | LOCAL_CFLAGS += -DBUILDOS_ANDROID -DDCE_DEBUG_ENABLE=1 -DDCE_DEBUG_LEVEL=1 |
41 | 39 | ||
42 | LOCAL_MODULE_TAGS:= optional | 40 | LOCAL_MODULE_TAGS:= optional |
43 | 41 | ||
@@ -166,7 +166,7 @@ void dce_free(void *ptr) | |||
166 | * | 166 | * |
167 | * @ return : Error Status. | 167 | * @ return : Error Status. |
168 | */ | 168 | */ |
169 | static int dce_ipc_init(int core) | 169 | int dce_ipc_init(int core) |
170 | { | 170 | { |
171 | MmRpc_Params args; | 171 | MmRpc_Params args; |
172 | dce_error_status eError = DCE_EOK; | 172 | dce_error_status eError = DCE_EOK; |
@@ -200,18 +200,17 @@ EXIT: | |||
200 | /** dce_ipc_deinit : DeInitialize MmRpc. This function is called within | 200 | /** dce_ipc_deinit : DeInitialize MmRpc. This function is called within |
201 | * Engine_close(). | 201 | * Engine_close(). |
202 | */ | 202 | */ |
203 | static void dce_ipc_deinit(int core, int tableIdx) | 203 | void dce_ipc_deinit(int core, int tableIdx) |
204 | { | 204 | { |
205 | /* | ||
206 | There is no need to validate tableIdx as tableIdx is guaranteed to have | ||
207 | valid value when core is valid. core is already validated before coming here. | ||
208 | */ | ||
209 | if(__ClientCount[core] == 0) { | 205 | if(__ClientCount[core] == 0) { |
210 | DEBUG("Nothing to be done: a spurious call\n"); | 206 | DEBUG("Nothing to be done: a spurious call\n"); |
211 | return; | 207 | return; |
212 | } | 208 | } |
213 | __ClientCount[core]--; | 209 | __ClientCount[core]--; |
214 | gEngineHandle[tableIdx][core] = 0; | 210 | |
211 | if (tableIdx >= 0) | ||
212 | gEngineHandle[tableIdx][core] = 0; | ||
213 | |||
215 | if( __ClientCount[core] > 0 ) { | 214 | if( __ClientCount[core] > 0 ) { |
216 | goto EXIT; | 215 | goto EXIT; |
217 | } | 216 | } |
@@ -105,12 +105,26 @@ void dsp_dce_free(void *ptr); | |||
105 | void *dce_init(void); | 105 | void *dce_init(void); |
106 | 106 | ||
107 | /*===============================================================*/ | 107 | /*===============================================================*/ |
108 | /** dce_deinit : Deinitialize DCE. Only Linux applications are expected to call. | 108 | /** dce_deinit : Deinitialize DCE . Only Linux applications are expected to call. |
109 | * | 109 | * |
110 | * @ param dev [in] : Pointer to omap_device structure. | 110 | * @ param dev [in] : Pointer to omap_device structure. |
111 | */ | 111 | */ |
112 | void dce_deinit(void *dev); | 112 | void dce_deinit(void *dev); |
113 | 113 | ||
114 | |||
115 | /** dce_ipc_init : Initialize DCE IPC. this is required to setup mmRpc link. | ||
116 | * | ||
117 | * @ return : Error code. | ||
118 | */ | ||
119 | int dce_ipc_init(int core); | ||
120 | |||
121 | /*===============================================================*/ | ||
122 | /** dce_ipc_deinit : Deinitialize DCE IPC. | ||
123 | * | ||
124 | * @ param dev [in] : Core ID and engine Table Idx, or -1 if no engine exists | ||
125 | */ | ||
126 | void dce_ipc_deinit(int core, int tableIdx); | ||
127 | |||
114 | /************************ Input/Output Buffer Lock/Unlock APIs ************************/ | 128 | /************************ Input/Output Buffer Lock/Unlock APIs ************************/ |
115 | /*=====================================================================================*/ | 129 | /*=====================================================================================*/ |
116 | /** dce_buf_lock : Pin or lock Tiler Buffers which would be used by the IVAHD codec | 130 | /** dce_buf_lock : Pin or lock Tiler Buffers which would be used by the IVAHD codec |