public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Nicolas Dufresne <nicolas@ndufresne.ca>
Cc: "Daniel Vetter" <daniel@ffwll.ch>,
	"Pekka Paalanen" <ppaalanen@gmail.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Rob Clark" <robdclark@gmail.com>,
	"Tomasz Figa" <tfiga@chromium.org>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Daniel Stone" <daniel@fooishbar.org>,
	sumit.semwal@linaro.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-media@vger.kernel.org
Subject: Re: Try to address the DMA-buf coherency problem
Date: Wed, 30 Nov 2022 11:30:55 +0100	[thread overview]
Message-ID: <Y4cw36MUO+ftP468@phenom.ffwll.local> (raw)
In-Reply-To: <ba6e42f04c436d93bfa71d5dee7fd35ef2245073.camel@ndufresne.ca>

On Fri, Nov 25, 2022 at 11:40:04AM -0500, Nicolas Dufresne wrote:
> Le mercredi 23 novembre 2022 à 17:33 +0100, Daniel Vetter a écrit :
> > On Wed, Nov 23, 2022 at 10:33:38AM +0200, Pekka Paalanen wrote:
> > > On Tue, 22 Nov 2022 18:33:59 +0100
> > > Christian König <christian.koenig@amd.com> wrote:
> > > 
> > > > We should have come up with dma-heaps earlier and make it clear that 
> > > > exporting a DMA-buf from a device gives you something device specific 
> > > > which might or might not work with others.
> > > > 
> > > > Apart from that I agree, DMA-buf should be capable of handling this. 
> > > > Question left is what documentation is missing to make it clear how 
> > > > things are supposed to work?
> > > 
> > > Perhaps somewhat related from Daniel Stone that seems to have been
> > > forgotten:
> > > https://lore.kernel.org/dri-devel/20210905122742.86029-1-daniels@collabora.com/
> > > 
> > > It aimed mostly at userspace, but sounds to me like the coherency stuff
> > > could use a section of its own there?
> > 
> > Hm yeah it would be great to land that and then eventually extend. Daniel?
> 
> There is a lot of things documented in this document that have been said to be
> completely wrong user-space behaviour in this thread. But it seems to pre-date
> the DMA Heaps. The document also assume that DMA Heaps completely solves the CMA
> vs system memory issue. But it also underline a very important aspect, that
> userland is not aware which one to use. What this document suggest though seems
> more realist then what has been said here.
> 
> Its overall a great document, it unfortunate that it only makes it into the DRM
> mailing list.

The doc is more about document the current status quo/best practices,
which is very much not using dma-heaps.

The issue there is that currently userspace has no idea which dma-heap to
use for shared buffers, plus not all allocators are exposed through heaps
to begin with. We had this noted as a todo item (add some device->heap
sysfs links was the idea), until that's done all you can do is hardcode
the right heaps for the right usage in userspace, which is what android
does. Plus android doesn't have dgpu, so doesn't need the missing ttm
heap.

But yeah the long-term aspiration also hasn't changed, because the
dma-heap todo list is also very, very old by now :-/
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2022-11-30 10:31 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 12:13 Try to address the DMA-buf coherency problem Christian König
2022-10-20 12:13 ` [PATCH 1/3] dma-buf: add dma_coherent flag Christian König
2022-10-20 12:13 ` [PATCH 2/3] drm/prime: set the dma_coherent flag for export Christian König
2022-10-20 14:43   ` Rob Clark
2022-10-20 14:56     ` Christian König
2022-10-28  1:11       ` Rob Clark
2022-10-20 12:13 ` [PATCH 3/3] media: videobuf2: set dma_coherent flag for DMA-buf Christian König
2022-11-04 10:42   ` Hans Verkuil
2022-10-27 12:14 ` Try to address the DMA-buf coherency problem Christian König
2022-10-28  8:09 ` Lucas Stach
2022-10-28  8:40   ` Christian König
2022-10-28 11:42     ` Lucas Stach
2022-10-28 14:26       ` Christian König
2022-10-28 15:46         ` Nicolas Dufresne
2022-10-28 17:50           ` Christian König
2022-10-28 18:47             ` Daniel Stone
2022-11-01 17:40               ` Christian König
2022-11-01 21:09                 ` Nicolas Dufresne
2022-11-02 11:18                   ` Christian König
2022-11-02 11:39                     ` Lucas Stach
2022-11-02 12:21                       ` Christian König
2022-11-02 17:10                         ` Lucas Stach
2022-11-02 19:13                           ` Christian König
2022-11-02 19:48                             ` Lucas Stach
2022-11-17  9:35                             ` Tomasz Figa
2022-11-17 12:10                               ` Christian König
2022-11-17 15:38                                 ` Nicolas Dufresne
2022-11-18 19:32                                   ` Rob Clark
2022-11-19 20:35                                     ` Nicolas Dufresne
2022-11-22 14:36                                     ` Daniel Vetter
2022-11-22 17:33                                       ` Christian König
2022-11-22 18:26                                         ` Daniel Vetter
2022-11-23  8:33                                         ` Pekka Paalanen
2022-11-23 16:33                                           ` Daniel Vetter
2022-11-25 16:40                                             ` Nicolas Dufresne
2022-11-30 10:30                                               ` Daniel Vetter [this message]
2022-12-02 15:27                                                 ` Christian König
2023-01-05 11:46                                                   ` Daniel Vetter
2022-12-05  6:41                                 ` Tomasz Figa
2022-12-05  8:28                                   ` Christian König
2022-12-06 18:26                                     ` Nicolas Dufresne
2022-12-06 18:37                                       ` Christian König
2022-12-09  8:26                                     ` Tomasz Figa
2022-12-09  9:32                                       ` Pekka Paalanen
2022-12-09 17:07                                         ` Alex Deucher
2023-01-05 11:50                                           ` [Linaro-mm-sig] " Daniel Vetter
2022-12-12  3:13                                         ` Tomasz Figa
2022-12-09 10:27                                       ` Christian König
2022-12-12  3:00                                         ` Tomasz Figa
2022-12-12 11:15                                           ` Christian König
2023-01-05 20:39                                         ` Sebastian Wick
2022-11-04 14:58                         ` Rob Clark
2022-11-04 15:00                           ` Christian König
2022-11-02 12:19                     ` Pekka Paalanen
2022-11-02 12:27                       ` Christian König
2022-11-02 12:50                         ` Pekka Paalanen
2022-11-02 12:56                           ` Christian König
2022-11-03 22:16                     ` Nicolas Dufresne
2022-11-04  9:03                       ` Christian König
2022-11-04 13:38                         ` Nicolas Dufresne
2022-11-04 14:51                           ` Christian König

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=Y4cw36MUO+ftP468@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=christian.koenig@amd.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=l.stach@pengutronix.de \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=nicolas@ndufresne.ca \
    --cc=ppaalanen@gmail.com \
    --cc=robdclark@gmail.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