Skip to content

Commit 5c4e8c7

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 <[email protected]> Cc: Yifan Zhang <[email protected]> Acked-by: Harry Wentland <[email protected]> Reviewed-by: Yifan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.1.x
1 parent 077e965 commit 5c4e8c7

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

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

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

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

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

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

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

0 commit comments

Comments
 (0)