[media] v4l: s5p-fimc: support for dmabuf exporting
authorTomasz Stanislawski <t.stanislaws@samsung.com>
Thu, 14 Jun 2012 14:32:26 +0000 (11:32 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 25 Nov 2012 19:21:44 +0000 (17:21 -0200)
This patch enhances s5p-fimc with support for DMABUF exporting via
VIDIOC_EXPBUF ioctl.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/s5p-fimc/fimc-capture.c
drivers/media/platform/s5p-fimc/fimc-m2m.c

index 246bb329c7ae78b2e787d42bd3e63b2364eec5d5..e5fd159e3ee016ac118e548b9e5c15dd7e2a68eb 100644 (file)
@@ -1231,6 +1231,14 @@ static int fimc_cap_qbuf(struct file *file, void *priv,
        return vb2_qbuf(&fimc->vid_cap.vbq, buf);
 }
 
+static int fimc_cap_expbuf(struct file *file, void *priv,
+                         struct v4l2_exportbuffer *eb)
+{
+       struct fimc_dev *fimc = video_drvdata(file);
+
+       return vb2_expbuf(&fimc->vid_cap.vbq, eb);
+}
+
 static int fimc_cap_dqbuf(struct file *file, void *priv,
                           struct v4l2_buffer *buf)
 {
@@ -1355,6 +1363,7 @@ static const struct v4l2_ioctl_ops fimc_capture_ioctl_ops = {
 
        .vidioc_qbuf                    = fimc_cap_qbuf,
        .vidioc_dqbuf                   = fimc_cap_dqbuf,
+       .vidioc_expbuf                  = fimc_cap_expbuf,
 
        .vidioc_prepare_buf             = fimc_cap_prepare_buf,
        .vidioc_create_bufs             = fimc_cap_create_bufs,
index 6d1ab49aaf0739fd65efdf47bc4900182dd18676..26bcf4bc4209b3fe2349e5fdfebb4ebb72512f6f 100644 (file)
@@ -439,6 +439,15 @@ static int fimc_m2m_dqbuf(struct file *file, void *fh,
        return v4l2_m2m_dqbuf(file, ctx->m2m_ctx, buf);
 }
 
+static int fimc_m2m_expbuf(struct file *file, void *fh,
+                           struct v4l2_exportbuffer *eb)
+{
+       struct fimc_ctx *ctx = fh_to_ctx(fh);
+
+       return v4l2_m2m_expbuf(file, ctx->m2m_ctx, eb);
+}
+
+
 static int fimc_m2m_streamon(struct file *file, void *fh,
                             enum v4l2_buf_type type)
 {
@@ -607,6 +616,7 @@ static const struct v4l2_ioctl_ops fimc_m2m_ioctl_ops = {
        .vidioc_querybuf                = fimc_m2m_querybuf,
        .vidioc_qbuf                    = fimc_m2m_qbuf,
        .vidioc_dqbuf                   = fimc_m2m_dqbuf,
+       .vidioc_expbuf                  = fimc_m2m_expbuf,
        .vidioc_streamon                = fimc_m2m_streamon,
        .vidioc_streamoff               = fimc_m2m_streamoff,
        .vidioc_g_crop                  = fimc_m2m_g_crop,