summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPradeep Venkatasubbarao2014-03-24 02:48:35 -0500
committerPradeep Venkatasubbarao2014-03-25 23:04:42 -0500
commit1010fffb26ff3ee6e775b2f28d9016a88f26669a (patch)
tree68295d13b5bde5999fbe42cac00fdc95c7804171 /libdce.h
parent0ab31239d479f6954ba56977cfd358b373b3f9ed (diff)
downloadhardware-ti-libdce-1010fffb26ff3ee6e775b2f28d9016a88f26669a.tar.gz
hardware-ti-libdce-1010fffb26ff3ee6e775b2f28d9016a88f26669a.tar.xz
hardware-ti-libdce-1010fffb26ff3ee6e775b2f28d9016a88f26669a.zip
[LINUX] Manage Tiler Pinning for dce DRM buffers
Applications using dce_alloc/dce_free calls to manage memory, leaked memory because on non-closure of the created dmabuf fds. Additionally, all memory allocated from Tiler/DMM via DRM need to be explictly pinned to tiler using dce_buf_lock/dce_buf_unlock calls. Hence in the earlier implementation, every call to dce_alloc/free had to be followed by a lock/unlock call to pin/unpin it to tiler. In order, to insulate the applications from the internal details of DRM memory management and for ease of use of alloc and free calls, dce_alloc now takes care of creating the dmabuf and pinning it to tiler while dce_free takes care of tiler unpinning and closure of dmabuf fd. Applications can continue to use dce_alloc and dce_free calls as before thus maintiaining backward compatibility. On the other hand, since the same interfaces are used for multiple remote core targets, like IPU and DSP, MemHeader struture is upgraded to hold the core for which the block of memory belongs to, to keep track of the core. Hence all applications/Remote cores using this version of libdce should recompile with the new MemHeader for proper functioning. Dependent IPUMM patch: https://gerrit.ext.ti.com/gerrit/omap/#/c/12994/ Change-Id: If09a1039b5b16f3cc5ff0e9c6c598932d8a2ce3e Signed-off-by: Pradeep Venkatasubbarao <pradeepv@ti.com> Signed-off-by: Amarinder Bindra <a-bindra@ti.com> Signed-off-by: Karthik Ramanan <a0393906@ti.com>
Diffstat (limited to 'libdce.h')
-rw-r--r--libdce.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/libdce.h b/libdce.h
index 7e91759..b62bd86 100644
--- a/libdce.h
+++ b/libdce.h
@@ -61,7 +61,8 @@ typedef enum dce_error_status {
61/***************************** Memory Allocation/Free APIs *****************************/ 61/***************************** Memory Allocation/Free APIs *****************************/
62/*=====================================================================================*/ 62/*=====================================================================================*/
63/** dce_alloc : Allocate the Data structures passed to codec-engine APIs 63/** dce_alloc : Allocate the Data structures passed to codec-engine APIs
64 * except Input/Output buffers. 64 * except Input/Output buffers. This should be used for all
65 * Parameter allocation needed for IPU remote proc.
65 * 66 *
66 * @ param sz [in] : Size of memory to be allocated. 67 * @ param sz [in] : Size of memory to be allocated.
67 * @ return : Pointer to allocated memory. 68 * @ return : Pointer to allocated memory.
@@ -69,13 +70,30 @@ typedef enum dce_error_status {
69void *dce_alloc(int sz); 70void *dce_alloc(int sz);
70 71
71/*=====================================================================================*/ 72/*=====================================================================================*/
73/** dsp_dce_alloc : Allocate the Data structures passed to codec-engine APIs
74 * except Input/Output buffers. This should be used for all
75 * Parameter allocation needed for DSP remote proc.
76 *
77 * @ param sz [in] : Size of memory to be allocated.
78 * @ return : Pointer to allocated memory.
79 */
80void *dsp_dce_alloc(int sz);
81
82/*=====================================================================================*/
72/** dce_free : Free the Data structures passed to codec-engine APIs 83/** dce_free : Free the Data structures passed to codec-engine APIs
73 * except Input/Output buffers. 84 * except Input/Output buffers.
74 * 85 *
75 * @ param ptr [in] : Pointer to allocated memory. 86 * @ param ptr [in] : Memory allocated by dce_alloc.
76 */ 87 */
77void dce_free(void *ptr); 88void dce_free(void *ptr);
78 89
90/*=====================================================================================*/
91/** dsp_dce_free : Free the memory
92 *
93 * @ param ptr [in] : memory allocated by dsp_dce_alloc .
94 */
95void dsp_dce_free(void *ptr);
96
79 97
80/*********************************** APIs for Linux ***********************************/ 98/*********************************** APIs for Linux ***********************************/
81/************************ Initialization/Deinitialization APIs ************************/ 99/************************ Initialization/Deinitialization APIs ************************/