Linux Media Controller development
 help / color / mirror / Atom feed
From: Ezequiel Garcia <ezequiel@collabora.com>
To: James Jones <jajones@nvidia.com>, Brian Starkey <brian.starkey@arm.com>
Cc: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Sumit Semwal <sumit.semwal@linaro.org>,
	"Andrew F . Davis" <afd@ti.com>,
	Benjamin Gaignard <benjamin.gaignard@st.com>,
	Liam Mark <lmark@codeaurora.org>,
	Laura Abbott <labbott@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Daniel Stone <daniels@collabora.com>,
	Nicolas Dufresne <nicolas.dufresne@collabora.com>,
	Robert Beckett <bob.beckett@collabora.com>,
	Tomasz Figa <tfiga@chromium.org>,
	kernel@collabora.com, nd@arm.com
Subject: Re: [RFC] Experimental DMA-BUF Device Heaps
Date: Thu, 20 Aug 2020 05:15:12 -0300	[thread overview]
Message-ID: <746a0bb75bd8388a30b53a5ddc56fb24aea308a8.camel@collabora.com> (raw)
In-Reply-To: <c2450755-91fd-da72-bf1e-c015ad9d6b25@nvidia.com>

On Mon, 2020-08-17 at 20:49 -0700, James Jones wrote:
> On 8/17/20 8:18 AM, Brian Starkey wrote:
> > Hi Ezequiel,
> > 
> > On Sun, Aug 16, 2020 at 02:22:46PM -0300, Ezequiel Garcia wrote:
> > > This heap is basically a wrapper around DMA-API dma_alloc_attrs,
> > > which will allocate memory suitable for the given device.
> > > 
> > > The implementation is mostly a port of the Contiguous Videobuf2
> > > memory allocator (see videobuf2/videobuf2-dma-contig.c)
> > > over to the DMA-BUF Heap interface.
> > > 
> > > The intention of this allocator is to provide applications
> > > with a more system-agnostic API: the only thing the application
> > > needs to know is which device to get the buffer for.
> > > 
> > > Whether the buffer is backed by CMA, IOMMU or a DMA Pool
> > > is unknown to the application.
> > > 
> > > I'm not really expecting this patch to be correct or even
> > > a good idea, but just submitting it to start a discussion on DMA-BUF
> > > heap discovery and negotiation.
> > > 
> > 
> > My initial reaction is that I thought dmabuf heaps are meant for use
> > to allocate buffers for sharing across devices, which doesn't fit very
> > well with having per-device heaps.
> > 
> > For single-device allocations, would using the buffer allocation
> > functionality of that device's native API be better in most
> > cases? (Some other possibly relevant discussion at [1])
> > 
> > I can see that this can save some boilerplate for devices that want
> > to expose private chunks of memory, but might it also lead to 100
> > aliases for the system's generic coherent memory pool?
> > 
> > I wonder if a set of helpers to allow devices to expose whatever they
> > want with minimal effort would be better.
> 
> I'm rather interested on where this goes, as I was toying with using 
> some sort of heap ID as a basis for a "device-local" constraint in the 
> memory constraints proposals Simon and I will be discussing at XDC this 
> year.  It would be rather elegant if there was one type of heap ID used 
> universally throughout the kernel that could provide a unique handle for 
> the shared system memory heap(s), as well as accelerator-local heaps on 
> fancy NICs, GPUs, NN accelerators, capture devices, etc. so apps could 
> negotiate a location among themselves.  This patch seems to be a step 
> towards that in a way, but I agree it would be counterproductive if a 
> bunch of devices that were using the same underlying system memory ended 
> up each getting their own heap ID just because they used some SW 
> framework that worked that way.
> 
> Would appreciate it if you could send along a pointer to your BoF if it 
> happens!
> 

Here is it:

https://linuxplumbersconf.org/event/7/contributions/818/

It would be great to see you there and discuss this,
given I was hoping we could talk about how to meet a
userspace allocator library expectations as well.

Thanks,
Ezequiel

> Thanks,
> -James
> 
> > Cheers,
> > -Brian
> > 
> > 1. https://lore.kernel.org/dri-devel/57062477-30e7-a3de-6723-a50d03a402c4@kapsi.fi/
> > 
> > > Given Plumbers is just a couple weeks from now, I've submitted
> > > a BoF proposal to discuss this, as perhaps it would make
> > > sense to discuss this live?
> > > 
> > > Not-signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>



  reply	other threads:[~2020-08-20  8:15 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-16 17:22 [RFC] Experimental DMA-BUF Device Heaps Ezequiel Garcia
2020-08-17 15:18 ` Brian Starkey
2020-08-18  3:49   ` James Jones
2020-08-20  8:15     ` Ezequiel Garcia [this message]
2020-08-23 20:04       ` James Jones
2020-08-23 20:46         ` Laurent Pinchart
2020-08-23 22:53           ` James Jones
2020-08-31 15:08             ` Laurent Pinchart
2020-08-27 14:52       ` Simon Ser
2020-08-31  3:04         ` DMA-BUF Heaps BoF notes (Re: [RFC] Experimental DMA-BUF Device Heaps) Ezequiel Garcia
2020-08-20  8:07   ` [RFC] Experimental DMA-BUF Device Heaps Ezequiel Garcia
2020-08-20  9:14     ` Brian Starkey
2020-08-18  4:13 ` John Stultz
2020-08-20  8:36   ` Ezequiel Garcia
2020-08-20 15:54     ` Laurent Pinchart
2020-08-25 20:26       ` Nicolas Dufresne
2020-08-27 10:05         ` Simon Ser
2020-09-01  7:32 ` Daniel Vetter
2020-09-08  5:43   ` Laurent Pinchart
2020-09-08  8:36     ` Daniel Vetter
2020-09-16 17:01 ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=746a0bb75bd8388a30b53a5ddc56fb24aea308a8.camel@collabora.com \
    --to=ezequiel@collabora.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=afd@ti.com \
    --cc=benjamin.gaignard@st.com \
    --cc=bob.beckett@collabora.com \
    --cc=brian.starkey@arm.com \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jajones@nvidia.com \
    --cc=john.stultz@linaro.org \
    --cc=kernel@collabora.com \
    --cc=labbott@kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=lmark@codeaurora.org \
    --cc=nd@arm.com \
    --cc=nicolas.dufresne@collabora.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox