drm/amdgpu: set system aperture to cover whole FB region in mmhub v9.4
authorLe Ma <le.ma@amd.com>
Fri, 26 Apr 2019 08:36:44 +0000 (16:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 18 Jul 2019 19:18:05 +0000 (14:18 -0500)
In XGMI configuration, the FB region covers vram region from peer
device, adjust system aperture to cover all of them

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c

index 6b7cdaadbd702eecea7ee1a109e1df97f2bd882a..c0eb8f0a21829522b7beb47d427f6a9eff15f5b4 100644 (file)
@@ -114,12 +114,11 @@ static void mmhub_v9_4_init_system_aperture_regs(struct amdgpu_device *adev,
        WREG32_SOC15_OFFSET(MMHUB, 0,
                            mmVMSHAREDVC0_MC_VM_SYSTEM_APERTURE_LOW_ADDR,
                            hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
-                           min(adev->gmc.vram_start, adev->gmc.agp_start)
-                           >> 18);
+                           min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
        WREG32_SOC15_OFFSET(MMHUB, 0,
                            mmVMSHAREDVC0_MC_VM_SYSTEM_APERTURE_HIGH_ADDR,
                            hubid * MMHUB_INSTANCE_REGISTER_OFFSET,
-                           max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
+                           max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
 
        /* Set default page address. */
        value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +