diff options
author | Lu Baolu <baolu.lu@linux.intel.com> | 2024-09-02 03:46:59 +0200 |
---|---|---|
committer | Lyude Paul <lyude@redhat.com> | 2024-09-10 21:40:26 +0200 |
commit | d8c07bee1e636db7ee6ab64b958f7bfdd9ff8c1e (patch) | |
tree | 4c0af06e21e88f42ece535dc2e146aac393bbd07 /drivers/gpu | |
parent | drm/syncobj: Fix syncobj leak in drm_syncobj_eventfd_ioctl (diff) | |
download | linux-d8c07bee1e636db7ee6ab64b958f7bfdd9ff8c1e.tar.xz linux-d8c07bee1e636db7ee6ab64b958f7bfdd9ff8c1e.zip |
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
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 44d769d9234d..11e5d10de4d7 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -103,13 +103,17 @@ static int rockchip_drm_init_iommu(struct drm_device *drm_dev) struct rockchip_drm_private *private = drm_dev->dev_private; struct iommu_domain_geometry *geometry; u64 start, end; + int ret; if (IS_ERR_OR_NULL(private->iommu_dev)) return 0; - private->domain = iommu_domain_alloc(private->iommu_dev->bus); - if (!private->domain) - return -ENOMEM; + private->domain = iommu_paging_domain_alloc(private->iommu_dev); + if (IS_ERR(private->domain)) { + ret = PTR_ERR(private->domain); + private->domain = NULL; + return ret; + } geometry = &private->domain->geometry; start = geometry->aperture_start; |