summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTyler Luu <tluu@ti.com>2012-07-30 12:18:14 +0800
committerAndy Green <andy.green@linaro.org>2012-07-30 12:18:14 +0800
commit3885067c7d302f3ca8078d898124375a421afd4c (patch)
tree5995b4207c0e9ccd66857df115f022a76e1f4da2 /include
parentb2800c46002d9ea3caaf1d64a6186edb0a62bc7c (diff)
rpmsg: omx: implement separate register ioctl for sgx buffers
This implements a new register ioctl specifically meant for sgx buffers. rpmsg_omx clients are expected to call register ioctl for the specific buffer type (ion or sgx) before sending a buffer to .write for mapping. The registration allows the rpmsg_omx driver to hold a reference to the ion buffers making up the sgx buffer, thereby preventing the buffer(s) to be freed up from under the remote processor. The individual imported ion handles are expected to be passed into the .write call. When a client no longer expects remote processor to use the buffer, client should call unregister ioctl. A separate unregister ioctl for pvr buffers is not created, and the same ion unregister ioctl is expected to be used for all the ion handles a sgx buffer is comprised of. Change-Id: I12d088851f259724e10bed642956bd263b19df1d Signed-off-by: Tyler Luu <tluu@ti.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rpmsg_omx.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/linux/rpmsg_omx.h b/include/linux/rpmsg_omx.h
index 15503d5ee07d..3d5e42aca77f 100644
--- a/include/linux/rpmsg_omx.h
+++ b/include/linux/rpmsg_omx.h
@@ -35,13 +35,27 @@
#include <linux/ioctl.h>
+/**
+ * struct omx_pvr_data - metadata passed to/from userspace for a pvr register
+ * @fd: a file descriptor representing a pvr handle
+ * @num_handles: field filled by driver. userspace uses this to determine
+ * number of handles associated with fd
+ * @handles: opaque pointers pointing to buffers
+ */
+struct omx_pvr_data {
+ int fd;
+ unsigned int num_handles;
+ void *handles[2];
+};
+
#define OMX_IOC_MAGIC 'X'
#define OMX_IOCCONNECT _IOW(OMX_IOC_MAGIC, 1, char *)
#define OMX_IOCIONREGISTER _IOWR(OMX_IOC_MAGIC, 2, struct ion_fd_data)
#define OMX_IOCIONUNREGISTER _IOWR(OMX_IOC_MAGIC, 3, struct ion_fd_data)
+#define OMX_IOCPVRREGISTER _IOWR(OMX_IOC_MAGIC, 4, struct omx_pvr_data)
-#define OMX_IOC_MAXNR (3)
+#define OMX_IOC_MAXNR (4)
#ifdef __KERNEL__