]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/tegra: gem: Don't attach dma-bufs when not needed
authorMikko Perttunen <mperttunen@nvidia.com>
Wed, 24 Apr 2024 05:13:35 +0000 (08:13 +0300)
committerThierry Reding <treding@nvidia.com>
Thu, 29 Aug 2024 18:14:29 +0000 (20:14 +0200)
commitf5b8794e17e40219f22cf9b1216db21e38aa8dbb
tree571634c9318a25695027b398905328eeab273e18
parent4ed09565e0873a8ffdf6d71923f485bc778f2988
drm/tegra: gem: Don't attach dma-bufs when not needed

The dma-buf import code currently attaches and maps all imported
dma-bufs to the drm device to get their sgt for mapping to the
directly managed IOMMU domain.

In many cases, like for newer chips (Tegra186+), the directly
managed IOMMU domain is, however, not used. Mapping to the drm
device can also cause issues e.g. with swiotlb since it is not
a real device.

To improve the situation, only attach and map imported dma-bufs
when required.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240424051335.2872574-2-cyndis@kapsi.fi
drivers/gpu/drm/tegra/gem.c
drivers/gpu/drm/tegra/gem.h