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

drm/rockchip: Use iommu_paging_domain_alloc()

Commit <421be3ee36a4> ("drm/rockchip: Refactor IOMMU initialisation") has
refactored rockchip_drm_init_iommu() to pass a device that the domain is
allocated for. Replace iommu_domain_alloc() with
iommu_paging_domain_alloc() to retire the former.

Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Andy Yan <andyshrk@163.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240902014700.66095-3-baolu.lu@linux.intel.com

authored by

Lu Baolu and committed by
Lyude Paul
d8c07bee 8c7c44be

+7 -3
+7 -3
drivers/gpu/drm/rockchip/rockchip_drm_drv.c
··· 103 103 struct rockchip_drm_private *private = drm_dev->dev_private; 104 104 struct iommu_domain_geometry *geometry; 105 105 u64 start, end; 106 + int ret; 106 107 107 108 if (IS_ERR_OR_NULL(private->iommu_dev)) 108 109 return 0; 109 110 110 - private->domain = iommu_domain_alloc(private->iommu_dev->bus); 111 - if (!private->domain) 112 - return -ENOMEM; 111 + private->domain = iommu_paging_domain_alloc(private->iommu_dev); 112 + if (IS_ERR(private->domain)) { 113 + ret = PTR_ERR(private->domain); 114 + private->domain = NULL; 115 + return ret; 116 + } 113 117 114 118 geometry = &private->domain->geometry; 115 119 start = geometry->aperture_start;