Skip to content

Commit 0294868

Browse files
committed
drm/amd/display: properly handling AGP aperture in vm setup
Take into account whether or not the AGP aperture is enabled or not when calculating the system aperture. Fixes white screens with DCN 3.1.4. Based on a patch from Yifan Zhang <yifan1.zhang@amd.com> Cc: Yifan Zhang <yifan1.zhang@amd.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent f081cd4 commit 0294868

1 file changed

Lines changed: 28 additions & 14 deletions

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,24 +1185,38 @@ static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_
11851185

11861186
memset(pa_config, 0, sizeof(*pa_config));
11871187

1188-
logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18;
1189-
pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);
1190-
1191-
if (adev->apu_flags & AMD_APU_IS_RAVEN2)
1192-
/*
1193-
* Raven2 has a HW issue that it is unable to use the vram which
1194-
* is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
1195-
* workaround that increase system aperture high address (add 1)
1196-
* to get rid of the VM fault and hardware hang.
1197-
*/
1198-
logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18);
1199-
else
1200-
logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18;
1201-
12021188
agp_base = 0;
12031189
agp_bot = adev->gmc.agp_start >> 24;
12041190
agp_top = adev->gmc.agp_end >> 24;
12051191

1192+
/* AGP aperture is disabled */
1193+
if (agp_bot == agp_top) {
1194+
logical_addr_low = adev->gmc.vram_start >> 18;
1195+
if (adev->apu_flags & AMD_APU_IS_RAVEN2)
1196+
/*
1197+
* Raven2 has a HW issue that it is unable to use the vram which
1198+
* is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
1199+
* workaround that increase system aperture high address (add 1)
1200+
* to get rid of the VM fault and hardware hang.
1201+
*/
1202+
logical_addr_high = (adev->gmc.fb_end >> 18) + 0x1;
1203+
else
1204+
logical_addr_high = adev->gmc.vram_end >> 18;
1205+
} else {
1206+
logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18;
1207+
if (adev->apu_flags & AMD_APU_IS_RAVEN2)
1208+
/*
1209+
* Raven2 has a HW issue that it is unable to use the vram which
1210+
* is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the
1211+
* workaround that increase system aperture high address (add 1)
1212+
* to get rid of the VM fault and hardware hang.
1213+
*/
1214+
logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18);
1215+
else
1216+
logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18;
1217+
}
1218+
1219+
pt_base = amdgpu_gmc_pd_addr(adev->gart.bo);
12061220

12071221
page_table_start.high_part = (u32)(adev->gmc.gart_start >> 44) & 0xF;
12081222
page_table_start.low_part = (u32)(adev->gmc.gart_start >> 12);

0 commit comments

Comments
 (0)