Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp211823pxv; Thu, 24 Jun 2021 06:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvK5uNL9XQ1uzNPSIvH9msBqCgUcMnca+lbqHzs+XwJzWPbuqEBHYc/ZWvQ7xzTnFYZxI5 X-Received: by 2002:a02:3506:: with SMTP id k6mr4686707jaa.39.1624541034074; Thu, 24 Jun 2021 06:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624541034; cv=none; d=google.com; s=arc-20160816; b=vGCVaL66TcNShEaHnI6b2/wgCKNJ7vh5EXQ14MbgkatMgxiAzil4fCJJozdsn4o6nf MxIBk4nXXkg6SIFy14Ad6UzREil80Hy3ZKZcgXXfyJEB2noqD4pMEj0SbZO4pnU6h1uz CGIohfRjll3c2VjX749tXIkc1XlXHXyNgkWDHibLR8ag99HDgBi/h5HZFeBI/+oiuv1a NioLsPfkzMOYefiugxAbWUldye216325SKMLLIY7q9+puN4VUp4Etty67A+Yl1h2F07O t1s29S4MoDLI7wsC7j116cosiNr8XjxOTuMgNkkFElbKGqP+4Ina2NjcdjbKcY/iSO9T hPnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TANXxGXvx9UzkpBz8BYI4eTkudOyK7bTSac37BJhh6E=; b=qjCwfLEMbeKki2oZjQUKnZt/qG+emqbktC+smdLx8BIjcMmSnoAkw2+qh0fQouri+k Fh/cUBaLyi0UajCx97Ko7R9ZvUR2ERKYW8ETcCqTeamtER1l0cOorfUA3F/C5Id4vpP9 g5hMJU7J3/yNaZuPG5LjsJyDEB3m61ShlYibfZ3tStAOyd5fHT/+vSDyonH5GiA53SpM pQjpKB4fN1DCExnlITmCWB0uy/E4r1He/2ulWgaVDt4mwaP/CQlMryatI/pSHnJYAnns C6sFmGHuYQpmRVFiu2ZS+CjRGmlNBuxS6Ulm8U81yN7okqzCLaY4P4CZZgsVXQzegM95 BSnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si3072397iln.52.2021.06.24.06.23.39; Thu, 24 Jun 2021 06:23:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230515AbhFXNYq (ORCPT + 99 others); Thu, 24 Jun 2021 09:24:46 -0400 Received: from verein.lst.de ([213.95.11.211]:54550 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbhFXNYq (ORCPT ); Thu, 24 Jun 2021 09:24:46 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 6FB1567373; Thu, 24 Jun 2021 15:22:23 +0200 (CEST) Date: Thu, 24 Jun 2021 15:22:23 +0200 From: Christoph Hellwig To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Christoph Hellwig , Oded Gabbay , Jason Gunthorpe , Christian =?iso-8859-1?Q?K=F6nig?= , Gal Pressman , sleybo@amazon.com, linux-rdma , Oded Gabbay , Linux Kernel Mailing List , dri-devel , "moderated list:DMA BUFFER SHARING FRAMEWORK" , Doug Ledford , Tomer Tayar , amd-gfx list , Greg KH , Alex Deucher , Leon Romanovsky , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [Linaro-mm-sig] [PATCH v3 1/2] habanalabs: define uAPI to export FD for DMA-BUF Message-ID: <20210624132223.GA22258@lst.de> References: <20210622160538.GT1096940@ziepe.ca> <20210623182435.GX1096940@ziepe.ca> <20210623185045.GY1096940@ziepe.ca> <20210624053421.GA25165@lst.de> <9571ac7c-3a58-b013-b849-e26c3727e9b2@amd.com> <20210624081237.GA30289@lst.de> <899fe0ce-b6d7-c138-04b6-4b12405f8d93@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <899fe0ce-b6d7-c138-04b6-4b12405f8d93@amd.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 24, 2021 at 11:52:47AM +0200, Christian K?nig wrote: > I've already converted a bunch of the GPU drivers, but there are at least 6 > GPU still needing to be fixed and on top of that comes VA-API and a few > others. > > What are your plans for the DMA mapping subsystem? Building a new API that allows batched DMA mapping without the scatterlist. The main input for my use case would be bio_vecs, but I plan to make it a little flexible, and the output would be a list of [dma_addr,len] tuples, with the API being flexible enough to just return a single [dma_addr,len] for the common IOMMU coalescing case. > >> Btw, one thing I noticed when looking over the dma-buf instances is that >> there is a lot of duplicated code for creating a sg_table from pages, >> and then mapping it. It would be good if we could move toward common >> helpers instead of duplicating that all over again. > > Can you give an example? Take a look at the get_sg_table and put_sg_table helpers in udmabuf. Those would also be useful in armda, i915, tegra, gntdev-dmabuf, mbochs in one form or another. Similar for variants that use a contigous regions.