From patchwork Fri Dec 7 12:28:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 1850591 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 156843FC71 for ; Fri, 7 Dec 2012 12:06:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756188Ab2LGMGi (ORCPT ); Fri, 7 Dec 2012 07:06:38 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:42739 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752775Ab2LGMGh (ORCPT ); Fri, 7 Dec 2012 07:06:37 -0500 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEN00AP6TMZJ6Z0@mailout2.samsung.com> for linux-media@vger.kernel.org; Fri, 07 Dec 2012 21:06:35 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.122]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id D2.EB.01231.BCBD1C05; Fri, 07 Dec 2012 21:06:35 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-25-50c1dbcb5e70 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 92.EB.01231.BCBD1C05; Fri, 07 Dec 2012 21:06:35 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEN0020ATLU04A0@mmp1.samsung.com> for linux-media@vger.kernel.org; Fri, 07 Dec 2012 21:06:35 +0900 (KST) From: Shaik Ameer Basha To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com Subject: [PATCH] [media] exynos-gsc: Support dmabuf export buffer Date: Fri, 07 Dec 2012 17:58:55 +0530 Message-id: <1354883335-27961-1-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.0.4 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsWyRsSkSvf07YMBBqtPmVj0bNjK6sDo8XmT XABjFJdNSmpOZllqkb5dAlfGsdOrWQqOC1RsO2HVwPiGt4uRk0NCwETiW998ZghbTOLCvfVs XYxcHEICSxklpm79wwxT9LStnwnEFhJYxChxd6k2RNFyJokj6y+wgSTYBAwltt+7wgpiiwjI SzzpvQEWZxaQkri+cTU7iC0s4CjR1vkYzGYRUJV4NOU52AJeAXeJ/bdbWSGWKUi0LjsEVSMg 8W3yIZYuRg6guKzEpgPMIHslBLawSTy6eg6qXlLi4IobLBMYBRcwMqxiFE0tSC4oTkrPNdQr TswtLs1L10vOz93ECAyo0/+eSe1gXNlgcYhRgINRiYdX4e6BACHWxLLiytxDjBIczEoivE92 HAwQ4k1JrKxKLcqPLyrNSS0+xOgDdMlEZinR5HxgsOeVxBsam5ibGptaGhmZmZriEFYS5232 SAkQEkhPLEnNTk0tSC2CGcfEwSnVwOiXwOXxt5IvffnfoJJ809qjlTeOGYS5iLz5ctQ0aaPv G++pn5ITtL0rFoak/J5V+OnZjdYA8T1tXy8Z1Cj/7furckJ9S9zE2ouh2mk6Xxpne5bZa5hN sDps3rNgRR9P4yY7fu/Luu9WPeGcocswZ8Vel2nf7b3nXn1zTGSeoutpoRVpMmzXjiqxFGck GmoxFxUnAgAC6AcrVQIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsVy+t9jAd3Ttw8GGJzaq2HRs2ErqwOjx+dN cgGMUQ2MNhmpiSmpRQqpecn5KZl56bZK3sHxzvGmZgaGuoaWFuZKCnmJuam2Si4+AbpumTlA U5UUyhJzSoFCAYnFxUr6dpgmhIa46VrANEbo+oYEwfUYGaCBhDWMGcdOr2YpOC5Qse2EVQPj G94uRk4OCQETiadt/UwQtpjEhXvr2UBsIYFFjBJ3l2p3MXIB2cuZJI6svwCWYBMwlNh+7wor iC0iIC/xpPcGWJxZQEri+sbV7CC2sICjRFvnYzCbRUBV4tGU58wgNq+Au8T+262sEMsUJFqX HWKfwMi9gJFhFaNoakFyQXFSeq6hXnFibnFpXrpecn7uJkZwuD6T2sG4ssHiEKMAB6MSD6/C 3QMBQqyJZcWVuYcYJTiYlUR4n+w4GCDEm5JYWZValB9fVJqTWnyI0Qdo+0RmKdHkfGAs5ZXE GxqbmJsam1qaWJiYWeIQVhLnbfZICRASSE8sSc1OTS1ILYIZx8TBKdXAOHtbhZen8pH9bOFn FbomCvRO6tjmf8f/3+aJrgXVe7qstx6ubPtSyls+tY1H7jG3/Px8h1hruS2XZiow5+Y2Pttr ZRFV9e3cBPY9eqe63u9+afIkbw/nPX3nqOAVtf9czpobdCvlSsVslLsi/eKEQqXwjtY3Ch3d x789t+Bwdb1VJePyxI9RiaU4I9FQi7moOBEA4D3MNoQCAAA= X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org This patch adds the dmabuf export buffer feature to the Exynos G-Scaler driver. Signed-off-by: Shaik Ameer Basha --- drivers/media/platform/exynos-gsc/gsc-m2m.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c index c267c57..d0c3e42 100644 --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c @@ -367,6 +367,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) { @@ -548,6 +555,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, @@ -565,7 +573,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; @@ -577,7 +585,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;