summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorKazunori Kobayashi <kkobayas@igel.co.jp>2014-09-11 08:09:38 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-26 11:47:44 +0200
commitc710f591a6f209220bd0649153e1fbc78bc09db9 (patch)
tree97219e633957dccb3453f3a8330d03713167d568 /drivers/media
parent[media] mx2-camera: potential negative underflow bug (diff)
downloadlinux-c710f591a6f209220bd0649153e1fbc78bc09db9.tar.xz
linux-c710f591a6f209220bd0649153e1fbc78bc09db9.zip
[media] soc_camera: Support VIDIOC_EXPBUF ioctl
This patch allows for exporting a dmabuf descriptor from soc_camera drivers. Signed-off-by: Kazunori Kobayashi <kkobayas@igel.co.jp> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index ee8cdc95a9f9..8e61b976da19 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -437,6 +437,22 @@ static int soc_camera_prepare_buf(struct file *file, void *priv,
return vb2_prepare_buf(&icd->vb2_vidq, b);
}
+static int soc_camera_expbuf(struct file *file, void *priv,
+ struct v4l2_exportbuffer *p)
+{
+ struct soc_camera_device *icd = file->private_data;
+ struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
+
+ if (icd->streamer != file)
+ return -EBUSY;
+
+ /* videobuf2 only */
+ if (ici->ops->init_videobuf)
+ return -EINVAL;
+ else
+ return vb2_expbuf(&icd->vb2_vidq, p);
+}
+
/* Always entered with .host_lock held */
static int soc_camera_init_user_formats(struct soc_camera_device *icd)
{
@@ -2083,6 +2099,7 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = {
.vidioc_dqbuf = soc_camera_dqbuf,
.vidioc_create_bufs = soc_camera_create_bufs,
.vidioc_prepare_buf = soc_camera_prepare_buf,
+ .vidioc_expbuf = soc_camera_expbuf,
.vidioc_streamon = soc_camera_streamon,
.vidioc_streamoff = soc_camera_streamoff,
.vidioc_cropcap = soc_camera_cropcap,