aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaurabh Bipin Chandra2013-08-04 04:55:14 -0500
committerSaurabh Bipin Chandra2013-08-30 00:58:22 -0500
commit6163ea9eb894f3d88562e31ea442f848a6e8a568 (patch)
treea2092941c0ce83d28e9faeb0d112f245d225162d /memplugin.h
parent060b6ab4d13c30af1062df055889f86ccca3c6b7 (diff)
downloadrepo-libdce-6163ea9eb894f3d88562e31ea442f848a6e8a568.tar.gz
repo-libdce-6163ea9eb894f3d88562e31ea442f848a6e8a568.tar.xz
repo-libdce-6163ea9eb894f3d88562e31ea442f848a6e8a568.zip
[GLP] Enable DMA Buf Handle3.00.01.05
This patch converts all MmRpc_Pointer_Param call to MmRpc_OffsetPointer_Param to take care of MemHeader. This is not needed from a QNX perspective but is needed from a Linux perspective. There should no added latency is QNX due to this change as the rpmsg_rpc kernel path is still the same. This patch invokes memplugin_share() for the buffers allocated through DCE to get the corresponding DMA Buf Handles for GLP. For QNX, the return value is expected to be 0. For linux, the patch adds the logic for Single vs Multiplanar buffers. For linux, the memplugin_share() logic is modified to store and retireve the same dma_buf_fd rather than getting a dup() each time. These changes makes the following assumptions: 1. All the parameter buffers are allocated through DCE/MemPlugin. 2. The CLient passes Virtual pointers, rather than DMA Buf Handles to libdce for parameter buffers. 3. For IO Buffers, the client passes DMA Buf Handles and are not allocated using DCE/MemPlugin. This patch assumes MmRpc is exposing translation[i].base. Change-Id: I7d13f4a4d69fbe8b6dd0317e2a860f0df2061ef9 Signed-off-by: Sunita Nadampalli <sunitan@ti.com> Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
Diffstat (limited to 'memplugin.h')
-rw-r--r--memplugin.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/memplugin.h b/memplugin.h
index 49e0500..bd09a8b 100644
--- a/memplugin.h
+++ b/memplugin.h
@@ -56,6 +56,7 @@
56#define P2H(p) (&(((MemHeader *)(p))[-1])) 56#define P2H(p) (&(((MemHeader *)(p))[-1]))
57#define H2P(h) ((void *)&(h)[1]) 57#define H2P(h) ((void *)&(h)[1])
58 58
59#define GetSz(buf) ((P2H(buf))->size + sizeof(MemHeader))
59 60
60/* MemHeader is important because it is necessary to know the */ 61/* MemHeader is important because it is necessary to know the */
61/* size of the parameter buffers on IPU for Cache operations */ 62/* size of the parameter buffers on IPU for Cache operations */
@@ -63,8 +64,11 @@
63/* For ex: static params can be VIDDEC3_Params, IVIDDEC3_Params */ 64/* For ex: static params can be VIDDEC3_Params, IVIDDEC3_Params */
64/* or IH264DEC_Params */ 65/* or IH264DEC_Params */
65typedef struct MemHeader { 66typedef struct MemHeader {
66 int size; 67 uint32_t size;
67 void *ptr; 68 void *ptr;
69#if defined(BUILDOS_LINUX)
70 int32_t dma_buf_fd;
71#endif
68} MemHeader; 72} MemHeader;
69 73
70 74