]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] coda: enable dmabuf support
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 23 May 2013 10:06:30 +0000 (07:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 27 May 2013 12:32:25 +0000 (09:32 -0300)
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/coda.c

index 421230732051c636d66df35f71d7b67af8d4cc05..2d8e50e1c9b8f6fe6c4fadcedd49070fa0315688 100644 (file)
@@ -569,6 +569,14 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
        return v4l2_m2m_qbuf(file, ctx->m2m_ctx, buf);
 }
 
+static int vidioc_expbuf(struct file *file, void *priv,
+                        struct v4l2_exportbuffer *eb)
+{
+       struct coda_ctx *ctx = fh_to_ctx(priv);
+
+       return v4l2_m2m_expbuf(file, ctx->m2m_ctx, eb);
+}
+
 static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
 {
        struct coda_ctx *ctx = fh_to_ctx(priv);
@@ -609,6 +617,7 @@ static const struct v4l2_ioctl_ops coda_ioctl_ops = {
        .vidioc_querybuf        = vidioc_querybuf,
 
        .vidioc_qbuf            = vidioc_qbuf,
+       .vidioc_expbuf          = vidioc_expbuf,
        .vidioc_dqbuf           = vidioc_dqbuf,
 
        .vidioc_streamon        = vidioc_streamon,
@@ -1422,7 +1431,7 @@ static int coda_queue_init(void *priv, struct vb2_queue *src_vq,
        int ret;
 
        src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
-       src_vq->io_modes = VB2_MMAP | VB2_USERPTR;
+       src_vq->io_modes = VB2_DMABUF | VB2_MMAP | VB2_USERPTR;
        src_vq->drv_priv = ctx;
        src_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
        src_vq->ops = &coda_qops;
@@ -1434,7 +1443,7 @@ static int coda_queue_init(void *priv, struct vb2_queue *src_vq,
                return ret;
 
        dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-       dst_vq->io_modes = VB2_MMAP | VB2_USERPTR;
+       dst_vq->io_modes = VB2_DMABUF | VB2_MMAP | VB2_USERPTR;
        dst_vq->drv_priv = ctx;
        dst_vq->buf_struct_size = sizeof(struct v4l2_m2m_buffer);
        dst_vq->ops = &coda_qops;