From patchwork Tue Apr 10 13:10:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 7725 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 E8D4F23E1D for ; Tue, 10 Apr 2012 13:11:26 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id B8DA8A18708 for ; Tue, 10 Apr 2012 13:11:26 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so2763083yhp.11 for ; Tue, 10 Apr 2012 06:11:26 -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 :mime-version:date:from:in-reply-to:to:message-id:x-mailer :references:cc:subject:x-beenthere:x-mailman-version:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:content-type:content-transfer-encoding:sender :errors-to:x-gm-message-state; bh=pH1jqq/XRqWokTPZmFnxPgPEpHIS4PRi37gyyZvlJto=; b=Fdz3QUV0N2sG2OfhcNW64et1taiYj5CSlcG3YfKt0zkWNxheJEGABSRraE/MPXUJU+ 3TnfoYo66IEFpm+n/4wSAAueE/emc+esOCLOmrCO4zaYWGOM0jNR7cyYmy3FiMqE8DvL EQgxkWfxJ0Wv+Vfz5sw8pu8HB3Pfk36h3FQgCe0F+Pbqo2wwm0Ol6EK6AA0TNvGIIf2A ITj6BdPhHVCOUDztlZzvi3SZMijS6dQSLBSo/GhmrEWoiNLwRQSmTiDy9YJjH85FYSpk 1b0LcsbBwknU3bQlzbUTFE65q4u3d8V7DWO+SOJAgNvyrivhwn95obnX39Eg7/IePnTT X9KA== Received: by 10.50.51.197 with SMTP id m5mr2284182igo.38.1334063486356; Tue, 10 Apr 2012 06:11:26 -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.231.164.217 with SMTP id f25csp20453iby; Tue, 10 Apr 2012 06:11:21 -0700 (PDT) Received: by 10.216.138.135 with SMTP id a7mr6448011wej.19.1334063475915; Tue, 10 Apr 2012 06:11:15 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id k4si14529649wiz.0.2012.04.10.06.11.05; Tue, 10 Apr 2012 06:11:15 -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 1SHaqd-0005Ky-LZ; Tue, 10 Apr 2012 13:11:03 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SHaqT-0004PB-T5 for linaro-mm-sig@lists.linaro.org; Tue, 10 Apr 2012 13:10:53 +0000 MIME-version: 1.0 Received: from euspt1 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M29005YFLXJAR60@mailout3.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 10 Apr 2012 14:10:31 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M2900F19LY35Q@spt1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 10 Apr 2012 14:10:51 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id 1A173270064; Tue, 10 Apr 2012 15:19:56 +0200 (CEST) Date: Tue, 10 Apr 2012 15:10:47 +0200 From: Tomasz Stanislawski In-reply-to: <1334063447-16824-1-git-send-email-t.stanislaws@samsung.com> To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Message-id: <1334063447-16824-14-git-send-email-t.stanislaws@samsung.com> X-Mailer: git-send-email 1.7.9.1 References: <1334063447-16824-1-git-send-email-t.stanislaws@samsung.com> Cc: pawel@osciak.com, sumit.semwal@ti.com, mchehab@redhat.com, robdclark@gmail.com, linaro-mm-sig@lists.linaro.org, kyungmin.park@samsung.com, airlied@redhat.com Subject: [Linaro-mm-sig] [RFC 13/13] v4l: vivi: 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: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQnhGbqGNiTxL7Eo+2MpWjrjugsXtSv3p1JhK0kK1DGrRQ4ZlbFwGOWSmfEMLK4OyasQbLE3 This patch enhances vivi driver with a support for DMABUF exporting via VIDIOC_EXPBUF ioctl. Signed-off-by: Tomasz Stanislawski Signed-off-by: Kyungmin Park --- drivers/media/video/vivi.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 489d685..e34aa70 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c @@ -947,6 +947,14 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p) return vb2_dqbuf(&dev->vb_vidq, p, file->f_flags & O_NONBLOCK); } +static int vidioc_expbuf(struct file *file, void *priv, + struct v4l2_exportbuffer *eb) +{ + struct vivi_dev *dev = video_drvdata(file); + return vb2_expbuf(&dev->vb_vidq, eb); +} + + static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) { struct vivi_dev *dev = video_drvdata(file); @@ -1185,6 +1193,7 @@ static const struct v4l2_ioctl_ops vivi_ioctl_ops = { .vidioc_querybuf = vidioc_querybuf, .vidioc_qbuf = vidioc_qbuf, .vidioc_dqbuf = vidioc_dqbuf, + .vidioc_expbuf = vidioc_expbuf, .vidioc_s_std = vidioc_s_std, .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input,