All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] drm/prime: Only call dma_map_sgtable() for devices with DMA support
@ 2021-02-22 12:43 ` Thomas Zimmermann
  0 siblings, 0 replies; 24+ messages in thread
From: Thomas Zimmermann @ 2021-02-22 12:43 UTC (permalink / raw)
  To: daniel, airlied, maarten.lankhorst, mripard, yuq825, robh,
	tomeu.vizoso, steven.price, alyssa.rosenzweig, eric,
	sumit.semwal, christian.koenig, stern
  Cc: dri-devel, lima, linux-media, linaro-mm-sig, Thomas Zimmermann

USB-based drivers cannot use DMA, so the importing of dma-buf attachments
currently fails for udl and gm12u320. This breaks joining/mirroring of
displays.

The fix is now a little series. To solve the issue on the importer
side (i.e., the affected USB-based driver), patch 1 introduces a new
PRIME callback, struct drm_driver.gem_prime_create_object, which creates
an object and gives more control to the importing driver. Specifically,
udl and gm12u320 can now avoid the creation of a scatter/gather table
for the imported pages. Patch 1 is self-contained in the sense that it
can be backported into older kernels.

Patches 2 and 3 update SHMEM and CMA helpers to use the new callback.
Effectively this moves the sg table setup from the PRIME helpers into
the memory managers. SHMEM now supports devices without DMA support,
so custom code can be removed from udl and g12u320.

Tested by joining/mirroring displays of udl and radeon under Gnome/X11.

v2:
	* move fix to importer side (Christian, Daniel)
	* update SHMEM and CMA helpers for new PRIME callbacks

Thomas Zimmermann (3):
  drm: Support importing dmabufs into drivers without DMA
  drm/shmem-helper: Implement struct drm_driver.gem_prime_create_object
  drm/cma-helper: Implement struct drm_driver.gem_prime_create_object

 drivers/gpu/drm/drm_gem_cma_helper.c    | 62 ++++++++++++++-----------
 drivers/gpu/drm/drm_gem_shmem_helper.c  | 38 ++++++++++-----
 drivers/gpu/drm/drm_prime.c             | 43 +++++++++++------
 drivers/gpu/drm/lima/lima_drv.c         |  2 +-
 drivers/gpu/drm/panfrost/panfrost_drv.c |  2 +-
 drivers/gpu/drm/panfrost/panfrost_gem.c |  6 +--
 drivers/gpu/drm/panfrost/panfrost_gem.h |  4 +-
 drivers/gpu/drm/pl111/pl111_drv.c       |  8 ++--
 drivers/gpu/drm/v3d/v3d_bo.c            |  6 +--
 drivers/gpu/drm/v3d/v3d_drv.c           |  2 +-
 drivers/gpu/drm/v3d/v3d_drv.h           |  5 +-
 include/drm/drm_drv.h                   | 12 +++++
 include/drm/drm_gem_cma_helper.h        | 12 ++---
 include/drm/drm_gem_shmem_helper.h      |  6 +--
 14 files changed, 120 insertions(+), 88 deletions(-)

--
2.30.1


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

end of thread, other threads:[~2021-02-23  8:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 12:43 [PATCH v2 0/3] drm/prime: Only call dma_map_sgtable() for devices with DMA support Thomas Zimmermann
2021-02-22 12:43 ` Thomas Zimmermann
2021-02-22 12:43 ` [PATCH v2 1/3] drm: Support importing dmabufs into drivers without DMA Thomas Zimmermann
2021-02-22 12:43   ` Thomas Zimmermann
2021-02-22 13:10   ` Ahmed S. Darwish
2021-02-22 13:10     ` Ahmed S. Darwish
2021-02-22 16:31   ` Daniel Vetter
2021-02-22 16:31     ` Daniel Vetter
2021-02-22 12:43 ` [PATCH v2 2/3] drm/shmem-helper: Implement struct drm_driver.gem_prime_create_object Thomas Zimmermann
2021-02-22 12:43   ` Thomas Zimmermann
2021-02-22 12:43 ` [PATCH v2 3/3] drm/cma-helper: " Thomas Zimmermann
2021-02-22 12:43   ` Thomas Zimmermann
2021-02-22 13:09 ` [PATCH v2 0/3] drm/prime: Only call dma_map_sgtable() for devices with DMA support Christian König
2021-02-22 13:09   ` Christian König
2021-02-22 13:24   ` Thomas Zimmermann
2021-02-22 13:24     ` Thomas Zimmermann
2021-02-22 16:10     ` Daniel Vetter
2021-02-22 16:10       ` Daniel Vetter
2021-02-22 16:25       ` Thomas Zimmermann
2021-02-22 16:25         ` Thomas Zimmermann
2021-02-22 16:34         ` Daniel Vetter
2021-02-22 16:34           ` Daniel Vetter
2021-02-23  8:19           ` Thomas Zimmermann
2021-02-23  8:19             ` Thomas Zimmermann

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.