From: Ezequiel Garcia <ezequiel@collabora.com>
To: Simon Ser <contact@emersion.fr>, James Jones <jajones@nvidia.com>,
Brian Starkey <brian.starkey@arm.com>,
Robert Beckett <bob.beckett@collabora.com>,
"nd@arm.com" <nd@arm.com>, Tomasz Figa <tfiga@chromium.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Benjamin Gaignard <benjamin.gaignard@st.com>,
Liam Mark <lmark@codeaurora.org>, "Andrew F . Davis" <afd@ti.com>,
"kernel@collabora.com" <kernel@collabora.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Laura Abbott <labbott@kernel.org>,
Daniel Stone <daniels@collabora.com>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
Sumit Semwal <sumit.semwal@linaro.org>,
John Reitan <John.Reitan@arm.com>
Subject: DMA-BUF Heaps BoF notes (Re: [RFC] Experimental DMA-BUF Device Heaps)
Date: Mon, 31 Aug 2020 00:04:10 -0300 [thread overview]
Message-ID: <16e60d66b036bce7019023a48aa278c9044d87c5.camel@collabora.com> (raw)
In-Reply-To: <RYac-UwqFncGmZCWk713lK86adAOfMQbeT6CF15dhr1H3o-P-_tXJcwNYxM5LYqddtYe7Y7VEmbSrDe5ixtIqtHmxMkH1FfulkO4VppXGKA=@emersion.fr>
Dear all,
Here are the notes we took during the BoF.
I believe the meeting was super interesting.
Although it felt a bit short for the topic,
we left with a few interesting ideas.
Thanks everyone!
Ezequiel
---
LPC 2020 BoF: Negotiating DMA-BUF Heaps
Attendees:
* Brian Starkey
* Daniel Stone
* Ezequiel Garcia
* James Jones
* John Reitan
* Laura Abbott
* Laurent Pinchart
* Sumit Semwal
* Robert Beckett
# Replacing subsystem memory allocators with dma-buf heaps
* Laurent: we should not have subsystem implement their own allocator.
Using heaps could be a good idea.
* Laura: Wary to add too much support to heaps,
from the ION experience.
* Laurent: V4L2: most drivers use videobuf2,
which is a fairly complex piece of code.
Three constraints, sg, contig, and vmalloc:
these are fairly generic and not video-specific, why can't these just use heaps?
* Brian: In-kernel API will most likely just care of dma-buf
not necessarily FDs. This was discussed recently, see "Role of DMA Heaps
vs GEM in allocation",https://www.spinics.net/lists/dri-devel/msg268103.html
* Do we expect to get a non-file descriptor identifier for a dma-buf? No.
* Laurent proposes a two steps API (similar to existing GEM API),
where we have one interface to allocate a buffer, with an identifier
local to a process, and then another interface to wrap the buffer
on a dma-buf (fd).
* If devices are not meant to be shared, then we might want to avoid
the DMA-BUF design entirely. As Sumit mentioned, the fundamental
idea behind DMA-BUF is that they are expected to be shared.
OTOH, it was mentioned that sometimes we don't know if a buffer
will be shared or not, so that's why the ability to wrap a buffer
over dma-buf is useful.
* New subsytems would possibly want to avoid implementing
its own allocator interface. But unfortunately, we don't want
to produce a fd per buffer, so that will mean a new subsystem
will eventually require its own API (GEM-like).
If a subsystem doesn't need many buffers, and the FD semantic is fine,
then it would be acceptable to avoid a subsystem-specific API.
* It would be interesting to experiment replacing videobuf2-dma-contig
with just dma-buf heap usage, and see what kind of code save we'd save.
* John Stultz has ideas around providing in-kernel accessors
for the heaps - the idea is for drivers to not have to implement
full exporter functionality for an already existing dma-buf heap type.
* Drawback to this idea of reusing dma-buf heaps to allocate buffers,
is that it means marking every buffer that gets exported as shareable.
* The benefits in having a centralized implementation would be in unifying
the semantics, reusable concepts that can be used to build future APIs around,
rather than trying to created unified APIs around disparate kernel allocation
APIs at only the userspace level.
* Robert: Is there an in-kernel user for the in-kernel dma-buf request?
A possible answer would be for scratch buffers. The idea would be
to avoid getting details wrong. However, doing this would allow every
buffer to be exportable. Also, it sounds like this means
re-implementing DMA-API?
* DMA-BUF are designed to be shared, not necessarily an allocator.
* Want something to expose device-local memory to rest of kernel.
Could be a dma-buf heap?
next prev parent reply other threads:[~2020-08-31 3:04 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
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 ` Ezequiel Garcia [this message]
2020-08-20 8:07 ` 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=16e60d66b036bce7019023a48aa278c9044d87c5.camel@collabora.com \
--to=ezequiel@collabora.com \
--cc=John.Reitan@arm.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=contact@emersion.fr \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jajones@nvidia.com \
--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