@@ -277,21 +277,21 @@ struct msm_gem_address_space *msm_kms_init_aspace(struct drm_device *dev)
struct device *mdss_dev = mdp_dev->parent;
struct device *iommu_dev;
- domain = iommu_domain_alloc(&platform_bus_type);
- if (!domain) {
- drm_info(dev, "no IOMMU, fallback to phys contig buffers for scanout\n");
- return NULL;
- }
-
/*
* IOMMUs can be a part of MDSS device tree binding, or the
* MDP/DPU device.
*/
- if (dev_iommu_fwspec_get(mdp_dev))
+ if (device_iommu_mapped(mdp_dev))
iommu_dev = mdp_dev;
else
iommu_dev = mdss_dev;
+ domain = iommu_domain_alloc(iommu_dev->bus);
+ if (!domain) {
+ drm_info(dev, "no IOMMU, fallback to phys contig buffers for scanout\n");
+ return NULL;
+ }
+
mmu = msm_iommu_new(iommu_dev, domain);
if (IS_ERR(mmu)) {
iommu_domain_free(domain);