Skip to content

Commit c710f59

Browse files
kkobayasmchehab
authored andcommitted
[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>
1 parent 5d6de11 commit c710f59

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎drivers/media/platform/soc_camera/soc_camera.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,22 @@ static int soc_camera_prepare_buf(struct file *file, void *priv,
437437
return vb2_prepare_buf(&icd->vb2_vidq, b);
438438
}
439439

440+
static 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+
440456
/* Always entered with .host_lock held */
441457
static int soc_camera_init_user_formats(struct soc_camera_device *icd)
442458
{
@@ -2083,6 +2099,7 @@ static const struct v4l2_ioctl_ops soc_camera_ioctl_ops = {
20832099
.vidioc_dqbuf = soc_camera_dqbuf,
20842100
.vidioc_create_bufs = soc_camera_create_bufs,
20852101
.vidioc_prepare_buf = soc_camera_prepare_buf,
2102+
.vidioc_expbuf = soc_camera_expbuf,
20862103
.vidioc_streamon = soc_camera_streamon,
20872104
.vidioc_streamoff = soc_camera_streamoff,
20882105
.vidioc_cropcap = soc_camera_cropcap,

0 commit comments

Comments
 (0)