From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v3 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Date: Fri, 7 Dec 2018 02:38:41 +0100 Message-ID: <20181207013841.GA4530@lst.de> References: <20181129140315.28476-1-vivek.gautam@codeaurora.org> <20181129141429.GA22638@lst.de> <20181129155758.GC26537@lst.de> <20181129162807.GL21184@phenom.ffwll.local> <20181129165715.GA27786@lst.de> <20181129183334.GB30281@lst.de> <20181130094604.GV21184@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20181130094604.GV21184@phenom.ffwll.local> Sender: linux-kernel-owner@vger.kernel.org To: Christoph Hellwig , "Clark, Rob" , Dave Airlie , linux-arm-msm , Linux Kernel Mailing List , dri-devel , Tomasz Figa , Sean Paul , vivek.gautam@codeaurora.org, freedreno , Robin Murphy List-Id: linux-arm-msm@vger.kernel.org On Fri, Nov 30, 2018 at 10:46:04AM +0100, Daniel Vetter wrote: > > Being able to dip into CMA and maybe iommu coalescing if we want to > > get fancy is indeed the only reason for this API. If we just wanted > > to map pages we could already do that now with just a little bit > > of boilerplate code (and quite a few drivers do - just adding this > > new API will remove tons of code). > > Sounds like the future is very bright indeed \o/ So, I spent some time with this and instead of a new API I think it makes sure we have DMA_ATTR_NON_CONSISTENT consistently available and with well defined semantics, that is virt_to_page on the return value works, it is contiguos and we can use dma_sync_single_for_cpu and dma_sync_single_for_device for ownership tranfers. Can you graphics folks check if this: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-noncoherent-allocator is something to work with? Especially to get rid of the horrible dma_get_sgtable hacks?