All of lore.kernel.org
 help / color / mirror / Atom feed
* Try to address the DMA-buf coherency problem
@ 2022-10-20 12:13 Christian König
  2022-10-20 12:13 ` [PATCH 1/3] dma-buf: add dma_coherent flag Christian König
                   ` (4 more replies)
  0 siblings, 5 replies; 110+ messages in thread
From: Christian König @ 2022-10-20 12:13 UTC (permalink / raw)
  To: l.stach, nicolas, ppaalanen, sumit.semwal, daniel, robdclark,
	dri-devel, linaro-mm-sig, linux-media

Hi guys,

after finding that we essentially have two separate worlds for coherent sharing
of buffer through DMA-buf I thought I will tackle that problem a bit and at
least allow the framework to reject attachments which won't work.

So those patches here add a new dma_coherent flag to each DMA-buf object
telling the framework that dev_is_dma_coherent() needs to return true for an
importing device to be able to attach. Since we should always have a fallback
path this should give userspace the chance to still keep the use case working,
either by doing a CPU copy instead or reversing the roles of exporter and
importer.

For DRM and most V4L2 devices I then fill in the dma_coherent flag based on the
return value of dev_is_dma_coherent(). Exporting drivers are allowed to clear
the flag for their buffers if special handling like the USWC flag in amdgpu or
the uncached allocations for radeon/nouveau are in use.

Additional to that importers can also check the flag if they have some
non-snooping operations like the special scanout case for amdgpu for example.

The patches are only smoke tested and the solution isn't ideal, but as far as
I can see should at least keep things working.

Please review and/or comment,
Christian.



^ permalink raw reply	[flat|nested] 110+ messages in thread

end of thread, other threads:[~2023-01-05 20:40 UTC | newest]

Thread overview: 110+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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:43     ` Rob Clark
2022-10-20 14:56     ` Christian König
2022-10-20 14:56       ` Christian König
2022-10-28  1:11       ` Rob Clark
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-10-28 18:47               ` Daniel Stone
2022-11-01 17:40               ` Christian König
2022-11-01 17:40                 ` Christian König
2022-11-01 21:09                 ` Nicolas Dufresne
2022-11-01 21:09                   ` Nicolas Dufresne
2022-11-02 11:18                   ` Christian König
2022-11-02 11:18                     ` Christian König
2022-11-02 11:39                     ` Lucas Stach
2022-11-02 11:39                       ` Lucas Stach
2022-11-02 12:21                       ` Christian König
2022-11-02 12:21                         ` Christian König
2022-11-02 17:10                         ` Lucas Stach
2022-11-02 17:10                           ` Lucas Stach
2022-11-02 19:13                           ` Christian König
2022-11-02 19:13                             ` Christian König
2022-11-02 19:48                             ` Lucas Stach
2022-11-02 19:48                               ` Lucas Stach
2022-11-17  9:35                             ` Tomasz Figa
2022-11-17  9:35                               ` Tomasz Figa
2022-11-17 12:10                               ` Christian König
2022-11-17 12:10                                 ` Christian König
2022-11-17 15:38                                 ` Nicolas Dufresne
2022-11-17 15:38                                   ` Nicolas Dufresne
2022-11-18 19:32                                   ` Rob Clark
2022-11-18 19:32                                     ` Rob Clark
2022-11-19 20:35                                     ` Nicolas Dufresne
2022-11-19 20:35                                       ` Nicolas Dufresne
2022-11-22 14:36                                     ` Daniel Vetter
2022-11-22 14:36                                       ` Daniel Vetter
2022-11-22 17:33                                       ` Christian König
2022-11-22 17:33                                         ` Christian König
2022-11-22 18:26                                         ` Daniel Vetter
2022-11-22 18:26                                           ` Daniel Vetter
2022-11-23  8:33                                         ` Pekka Paalanen
2022-11-23  8:33                                           ` Pekka Paalanen
2022-11-23 16:33                                           ` Daniel Vetter
2022-11-23 16:33                                             ` Daniel Vetter
2022-11-25 16:40                                             ` Nicolas Dufresne
2022-11-25 16:40                                               ` Nicolas Dufresne
2022-11-30 10:30                                               ` Daniel Vetter
2022-11-30 10:30                                                 ` Daniel Vetter
2022-12-02 15:27                                                 ` Christian König
2022-12-02 15:27                                                   ` Christian König
2023-01-05 11:46                                                   ` Daniel Vetter
2023-01-05 11:46                                                     ` Daniel Vetter
2022-12-05  6:41                                 ` Tomasz Figa
2022-12-05  6:41                                   ` Tomasz Figa
2022-12-05  8:28                                   ` Christian König
2022-12-05  8:28                                     ` Christian König
2022-12-06 18:26                                     ` Nicolas Dufresne
2022-12-06 18:26                                       ` Nicolas Dufresne
2022-12-06 18:37                                       ` Christian König
2022-12-06 18:37                                         ` Christian König
2022-12-09  8:26                                     ` Tomasz Figa
2022-12-09  8:26                                       ` Tomasz Figa
2022-12-09  9:32                                       ` Pekka Paalanen
2022-12-09  9:32                                         ` Pekka Paalanen
2022-12-09 17:07                                         ` Alex Deucher
2022-12-09 17:07                                           ` Alex Deucher
2023-01-05 11:50                                           ` [Linaro-mm-sig] " Daniel Vetter
2023-01-05 11:50                                             ` Daniel Vetter
2022-12-12  3:13                                         ` Tomasz Figa
2022-12-12  3:13                                           ` Tomasz Figa
2022-12-09 10:27                                       ` Christian König
2022-12-09 10:27                                         ` Christian König
2022-12-12  3:00                                         ` Tomasz Figa
2022-12-12  3:00                                           ` Tomasz Figa
2022-12-12 11:15                                           ` Christian König
2022-12-12 11:15                                             ` Christian König
2023-01-05 20:39                                         ` Sebastian Wick
2023-01-05 20:39                                           ` Sebastian Wick
2022-11-04 14:58                         ` Rob Clark
2022-11-04 14:58                           ` Rob Clark
2022-11-04 15:00                           ` Christian König
2022-11-04 15:00                             ` Christian König
2022-11-02 12:19                     ` Pekka Paalanen
2022-11-02 12:19                       ` Pekka Paalanen
2022-11-02 12:27                       ` Christian König
2022-11-02 12:27                         ` Christian König
2022-11-02 12:50                         ` Pekka Paalanen
2022-11-02 12:50                           ` Pekka Paalanen
2022-11-02 12:56                           ` Christian König
2022-11-02 12:56                             ` Christian König
2022-11-03 22:16                     ` Nicolas Dufresne
2022-11-03 22:16                       ` Nicolas Dufresne
2022-11-04  9:03                       ` Christian König
2022-11-04  9:03                         ` Christian König
2022-11-04 13:38                         ` Nicolas Dufresne
2022-11-04 13:38                           ` Nicolas Dufresne
2022-11-04 14:51                           ` Christian König
2022-11-04 14:51                             ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.