diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2020-05-23 01:03:15 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2020-05-23 23:38:16 +0300 |
commit | ccac7ce373c1b5175bcf733fe6223129b8975788 (patch) | |
tree | 62f147168606dc3ce30287b4a6d7ca7ce8cb3370 /drivers/gpu/drm/msm/adreno/a6xx_gmu.c | |
parent | 52da6d513183cf543df6efc95bf504aee0da70d6 (diff) | |
download | linux-ccac7ce373c1b5175bcf733fe6223129b8975788.tar.xz |
drm/msm: Refactor address space initialization
Refactor how address space initialization works. Instead of having the
address space function create the MMU object (and thus require separate but
equal functions for gpummu and iommu) use a single function and pass the
MMU struct in. Make the generic code cleaner by using target specific
functions to create the address space so a2xx can do its own thing in its
own space. For all the other targets use a generic helper to initialize
IOMMU but leave the door open for newer targets to use customization
if they need it.
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
[squash in rebase fixups]
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno/a6xx_gmu.c')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 0c72ae84e279..c5e21b53c4d0 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -1114,15 +1114,14 @@ static int a6xx_gmu_memory_alloc(struct a6xx_gmu *gmu, struct a6xx_gmu_bo *bo, static int a6xx_gmu_memory_probe(struct a6xx_gmu *gmu) { struct iommu_domain *domain; + struct msm_mmu *mmu; domain = iommu_domain_alloc(&platform_bus_type); if (!domain) return -ENODEV; - domain->geometry.aperture_start = 0x00000000; - domain->geometry.aperture_end = 0x7fffffff; - - gmu->aspace = msm_gem_address_space_create(gmu->dev, domain, "gmu"); + mmu = msm_iommu_new(gmu->dev, domain); + gmu->aspace = msm_gem_address_space_create(mmu, "gmu", 0x0, 0x7fffffff); if (IS_ERR(gmu->aspace)) { iommu_domain_free(domain); return PTR_ERR(gmu->aspace); |