aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorKazunori Kobayashi <kkobayas@igel.co.jp>2014-09-11 02:09:38 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-26 05:47:44 -0400
commitc710f591a6f209220bd0649153e1fbc78bc09db9 (patch)
tree97219e633957dccb3453f3a8330d03713167d568 /drivers/media/platform
parent5d6de11c331d61dd27cf02f54243ebd1fcfbbfb3 (diff)
[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/platform')
-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,
437 return vb2_prepare_buf(&icd->vb2_vidq, b); 437 return vb2_prepare_buf(&icd->vb2_vidq, b);
438} 438}
439 439
440static int soc_camera_expbuf(struct file *file, void *priv,
441 struct v4l2_exportbuffer *p)
442{
443 struct soc_camera_device *icd = file->private_data;
444 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
445
446 if (icd->streamer != file)
447 return -EBUSY;
448
449 /* videobuf2 only */
450 if (ici->ops->init_videobuf)
451 return -EINVAL;
452 else
453 return vb2_expbuf(&icd->vb2_vidq, p);
454}
455
440/* Always entered with .host_lock held */ 456/* Always entered with .host_lock held */
441static int soc_camera_init_user_formats(struct soc_camera_device *icd) 457static int soc_camera_init_user_formats(struct soc_camera_device *icd)
442{ 458{
@@ -2083,6 +2099,7 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = {
2083 .vidioc_dqbuf = soc_camera_dqbuf, 2099 .vidioc_dqbuf = soc_camera_dqbuf,
2084 .vidioc_create_bufs = soc_camera_create_bufs, 2100 .vidioc_create_bufs = soc_camera_create_bufs,
2085 .vidioc_prepare_buf = soc_camera_prepare_buf, 2101 .vidioc_prepare_buf = soc_camera_prepare_buf,
2102 .vidioc_expbuf = soc_camera_expbuf,
2086 .vidioc_streamon = soc_camera_streamon, 2103 .vidioc_streamon = soc_camera_streamon,
2087 .vidioc_streamoff = soc_camera_streamoff, 2104 .vidioc_streamoff = soc_camera_streamoff,
2088 .vidioc_cropcap = soc_camera_cropcap, 2105 .vidioc_cropcap = soc_camera_cropcap,