summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2023-02-09 07:31:13 +0300
committerAlex Deucher <alexander.deucher@amd.com>2023-02-09 18:02:53 +0300
commit73ac3f22f518d3307695729d41ef49d4209aa8af (patch)
tree7959fd1a345a68bab2fb8080be07eef1d15f9344 /drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
parent4936458bf989d168f5a89015dd81067c4c2bdc64 (diff)
downloadlinux-73ac3f22f518d3307695729d41ef49d4209aa8af.tar.xz
drm/amdgpu/gmc11: fix system aperture set when AGP is enabled
Need to cover both FB and AGP apertures. v2: fix missed gfxhub_v3_0_3.c Fixes: c6eafee038ed ("Revert "Revert "drm/amdgpu/gmc11: enable AGP aperture""") Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
index 923fc09bc8fc..164948c50ac3 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c
@@ -184,9 +184,9 @@ static void mmhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)
/* Program the system aperture low logical page number. */
WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_LOW_ADDR,
- adev->gmc.vram_start >> 18);
+ min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18);
WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
- adev->gmc.vram_end >> 18);
+ max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
/* Set default page address. */
value = adev->mem_scratch.gpu_addr - adev->gmc.vram_start +