From patchwork Wed Oct 10 14:46:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 12133 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id F38E023EFB for ; Wed, 10 Oct 2012 15:03:16 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4EC87A18F37 for ; Wed, 10 Oct 2012 15:03:16 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1026728iej.11 for ; Wed, 10 Oct 2012 08:03:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:sender:errors-to:x-gm-message-state; bh=mO+B0KkmJaQoWiu2HLm/cETNuexjvNL1wJK6uqSpAyc=; b=k5l5wmPBH2DqwFCnH1KzkdgYWgCZJ+pWEXpYezcl8caZEevCgGdL1IuqSi1nMM2Mh6 5ILlJIpsAvrhwClwjRTNNi4KHArs97g+RSg8oBHFWUSA8xCE4eFW0iaDxupy/GxTV5G9 8TtQNjyI2zOv0CNAOjxjaGEqookMAezbiIHZ5tTrT4dQDvu/QljRsMuU09UIthdmlRQF RayBFh+/HrjamaSa9kd0Ky9x1wDRga5xYvca7bMgZUVn8foCAu2aefaUs/wzkJVkgp84 7YXUWSXrRNozHoWgWpMhI79KfX3p6YNBZOKgZ7k0VA8D9y8YMZ6SOxDxN0Ua2YrXBws+ 7yfQ== Received: by 10.50.91.195 with SMTP id cg3mr5511791igb.57.1349881395679; Wed, 10 Oct 2012 08:03:15 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp237515igt; Wed, 10 Oct 2012 08:03:14 -0700 (PDT) Received: by 10.152.103.18 with SMTP id fs18mr20227563lab.32.1349881393855; Wed, 10 Oct 2012 08:03:13 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id tp6si1224701lab.33.2012.10.10.08.03.12; Wed, 10 Oct 2012 08:03:13 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TLxoV-00030T-5S; Wed, 10 Oct 2012 15:03:11 +0000 Received: from mailout3.samsung.com ([203.254.224.33]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TLxoT-00030I-CC for linaro-mm-sig@lists.linaro.org; Wed, 10 Oct 2012 15:03:09 +0000 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MBO00H69N55D2W0@mailout3.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 11 Oct 2012 00:03:08 +0900 (KST) X-AuditID: cbfee61b-b7f2b6d000000f14-50-50758e2bd0f7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 6A.EC.03860.B2E85705; Thu, 11 Oct 2012 00:03:08 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MBO002YDME0EC70@mmp1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 11 Oct 2012 00:03:07 +0900 (KST) From: Tomasz Stanislawski To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Date: Wed, 10 Oct 2012 16:46:43 +0200 Message-id: <1349880405-26049-25-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1349880405-26049-1-git-send-email-t.stanislaws@samsung.com> References: <1349880405-26049-1-git-send-email-t.stanislaws@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jAV2dvtIAg6W7mSy+XHnI5MDocfvf Y+YAxigum5TUnMyy1CJ9uwSujDO/pzIVXBSuONh0jbWB8aBAFyMnh4SAicSueVuYIGwxiQv3 1rOB2EICixglJv8I6GLkArLXMknsenWZFSTBBtRwbMlnRhBbRMBB4vTdWcwgRcwCa5glXqy8 AdYtLOAqMaV1MZjNIqAq8evdK7AGXgFPiXnPTrBBbJOXeHq/D8zmBIpfmDedGWKzh8T/9ZuZ JjDyLmBkWMUomlqQXFCclJ5rpFecmFtcmpeul5yfu4kR7PVn0jsYVzVYHGIU4GBU4uGtyCgJ EGJNLCuuzD3EKMHBrCTCa+pTGiDEm5JYWZValB9fVJqTWnyIUZqDRUmct9kjJUBIID2xJDU7 NbUgtQgmy8TBKdXA6Lzflfv7jyKxj7Oim+3em5hxR6TNmvCb1WTx7bVslmp86WUzv5xN1uB1 2GJ7X3XBvPdM92+pPF7MdtnbSHdqm4PJuZMXHN0EXwhc+biE+wu3krTJiQ+TS/sUG89NWrtt vxHrX2PFvXMcHu55urRZuPvSXO+f/KW/NTQYj0v/k7n0mXNPjfOkXUosxRmJhlrMRcWJAMcM g4T2AQAA Cc: k.debski@samsung.com, s.nawrocki@samsung.com, pawel@osciak.com, sumit.semwal@ti.com, mchehab@redhat.com, robdclark@gmail.com, linaro-mm-sig@lists.linaro.org, kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com, airlied@redhat.com, remi@remlab.net Subject: [Linaro-mm-sig] [PATCHv10 24/26] v4l: s5p-fimc: support for dmabuf exporting X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQk+hvUgTRlvvCaiR+saMPQvzIpElikDf/1nw6tqEKoRYRgeijVkV4To8UcDe6ae7Z5TKSre This patch enhances s5p-fimc with support for DMABUF exporting via VIDIOC_EXPBUF ioctl. Signed-off-by: Tomasz Stanislawski Signed-off-by: Kyungmin Park CC: Sylwester Nawrocki Acked-by: Hans Verkuil --- drivers/media/platform/s5p-fimc/fimc-capture.c | 9 +++++++++ drivers/media/platform/s5p-fimc/fimc-m2m.c | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/media/platform/s5p-fimc/fimc-capture.c b/drivers/media/platform/s5p-fimc/fimc-capture.c index 246bb32..e5fd159 100644 --- a/drivers/media/platform/s5p-fimc/fimc-capture.c +++ b/drivers/media/platform/s5p-fimc/fimc-capture.c @@ -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, diff --git a/drivers/media/platform/s5p-fimc/fimc-m2m.c b/drivers/media/platform/s5p-fimc/fimc-m2m.c index 17067a7..1cd4fcf 100644 --- a/drivers/media/platform/s5p-fimc/fimc-m2m.c +++ b/drivers/media/platform/s5p-fimc/fimc-m2m.c @@ -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,