From patchwork Fri Apr 20 14:45:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 7985 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 75D4A23E00 for ; Fri, 20 Apr 2012 14:45:51 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3E1C4A18601 for ; Fri, 20 Apr 2012 14:45:51 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so18433532iag.11 for ; Fri, 20 Apr 2012 07:45:51 -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:date:from :in-reply-to:to:message-id:mime-version: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=/Lq2rqbxHAnAH592VOtVZhUn6aFyXW4t6VXbhAFz5PA=; b=oLB03sm1dq4AQzBv5h5B/Ryll1wPlpJcgl2+VV9YK/Wj5CneRrYEXZ4wLD7RqDsDa0 NpLKqgX0As6kN6GOEJZs/HwAPT0O9mEWAS2H1g6IopwtbGAeXX9gWTLxO7z1ngzrGhcR 5jqgeJZP4TBE2qmoo86KA8g4Uc5xqctrEoG2hJPvrGr2/n50w0a2ZsWBi1fbiL+TBpFd GXtdt1GG+XoC0GqvhRQN/EOf6+1k7qa92Jai5q1CTMm7hTy4rghmIXFZ8LLGg+eHzIXI 3xBAAfFl9ul9L9++kqVAeHQ+w+diu4r9B3MRD23DILdjXnRaBrHUNb9vcdrJyJ0a/w9p JORg== Received: by 10.43.52.74 with SMTP id vl10mr5200061icb.55.1334933151007; Fri, 20 Apr 2012 07:45:51 -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.137.198 with SMTP id x6csp39010ibt; Fri, 20 Apr 2012 07:45:50 -0700 (PDT) Received: by 10.180.105.194 with SMTP id go2mr15732212wib.22.1334933149319; Fri, 20 Apr 2012 07:45:49 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id g51si6359432wee.104.2012.04.20.07.45.48; Fri, 20 Apr 2012 07:45:49 -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 1SLF5j-000871-KM; Fri, 20 Apr 2012 14:45:43 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SLF5g-00085b-Ei for linaro-mm-sig@lists.linaro.org; Fri, 20 Apr 2012 14:45:40 +0000 Received: from euspt1 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M2S002AD8XV1P@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 20 Apr 2012 15:44:19 +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 <0M2S009RQ9005H@spt1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Fri, 20 Apr 2012 15:45:37 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id DF8D5270067; Fri, 20 Apr 2012 16:59:12 +0200 (CEST) Date: Fri, 20 Apr 2012 16:45:22 +0200 From: Tomasz Stanislawski In-reply-to: <1334933134-4688-1-git-send-email-t.stanislaws@samsung.com> To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Message-id: <1334933134-4688-2-git-send-email-t.stanislaws@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.9.5 References: <1334933134-4688-1-git-send-email-t.stanislaws@samsung.com> Cc: pawel@osciak.com, sumit.semwal@ti.com, linux-doc@vger.kernel.org, mchehab@redhat.com, robdclark@gmail.com, linaro-mm-sig@lists.linaro.org, kyungmin.park@samsung.com, airlied@redhat.com, remi@remlab.net, g.liakhovetski@gmx.de Subject: [Linaro-mm-sig] [PATCHv5 01/13] v4l: Add DMABUF as a memory type 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: ALoCoQkNIoozumx1Zds/hp439diNxvFcExKqAcM4wg8HRUax9kCtPAdNHrYgODkKJq2+5nPuccl+ From: Sumit Semwal Adds DMABUF memory type to v4l framework. Also adds the related file descriptor in v4l2_plane and v4l2_buffer. Signed-off-by: Tomasz Stanislawski [original work in the PoC for buffer sharing] Signed-off-by: Sumit Semwal Signed-off-by: Sumit Semwal Acked-by: Laurent Pinchart --- include/linux/videodev2.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index c9c9a46..d884d4a 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h @@ -185,6 +185,7 @@ enum v4l2_memory { V4L2_MEMORY_MMAP = 1, V4L2_MEMORY_USERPTR = 2, V4L2_MEMORY_OVERLAY = 3, + V4L2_MEMORY_DMABUF = 4, }; /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ @@ -588,6 +589,8 @@ struct v4l2_requestbuffers { * should be passed to mmap() called on the video node) * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer * pointing to this plane + * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file + * descriptor associated with this plane * @data_offset: offset in the plane to the start of data; usually 0, * unless there is a header in front of the data * @@ -602,6 +605,7 @@ struct v4l2_plane { union { __u32 mem_offset; unsigned long userptr; + int fd; } m; __u32 data_offset; __u32 reserved[11]; @@ -624,6 +628,8 @@ struct v4l2_plane { * (or a "cookie" that should be passed to mmap() as offset) * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR; * a userspace pointer pointing to this buffer + * @fd: for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF; + * a userspace file descriptor associated with this buffer * @planes: for multiplanar buffers; userspace pointer to the array of plane * info structs for this buffer * @length: size in bytes of the buffer (NOT its payload) for single-plane @@ -650,6 +656,7 @@ struct v4l2_buffer { __u32 offset; unsigned long userptr; struct v4l2_plane *planes; + int fd; } m; __u32 length; __u32 input;