From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps Date: Thu, 25 Jul 2019 05:52:06 -0700 Message-ID: <20190725125206.GE20286@infradead.org> References: <20190624194908.121273-1-john.stultz@linaro.org> <20190624194908.121273-5-john.stultz@linaro.org> <20190718100840.GB19666@infradead.org> <20190724065958.GC16225@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: John Stultz Cc: Christoph Hellwig , lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , "Andrew F . Davis" , Xu YiPing , "Chenfeng (puck)" , butao , "Xiaqing (A)" , Yudongbin , Chenbo Feng , Alistair Strachan , dri-devel List-Id: dri-devel@lists.freedesktop.org On Wed, Jul 24, 2019 at 11:46:24AM -0700, John Stultz wrote: > I'm still not understanding how this would work. Benjamin and Laura > already commented on this point, but for a simple example, with the > HiKey boards, the DRM driver requires contiguous memory for the > framebuffer, but the GPU can handle non-contiguous. Thus the target > framebuffers that we pass to the display has to be CMA allocated, but > all the other graphics buffers that the GPU will render to and > composite can be system. But that just means we need a flag that memory needs to be contiguous, which totally makes sense at the API level. But CMA is not the only source of contigous memory, so we should not conflate the two. > Laura already touched on this, but similar logic can be used for > camera buffers, which can make sure we allocate from a specifically > reserved CMA region that is only used for the camera so we can always > be sure to have N free buffers immediately to capture with, etc. And for that we already have per-device CMA areas hanging off struct device, which this should reuse instead of adding another duplicate CMA area lookup scheme.