Commit 45c690ae authored by Lu Baolu's avatar Lu Baolu Committed by Lyude Paul

drm/tegra: Use iommu_paging_domain_alloc()

Commit <17de3f5f> ("iommu: Retire bus ops") removes iommu ops from
the bus structure. The iommu subsystem no longer relies on bus for
operations. So iommu_domain_alloc() interface is no longer relevant.

Replace iommu_domain_alloc() with iommu_paging_domain_alloc() which takes
the physical device from which the host1x_device virtual device was
instantiated. This physical device is a common parent to all physical
devices that are part of the virtual device.
Suggested-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240902014700.66095-4-baolu.lu@linux.intel.com
parent d8c07bee
...@@ -1135,6 +1135,7 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev) ...@@ -1135,6 +1135,7 @@ static bool host1x_drm_wants_iommu(struct host1x_device *dev)
static int host1x_drm_probe(struct host1x_device *dev) static int host1x_drm_probe(struct host1x_device *dev)
{ {
struct device *dma_dev = dev->dev.parent;
struct tegra_drm *tegra; struct tegra_drm *tegra;
struct drm_device *drm; struct drm_device *drm;
int err; int err;
...@@ -1149,8 +1150,8 @@ static int host1x_drm_probe(struct host1x_device *dev) ...@@ -1149,8 +1150,8 @@ static int host1x_drm_probe(struct host1x_device *dev)
goto put; goto put;
} }
if (host1x_drm_wants_iommu(dev) && iommu_present(&platform_bus_type)) { if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) {
tegra->domain = iommu_domain_alloc(&platform_bus_type); tegra->domain = iommu_paging_domain_alloc(dma_dev);
if (!tegra->domain) { if (!tegra->domain) {
err = -ENOMEM; err = -ENOMEM;
goto free; goto free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment