public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] drm/gem-dma: Support dedicated DMA device for allocation
@ 2026-03-11  9:49 Chen-Yu Tsai
  2026-03-11  9:49 ` [PATCH v2 1/4] drm/prime: Limit scatter list size with dedicated DMA device Chen-Yu Tsai
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Chen-Yu Tsai @ 2026-03-11  9:49 UTC (permalink / raw)
  To: Matthias Brugger, AngeloGioacchino Del Regno, Chun-Kuang Hu,
	Philipp Zabel, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Chen-Yu Tsai, Jernej Skrabec, Samuel Holland,
	David Airlie, Simona Vetter
  Cc: Chen-Yu Tsai, linux-sunxi, Paul Kocialkowski, linux-mediatek,
	dri-devel, linux-arm-kernel, linux-kernel

Hi folks,

This is v2 of my "support dedicated DMA device for allocation and mmap
in GEM DMA helpers" series.

Changes since v1:
- Link to v1: https://lore.kernel.org/all/20260310032511.2545500-1-wenst@chromium.org/
- Collected tags
- Removed reference to mtk_gem.c from the Makefile

This series expands the "dedicated DMA device" support in DRM to the GEM
DMA helpers, and converts the MediaTek DRM driver to setting the DMA
device and dropping the custom GEM helpers that implemented this
function.

Various display drivers implement the "dedicated DMA device" support
with custom GEM helpers. These include Exynos, MediaTek, and Rockchip
to name a few. Allwinner does something entirely different, calling
of_dma_configure() on the virtual display device using the OF node of
the actual DMA device. Recently this causes a warning if IOMMUs are
involved.

The dedicated DMA device is set by calling drm_dev_set_dma_dev(). Any
code that does DMA related actions should use drm_dev_dma_dev() to get
the DMA device. If a dedicated device was not set, then it shall fall
back to the DRM device's underlying device.

This series intends to allow the core helpers to deal with it, and not
have every driver implement it in slightly different ways, duplicating
code.

Patch 1 adds dedicated DMA device support to drm_prime_pages_to_sg().
I believe this was missing from the original change that added dedicated
DMA devices for PRIME.

Patch 2 adds support for dedicated DMA device to the GEM DMA helpers
for GEM buffer allocation and mmap.

Patch 3 converts the MediaTek DRM driver to use the dedicated DMA device
support, and drop all the remaining custom GEM callbacks that deal with
it.

Patch 4 converts the Allwinner sun4i DRM driver to use the dedicated DMA
device support, instead of the of_dma_configure() hack it currently has.

The series should be merged through drm-misc-next so that other drivers
can take advantage of the change.

I also intend to try to convert the Exynos and Rockchip drivers, however
both also have options to set DMA_ATTR_NO_KERNEL_MAPPING when using
dma_alloc_attrs() to allocate memory for the buffers. I intend to
resurrect the DRM_MODE_DUMB_KERNEL_MAP work from Rob Herring [1]
to handle this. The Rockchip driver also has custom IOMMU attachment
that I'm still trying to understand.


Thanks
ChenYu


Chen-Yu Tsai (4):
  drm/prime: Limit scatter list size with dedicated DMA device
  drm/gem-dma: Support dedicated DMA device for allocation and mapping
  drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks
  drm/sun4i: Use backend/mixer as dedicated DMA device

 drivers/gpu/drm/drm_gem_dma_helper.c   |  21 ++-
 drivers/gpu/drm/drm_prime.c            |   2 +-
 drivers/gpu/drm/mediatek/Makefile      |   1 -
 drivers/gpu/drm/mediatek/mtk_crtc.c    |   1 -
 drivers/gpu/drm/mediatek/mtk_drm_drv.c |  21 +--
 drivers/gpu/drm/mediatek/mtk_drm_drv.h |   1 -
 drivers/gpu/drm/mediatek/mtk_gem.c     | 231 -------------------------
 drivers/gpu/drm/mediatek/mtk_gem.h     |  17 --
 drivers/gpu/drm/sun4i/sun4i_backend.c  |  27 +--
 drivers/gpu/drm/sun4i/sun8i_mixer.c    |  27 +--
 10 files changed, 46 insertions(+), 303 deletions(-)
 delete mode 100644 drivers/gpu/drm/mediatek/mtk_gem.c
 delete mode 100644 drivers/gpu/drm/mediatek/mtk_gem.h

-- 
2.53.0.473.g4a7958ca14-goog



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

end of thread, other threads:[~2026-03-26  6:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11  9:49 [PATCH v2 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai
2026-03-11  9:49 ` [PATCH v2 1/4] drm/prime: Limit scatter list size with dedicated DMA device Chen-Yu Tsai
2026-03-11 14:40   ` AngeloGioacchino Del Regno
2026-03-11  9:49 ` [PATCH v2 2/4] drm/gem-dma: Support dedicated DMA device for allocation and mapping Chen-Yu Tsai
2026-03-11 14:40   ` AngeloGioacchino Del Regno
2026-03-11  9:49 ` [PATCH v2 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks Chen-Yu Tsai
2026-03-11 14:40   ` AngeloGioacchino Del Regno
2026-03-22 13:57   ` Chun-Kuang Hu
2026-03-11  9:49 ` [PATCH v2 4/4] drm/sun4i: Use backend/mixer as dedicated DMA device Chen-Yu Tsai
2026-03-12 15:43   ` Jernej Škrabec
2026-03-26  6:58 ` [PATCH v2 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox