diff options
authorPradeep Venkatasubbarao2014-03-24 02:48:35 -0500
committerPradeep Venkatasubbarao2014-03-25 23:04:42 -0500
commit1010fffb26ff3ee6e775b2f28d9016a88f26669a (patch)
tree68295d13b5bde5999fbe42cac00fdc95c7804171 /memplugin.h
parent0ab31239d479f6954ba56977cfd358b373b3f9ed (diff)
[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 'memplugin.h')
1 files changed, 8 insertions, 0 deletions
diff --git a/memplugin.h b/memplugin.h
index b8fb866..0c98b4b 100644
--- a/memplugin.h
+++ b/memplugin.h
@@ -74,6 +74,7 @@ typedef struct MemHeader {
74 uint32_t offset; /* offset for the actual data with in the buffer */ 74 uint32_t offset; /* offset for the actual data with in the buffer */
75 int32_t map_fd; /* mmapped fd */ 75 int32_t map_fd; /* mmapped fd */
76 void * handle; /*custom handle for the HLOS memallocator*/ 76 void * handle; /*custom handle for the HLOS memallocator*/
77 int flags; /*memory attributes*/
77} MemHeader; 78} MemHeader;
78 79
79typedef enum MemoryRegion { 80typedef enum MemoryRegion {
@@ -85,6 +86,13 @@ typedef enum MemoryRegion {
86} MemRegion; 87} MemRegion;
87 88
89typedef enum core_type {
91 IPU = 0,
92 DSP = 1,
88/* DCE Error Types */ 96/* DCE Error Types */
89typedef enum mem_error_status { 97typedef enum mem_error_status {
90 MEM_EOK = 0, 98 MEM_EOK = 0,