public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/gem-dma: Support dedicated DMA device for allocation
@ 2026-03-10  3:20 Chen-Yu Tsai
  2026-03-10  3:20 ` [PATCH 1/4] drm/prime: Limit scatter list size with dedicated DMA device Chen-Yu Tsai
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Chen-Yu Tsai @ 2026-03-10  3:20 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 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.

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/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 +--
 9 files changed, 46 insertions(+), 302 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] 10+ messages in thread

end of thread, other threads:[~2026-03-11  3:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10  3:20 [PATCH 0/4] drm/gem-dma: Support dedicated DMA device for allocation Chen-Yu Tsai
2026-03-10  3:20 ` [PATCH 1/4] drm/prime: Limit scatter list size with dedicated DMA device Chen-Yu Tsai
2026-03-11  3:48   ` Claude review: " Claude Code Review Bot
2026-03-10  3:20 ` [PATCH 2/4] drm/gem-dma: Support dedicated DMA device for allocation and mapping Chen-Yu Tsai
2026-03-11  3:48   ` Claude review: " Claude Code Review Bot
2026-03-10  3:20 ` [PATCH 3/4] drm/mediatek: Set dedicated DMA device and drop custom GEM callbacks Chen-Yu Tsai
2026-03-11  3:48   ` Claude review: " Claude Code Review Bot
2026-03-10  3:20 ` [PATCH 4/4] drm/sun4i: Use backend/mixer as dedicated DMA device Chen-Yu Tsai
2026-03-11  3:48   ` Claude review: " Claude Code Review Bot
2026-03-11  3:48 ` Claude review: drm/gem-dma: Support dedicated DMA device for allocation Claude Code Review Bot

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