From patchwork Tue Apr 24 22:42:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 8098 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 0314E23E20 for ; Tue, 24 Apr 2012 22:42:32 +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 9DF36A18AF6 for ; Tue, 24 Apr 2012 22:42:31 +0000 (UTC) Received: by iage36 with SMTP id e36so2261642iag.11 for ; Tue, 24 Apr 2012 15:42:31 -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:in-reply-to:references:date:message-id:from:to: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=1Zu8A2UYOjOmfTyvaeAdYUpPyWuLSm6pMCLofzpgzIU=; b=Lg8puPXLVuXe5Ro3/d2NizIiijEUzgiUrSvnO/2q8/BH+zQbjKSL/Z1unxKCbLcbZa MEtEle5hkQBd0twtz7FjXpRR+UnMrIaAWNdPG30h9wfGKoLl7BkEokCTqAbRxurgrLYH ozlu8chtdYjvc1dNsXjrL9DaAEdzPZLNuIsDe1/9tbs5EQ/wKjo7BfPFEslxIoM/zqFy HMg8kSdsL377YcKPdSB3fUEIwG7EbZtuQOYD74qsqlc9ek+atSLKDfnB7+WjY0Ah72O6 mYsmZYyX181LeA0CFAxjOyG+RJuLPLQ+NKMdlstKSyvZ0i6bJ+CrrXLQo9Kjv1IeJo57 OjLg== Received: by 10.50.194.163 with SMTP id hx3mr101834igc.49.1335307351071; Tue, 24 Apr 2012 15:42:31 -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 x6csp217190ibt; Tue, 24 Apr 2012 15:42:29 -0700 (PDT) Received: by 10.216.132.169 with SMTP id o41mr109152wei.121.1335307348303; Tue, 24 Apr 2012 15:42:28 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id bt18si13487059wib.39.2012.04.24.15.42.27; Tue, 24 Apr 2012 15:42:28 -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 1SMoRD-00018x-LD; Tue, 24 Apr 2012 22:42:23 +0000 Received: from na3sys009aog115.obsmtp.com ([74.125.149.238]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SMoRC-00018s-Nm for linaro-mm-sig@lists.linaro.org; Tue, 24 Apr 2012 22:42:23 +0000 Received: from mail-lb0-f169.google.com ([209.85.217.169]) (using TLSv1) by na3sys009aob115.postini.com ([74.125.148.12]) with SMTP ID DSNKT5csTD9v5KQ8/RI8zanSQ9ELEAFbSUpG@postini.com; Tue, 24 Apr 2012 15:42:22 PDT Received: by lbbgg6 with SMTP id gg6so1259135lbb.14 for ; Tue, 24 Apr 2012 15:42:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.37.134 with SMTP id y6mr93464lbj.102.1335307339133; Tue, 24 Apr 2012 15:42:19 -0700 (PDT) Received: by 10.152.131.165 with HTTP; Tue, 24 Apr 2012 15:42:19 -0700 (PDT) In-Reply-To: <1334930780-28976-1-git-send-email-t.stanislaws@samsung.com> References: <1334930780-28976-1-git-send-email-t.stanislaws@samsung.com> Date: Tue, 24 Apr 2012 17:42:19 -0500 Message-ID: From: "Clark, Rob" To: Tomasz Stanislawski Cc: linaro-mm-sig@lists.linaro.org, Daniel Vetter , sumit.semwal@ti.com Subject: Re: [Linaro-mm-sig] [PATCHv5 00/13] Integration of videobuf2 with dmabuf 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: ALoCoQk7oRE3DGdbIx32p9LA6HH3842RkDSkG6f8lQ4PDsJaIijZdu1mYIiQoQpdYny70zK++fvU fwiw, I *finally* had time to rebase the omap4iss camera driver on this.. I did run in to one issue, so I'd propose this change: ------ - dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); + if (!buf->db_attach) + dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); } ------ the issue is that dma_sync_sg_for_xyz() blow up horribly when handed something that is not really 'RAM'. But OTOH, the exporter is taking care of cache, etc, so these calls are not really required in the dmabuf case. Thoughts? BR, -R On Fri, Apr 20, 2012 at 9:06 AM, Tomasz Stanislawski wrote: > Hello everyone, > This patchset adds support for DMABUF [2] importing to V4L2 stack. > The support for DMABUF exporting was moved to separate patchset > due to dependency on patches for DMA mapping redesign by > Marek Szyprowski [4]. > > v5: > - removed change of importer/exporter behaviour > - fixes vb2_dc_pages_to_sgt basing on Laurent's hints > - changed pin/unpin words to lock/unlock in Doc > > v4: > - rebased on mainline 3.4-rc2 > - included missing importing support for s5p-fimc and s5p-tv > - added patch for changing map/unmap for importers > - fixes to Documentation part > - coding style fixes > - pairing {map/unmap}_dmabuf in vb2-core > - fixing variable types and semantic of arguments in videobufb2-dma-contig.c > > v3: > - rebased on mainline 3.4-rc1 > - split 'code refactor' patch to multiple smaller patches > - squashed fixes to Sumit's patches > - patchset is no longer dependant on 'DMA mapping redesign' > - separated path for handling IO and non-IO mappings > - add documentation for DMABUF importing to V4L > - removed all DMABUF exporter related code > - removed usage of dma_get_pages extension > > v2: > - extended VIDIOC_EXPBUF argument from integer memoffset to struct >  v4l2_exportbuffer > - added patch that breaks DMABUF spec on (un)map_atachment callcacks but allows >  to work with existing implementation of DMABUF prime in DRM > - all dma-contig code refactoring patches were squashed > - bugfixes > > v1: List of changes since [1]. > - support for DMA api extension dma_get_pages, the function is used to retrieve >  pages used to create DMA mapping. > - small fixes/code cleanup to videobuf2 > - added prepare and finish callbacks to vb2 allocators, it is used keep >  consistency between dma-cpu acess to the memory (by Marek Szyprowski) > - support for exporting of DMABUF buffer in V4L2 and Videobuf2, originated from >  [3]. > - support for dma-buf exporting in vb2-dma-contig allocator > - support for DMABUF for s5p-tv and s5p-fimc (capture interface) drivers, >  originated from [3] > - changed handling for userptr buffers (by Marek Szyprowski, Andrzej >  Pietrasiewicz) > - let mmap method to use dma_mmap_writecombine call (by Marek Szyprowski) > > [1] http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/42966/focus=42968 > [2] https://lkml.org/lkml/2011/12/26/29 > [3] http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/36354/focus=36355 > [4] http://thread.gmane.org/gmane.linux.kernel.cross-arch/12819 > > Andrzej Pietrasiewicz (1): >  v4l: vb2-dma-contig: add support for scatterlist in userptr mode > > Laurent Pinchart (2): >  v4l: vb2-dma-contig: Shorten vb2_dma_contig prefix to vb2_dc >  v4l: vb2-dma-contig: Reorder functions > > Marek Szyprowski (2): >  v4l: vb2: add prepare/finish callbacks to allocators >  v4l: vb2-dma-contig: add prepare/finish to dma-contig allocator > > Sumit Semwal (4): >  v4l: Add DMABUF as a memory type >  v4l: vb2: add support for shared buffer (dma_buf) >  v4l: vb: remove warnings about MEMORY_DMABUF >  v4l: vb2-dma-contig: add support for dma_buf importing > > Tomasz Stanislawski (4): >  Documentation: media: description of DMABUF importing in V4L2 >  v4l: vb2-dma-contig: Remove unneeded allocation context structure >  v4l: s5p-tv: mixer: support for dmabuf importing >  v4l: s5p-fimc: support for dmabuf importing > >  Documentation/DocBook/media/v4l/compat.xml         |    4 + >  Documentation/DocBook/media/v4l/io.xml             |  179 +++++++ >  .../DocBook/media/v4l/vidioc-create-bufs.xml       |    1 + >  Documentation/DocBook/media/v4l/vidioc-qbuf.xml    |   15 + >  Documentation/DocBook/media/v4l/vidioc-reqbufs.xml |   47 +- >  drivers/media/video/Kconfig                        |    1 + >  drivers/media/video/s5p-fimc/fimc-capture.c        |    2 +- >  drivers/media/video/s5p-tv/Kconfig                 |    1 + >  drivers/media/video/s5p-tv/mixer_video.c           |    2 +- >  drivers/media/video/videobuf-core.c                |    4 + >  drivers/media/video/videobuf2-core.c               |  207 ++++++++- >  drivers/media/video/videobuf2-dma-contig.c         |  529 +++++++++++++++++--- >  include/linux/videodev2.h                          |    7 + >  include/media/videobuf2-core.h                     |   34 ++ >  14 files changed, 932 insertions(+), 101 deletions(-) > > -- > 1.7.5.4 > > > _______________________________________________ > Linaro-mm-sig mailing list > Linaro-mm-sig@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/linaro-mm-sig diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c index 5cf3107..5114a51 100644 --- a/drivers/media/video/videobuf2-dma-contig.c +++ b/drivers/media/video/videobuf2-dma-contig.c @@ -161,7 +161,11 @@ static void vb2_dc_prepare(void *buf_priv) if (!sgt) return; - dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); + if (!buf->db_attach) + dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->nents, buf->dma_dir); } static void vb2_dc_finish(void *buf_priv) @@ -172,7 +176,11 @@ static void vb2_dc_finish(void *buf_priv) if (!sgt) return;