@@ -1786,35 +1786,34 @@ a6xx_create_address_space(struct msm_gpu *gpu, struct platform_device *pdev)
17861786{
17871787 struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
17881788 struct a6xx_gpu * a6xx_gpu = to_a6xx_gpu (adreno_gpu );
1789- struct iommu_domain * iommu ;
1789+ struct iommu_domain_geometry * geometry ;
17901790 struct msm_mmu * mmu ;
17911791 struct msm_gem_address_space * aspace ;
17921792 u64 start , size ;
1793-
1794- iommu = iommu_domain_alloc (& platform_bus_type );
1795- if (!iommu )
1796- return NULL ;
1793+ unsigned long quirks = 0 ;
17971794
17981795 /*
17991796 * This allows GPU to set the bus attributes required to use system
18001797 * cache on behalf of the iommu page table walker.
18011798 */
18021799 if (!IS_ERR_OR_NULL (a6xx_gpu -> htw_llc_slice ))
1803- adreno_set_llc_attributes ( iommu ) ;
1800+ quirks |= IO_PGTABLE_QUIRK_ARM_OUTER_WBWA ;
18041801
1805- mmu = msm_iommu_new (& pdev -> dev , iommu );
1806- if (IS_ERR (mmu )) {
1807- iommu_domain_free (iommu );
1802+ mmu = msm_iommu_new (& pdev -> dev , quirks );
1803+ if (IS_ERR_OR_NULL (mmu ))
18081804 return ERR_CAST (mmu );
1809- }
1805+
1806+ geometry = msm_iommu_get_geometry (mmu );
1807+ if (IS_ERR (geometry ))
1808+ return ERR_CAST (geometry );
18101809
18111810 /*
18121811 * Use the aperture start or SZ_16M, whichever is greater. This will
18131812 * ensure that we align with the allocated pagetable range while still
18141813 * allowing room in the lower 32 bits for GMEM and whatnot
18151814 */
1816- start = max_t (u64 , SZ_16M , iommu -> geometry . aperture_start );
1817- size = iommu -> geometry . aperture_end - start + 1 ;
1815+ start = max_t (u64 , SZ_16M , geometry -> aperture_start );
1816+ size = geometry -> aperture_end - start + 1 ;
18181817
18191818 aspace = msm_gem_address_space_create (mmu , "gpu" ,
18201819 start & GENMASK_ULL (48 , 0 ), size );
0 commit comments