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 07:05:48 -0700 Message-ID: <20190725140548.GB25010@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> <25353c4f-5389-0352-b34e-78698b35e588@redhat.com> <20190725124820.GC20286@infradead.org> <18975c1a-7e4e-fab3-eec8-387fbf9dcfe5@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <18975c1a-7e4e-fab3-eec8-387fbf9dcfe5@ti.com> Sender: linux-kernel-owner@vger.kernel.org To: "Andrew F. Davis" Cc: Christoph Hellwig , Laura Abbott , John Stultz , lkml , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , Xu YiPing , "Chenfeng (puck)" , butao , "Xiaqing (A)" , Yudongbin , Chenbo Feng , Alistair Strachan , dri-devel List-Id: dri-devel@lists.freedesktop.org On Thu, Jul 25, 2019 at 09:47:11AM -0400, Andrew F. Davis wrote: > This is a central allocator, it is not tied to any one device. If we > knew the one device ahead of time we would just use the existing dma_alloc. > > We might be able to solve some of that with late mapping after all the > devices attach to the buffer, but even then, which device's CMA area > would we chose to use from all the attached devices? > > I can agree that allocating from per-device CMA using Heaps doesn't make > much sense, but for global pools I'm not sure I see any way to allow > devices to select which pool is right for a specific use. They don't > have the full use-case information like the application does, the > selection needs to be made from the application. Well, the examples we had before was that we clear want to use the per-device CMA area. And at least in upstream a CMA area either is global or attached to a device, as we otherwise wouldn't find it.