From daf0a63c1c27cd738579b3d10284b5760b70122d Mon Sep 17 00:00:00 2001
|
From: "vicent.chi" <vicent.chi@rock-chips.com>
|
Date: Sat, 28 Mar 2020 18:03:57 +0800
|
Subject: [PATCH 5/8] libv4l mplane plugin add exbuf_ioctl for dmabuf
|
|
Signed-off-by: vicent.chi <vicent.chi@rock-chips.com>
|
---
|
lib/libv4l-mplane/libv4l-mplane.c | 14 +++++++++++++-
|
1 file changed, 13 insertions(+), 1 deletion(-)
|
|
diff --git a/lib/libv4l-mplane/libv4l-mplane.c b/lib/libv4l-mplane/libv4l-mplane.c
|
index b30840a3..db22b0b4 100644
|
--- a/lib/libv4l-mplane/libv4l-mplane.c
|
+++ b/lib/libv4l-mplane/libv4l-mplane.c
|
@@ -539,6 +539,17 @@ static int buf_ioctl(int fd, unsigned long int cmd, struct v4l2_buffer *arg)
|
return ret;
|
}
|
|
+static int exbuf_ioctl(int fd, unsigned long int cmd, struct v4l2_exportbuffer *arg)
|
+{
|
+ if (arg->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ||
|
+ arg->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
|
+ errno = EINVAL;
|
+ return -1;
|
+ }
|
+ arg->type = convert_type(arg->type);
|
+ return SYS_IOCTL(fd, cmd, arg);
|
+}
|
+
|
static int plugin_ioctl(void *dev_ops_priv, int fd,
|
unsigned long int cmd, void *arg)
|
{
|
@@ -580,7 +591,8 @@ static int plugin_ioctl(void *dev_ops_priv, int fd,
|
|
return SYS_IOCTL(fd, cmd, &type);
|
}
|
- /* CASE VIDIOC_EXPBUF: */
|
+ case VIDIOC_EXPBUF:
|
+ return exbuf_ioctl(fd, cmd, arg);
|
default:
|
return SYS_IOCTL(fd, cmd, arg);
|
}
|
--
|
2.20.1
|