From patchwork Thu Apr 5 13:59:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Stanislawski X-Patchwork-Id: 7674 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 7F72223ECD for ; Thu, 5 Apr 2012 14:00:53 +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 37078A18B04 for ; Thu, 5 Apr 2012 14:00:53 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so2485020iag.11 for ; Thu, 05 Apr 2012 07:00:53 -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=mGCDNo0z6IaD1ph681LVW1bmVTxy6v+uj77wZjOnZp8=; b=JOAcyuDZ7llIJS9RTQtJ0jhr4qzoHhomgiEqC9648KgqTF0Zk8WnGi6kwZl03ulQJJ 48YzMVmDuJ5WDBTSL7gngzpSAbIsDHcwxEsdq7jHVakjzA8ClMRpmhuO5tLt3davD7yG CPkXKAQ+2bPC6jRA2WgBDsx+gzLX54AnGQKpxWqYpoJ3LWebtexVZARRYQ3UA5tAgluX BNAyFFLhyqO5b9bOn2dioQZSXUrISySoZfQNhuHpYQAFKwgggP/IPXE7f4slFegQwWH0 tevLyKGNJzAMK526gYzY/8uBLutNw0GYBvVLFB7cr/xk2c7Sg/8pUZp0A6RQLtNVJ2sO 6jvA== Received: by 10.42.203.148 with SMTP id fi20mr1613385icb.10.1333634452704; Thu, 05 Apr 2012 07:00:52 -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 f25csp61168iby; Thu, 5 Apr 2012 07:00:47 -0700 (PDT) Received: by 10.180.107.104 with SMTP id hb8mr5127769wib.8.1333634441909; Thu, 05 Apr 2012 07:00:41 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id v6si4398013weq.146.2012.04.05.07.00.40; Thu, 05 Apr 2012 07:00:41 -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 1SFnEt-0005Ju-Br; Thu, 05 Apr 2012 14:00:39 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SFnEp-0003qt-1C for linaro-mm-sig@lists.linaro.org; Thu, 05 Apr 2012 14:00:35 +0000 Received: from euspt2 (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 <0M2000KYBEVKE1@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 05 Apr 2012 14:59:44 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M2000G1ZEWS39@spt2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Thu, 05 Apr 2012 15:00:29 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id CCBFD27008F; Thu, 05 Apr 2012 16:07:22 +0200 (CEST) Date: Thu, 05 Apr 2012 15:59:58 +0200 From: Tomasz Stanislawski In-reply-to: <1333634408-4960-1-git-send-email-t.stanislaws@samsung.com> To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Message-id: <1333634408-4960-2-git-send-email-t.stanislaws@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.9.1 References: <1333634408-4960-1-git-send-email-t.stanislaws@samsung.com> Cc: pawel@osciak.com, sumit.semwal@ti.com, robdclark@gmail.com, linaro-mm-sig@lists.linaro.org, kyungmin.park@samsung.com, airlied@redhat.com Subject: [Linaro-mm-sig] [PATCH 01/11] 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: ALoCoQnvlx/+BUUbbIZjamIpzRR1RyXdqxfd/BCUBQqgHQ0506zQ+7iOZvpi9Kz8/GmJGekeJuqW 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 --- include/linux/videodev2.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index c9c9a46..38259bf 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,9 @@ 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 +657,7 @@ struct v4l2_buffer { __u32 offset; unsigned long userptr; struct v4l2_plane *planes; + int fd; } m; __u32 length; __u32 input;