[media] exynos-gsc: Support dmabuf export buffer
authorShaik Ameer Basha <shaik.ameer@samsung.com>
Fri, 7 Dec 2012 11:28:55 +0000 (08:28 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 6 Jan 2013 11:42:33 +0000 (09:42 -0200)
This patch adds the dmabuf export buffer feature to the
Exynos G-Scaler driver.

Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/exynos-gsc/gsc-m2m.c

index 0d06d6c6f37376f8b8a3e48e0c225c235f74f53e..386c0a7a3a529e4a6d50df079a2e0c3df7dd70d5 100644 (file)
@@ -373,6 +373,13 @@ static int gsc_m2m_reqbufs(struct file *file, void *fh,
        return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, reqbufs);
 }
 
+static int gsc_m2m_expbuf(struct file *file, void *fh,
+                               struct v4l2_exportbuffer *eb)
+{
+       struct gsc_ctx *ctx = fh_to_ctx(fh);
+       return v4l2_m2m_expbuf(file, ctx->m2m_ctx, eb);
+}
+
 static int gsc_m2m_querybuf(struct file *file, void *fh,
                                        struct v4l2_buffer *buf)
 {
@@ -554,6 +561,7 @@ static const struct v4l2_ioctl_ops gsc_m2m_ioctl_ops = {
        .vidioc_s_fmt_vid_cap_mplane    = gsc_m2m_s_fmt_mplane,
        .vidioc_s_fmt_vid_out_mplane    = gsc_m2m_s_fmt_mplane,
        .vidioc_reqbufs                 = gsc_m2m_reqbufs,
+       .vidioc_expbuf                  = gsc_m2m_expbuf,
        .vidioc_querybuf                = gsc_m2m_querybuf,
        .vidioc_qbuf                    = gsc_m2m_qbuf,
        .vidioc_dqbuf                   = gsc_m2m_dqbuf,
@@ -571,7 +579,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 
        memset(src_vq, 0, sizeof(*src_vq));
        src_vq->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
-       src_vq->io_modes = VB2_MMAP | VB2_USERPTR;
+       src_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
        src_vq->drv_priv = ctx;
        src_vq->ops = &gsc_m2m_qops;
        src_vq->mem_ops = &vb2_dma_contig_memops;
@@ -583,7 +591,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq,
 
        memset(dst_vq, 0, sizeof(*dst_vq));
        dst_vq->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
-       dst_vq->io_modes = VB2_MMAP | VB2_USERPTR;
+       dst_vq->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
        dst_vq->drv_priv = ctx;
        dst_vq->ops = &gsc_m2m_qops;
        dst_vq->mem_ops = &vb2_dma_contig_memops;