Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/rockchip: Set VOP for the DRM DMA device

Use VOP for DMA operations performed by DRM core. Rockchip DRM driver
is backed by a virtual device that isn't IOMMU-capable, while VOP is the
actual display controller device backed by IOMMU. Fixes "swiotlb buffer
is full" warning messages originated from GEM prime code paths.

Note, that backporting is non-trivial as this depends on
commit 143ec8d3f9396 ("drm/prime: Support dedicated DMA device for dma-buf
imports"), which landed in v6.16 and commit 421be3ee36a4 ("drm/rockchip:
Refactor IOMMU initialisation"), which landed in v5.19.

Reported-by: Daniel Stone <daniels@collabora.com>
Fixes: 2048e3286f34 ("drm: rockchip: Add basic drm driver")
Cc: stable@vger.kernel.org # v6.16+
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20251022161948.199731-1-dmitry.osipenko@collabora.com

authored by

Dmitry Osipenko and committed by
Heiko Stuebner
7d7bb790 e95b9ff6

+3
+3
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
··· 97 97 private->iommu_dev = ERR_PTR(-ENODEV); 98 98 else if (!private->iommu_dev) 99 99 private->iommu_dev = dev; 100 + 101 + if (!IS_ERR(private->iommu_dev)) 102 + drm_dev_set_dma_dev(drm_dev, private->iommu_dev); 100 103 } 101 104 102 105 static int rockchip_drm_init_iommu(struct drm_device *drm_dev)