]> git.ipfire.org Git - thirdparty/linux.git/commit
drm/gem-dma: Support dedicated DMA device for allocation and mapping
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 11 Mar 2026 09:49:26 +0000 (17:49 +0800)
committerChen-Yu Tsai <wenst@chromium.org>
Mon, 23 Mar 2026 05:23:29 +0000 (13:23 +0800)
commita9da24732aaa80d631bffc8a1390836d4b896690
tree172fa358b34bf35f74f5b5ca2811252ac192a120
parent864279920b2b2c1dd491eba0d0c64764c0c03d9f
drm/gem-dma: Support dedicated DMA device for allocation and mapping

Support for a dedicated DMA device for prime imports was added in commit
143ec8d3f939 ("drm/prime: Support dedicated DMA device for dma-buf imports").
This allowed the DRM driver to provide a dedicated DMA device when its
own underlying device was not capable of DMA, for example when it is a
USB device (the original target) or a virtual device. The latter case is
common on embedded SoCs, on which the display pipeline is composed of
various fixed function blocks, and the DRM device is simply a made-up
device, an address space managing the routing between the blocks, or
whichever block the implementor thought made sense at the time. The
point is that the chosen device is often not the actual device doing
the DMA. Various drivers have used workarounds or reimplemented the
GEM DMA helpers to get the DMA addresses and IOMMUs to work correctly.

Add support for the dedicated DMA device to the GEM DMA helpers.

No existing driver currently uses the GEM DMA helpers and calls
drm_dev_set_dma_dev() to set a dedicated DMA device, so no existing
users should be affected.

Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://patch.msgid.link/20260311094929.3393338-3-wenst@chromium.org
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
drivers/gpu/drm/drm_gem_dma_helper.c