aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaurabh Bipin Chandra2013-08-30 06:58:19 -0500
committerSaurabh Bipin Chandra2013-09-04 07:38:50 -0500
commitfde931439600e9be8f4556960230f6b62a474ade (patch)
tree3300cbf744abe9f8cd9584f9891c3b045af81a94 /libdce.h
parentbd95703493320275efe5b3d0db6d75e783a88414 (diff)
downloadrepo-libdce-fde931439600e9be8f4556960230f6b62a474ade.tar.gz
repo-libdce-fde931439600e9be8f4556960230f6b62a474ade.tar.xz
repo-libdce-fde931439600e9be8f4556960230f6b62a474ade.zip
[LINUX] Expose API to lock and Unlock IO Buffers
This patch exposes APIs: dce_buf_lock(int num, size_t *handle) dce_buf_unlock(int num, size_t *handle) to lock and unlock the Input/Output Buffers respectively. The change is specific to GLP. The DRM driver pins and unpins tiler address for the IO Buffers whenever the rpmsg_rpc driver calls map_attachment and unmap_attachment() respectively. As the rpmsg_rpc driver invokes these calls during every process call, the reference buffer addresses (address of past locked buffers) held by the codec gets invalidated. That is, these addresses will not continue to map to the same memory region (YUV reference buffer) as before. Most often, these virtual addresses may point to the next YUV Buffer translated from the MPU. These APIs put a condition on the map and unmap() within rpmsg_rpc. The expectation from the application is to call dce_buf_lock() for the inArgs.inputID buffer and dce_buf_unlock() for the outArgs.freeBufID buffer. Change-Id: Ic749c6b18385f9052a2eeb4e16959063c5efab5e Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
Diffstat (limited to 'libdce.h')
-rw-r--r--libdce.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/libdce.h b/libdce.h
index 9f7dcd7..7a30563 100644
--- a/libdce.h
+++ b/libdce.h
@@ -61,15 +61,33 @@ void dce_free(void *ptr);
61 61
62 62
63#if defined(BUILDOS_LINUX) 63#if defined(BUILDOS_LINUX)
64void dce_set_fd(int fd);
65int dce_get_fd();
66
67/* avoid some messy stuff in xdc/std.h which leads to gcc issues */ 64/* avoid some messy stuff in xdc/std.h which leads to gcc issues */
68#define xdc__ARGTOPTR 65#define xdc__ARGTOPTR
69#define xdc__ARGTOFXN 66#define xdc__ARGTOFXN
70 67
71#define XDM_MEMTYPE_BO 10 68/*=====================================================================================*/
72#define XDM_MEMTYPE_BO_OFFSET 11 69/** dce_buf_lock : Pin or lock Tiler Buffers which would be used by the codec
70 * as reference buffers. API is specific to GLP.
71 *
72 * @ param num [in] : Number of buffers to be locked.
73 * @ param handle [in] : Pointer to array of DMA Buf FDs of the buffers to be locked.
74 * @ return : DCE error status is returned.
75 */
76int dce_buf_lock(int num, size_t *handle);
77
78/*=====================================================================================*/
79/** dce_buf_unlock : Unpin or unlock Tiler Buffers which were locked to be used
80 * by the codec as reference buffers. API is specific to GLP.
81 *
82 * @ param num [in] : Number of buffers to be locked.
83 * @ param handle [in] : Pointer to array of DMA Buf FDs of the buffers to be locked.
84 * @ return : DCE error status is returned.
85 */
86int dce_buf_unlock(int num, size_t *handle);
87
88void dce_set_fd(int fd);
89int dce_get_fd();
90
73#endif /* BUILDOS_LINUX */ 91#endif /* BUILDOS_LINUX */
74 92
75#endif /* __LIBDCE_H__ */ 93#endif /* __LIBDCE_H__ */