Skip to content

Commit c6eafee

Browse files
committed
Revert "Revert "drm/amdgpu/gmc11: enable AGP aperture""
This reverts commit 1a65327. This should be resolved so we can re-enable this. Also, the AGP apeture was bring programmed to 0 on MMHUB 3.0.1 since agp_start and end were not being set. 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 0294868 commit c6eafee

4 files changed

Lines changed: 12 additions & 9 deletions

File tree

drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,11 @@ static void gfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)
151151
{
152152
uint64_t value;
153153

154-
/* Disable AGP. */
154+
/* Program the AGP BAR */
155155
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BASE, 0);
156-
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_TOP, 0);
157-
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BOT, 0x00FFFFFF);
156+
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
157+
WREG32_SOC15(GC, 0, regGCMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
158+
158159

159160
/* Program the system aperture low logical page number. */
160161
WREG32_SOC15(GC, 0, regGCMC_VM_SYSTEM_APERTURE_LOW_ADDR,

drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ static void gmc_v11_0_vram_gtt_location(struct amdgpu_device *adev,
673673

674674
amdgpu_gmc_vram_location(adev, &adev->gmc, base);
675675
amdgpu_gmc_gart_location(adev, mc);
676+
amdgpu_gmc_agp_location(adev, mc);
676677

677678
/* base offset of vram pages */
678679
if (amdgpu_sriov_vf(adev))

drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ static void mmhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev)
177177
* these regs, and they will be programed at host.
178178
* so skip programing these regs.
179179
*/
180-
/* Disable AGP. */
180+
/* Program the AGP BAR */
181181
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BASE, 0);
182-
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, 0);
183-
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, 0x00FFFFFF);
182+
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
183+
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
184+
184185
/* Program the system aperture low logical page number. */
185186
WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_LOW_ADDR,
186187
adev->gmc.vram_start >> 18);

drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ static void mmhub_v3_0_2_init_system_aperture_regs(struct amdgpu_device *adev)
162162
uint64_t value;
163163
uint32_t tmp;
164164

165-
/* Disable AGP. */
165+
/* Program the AGP BAR */
166166
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BASE, 0);
167-
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, 0);
168-
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, 0x00FFFFFF);
167+
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
168+
WREG32_SOC15(MMHUB, 0, regMMMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
169169

170170
if (!amdgpu_sriov_vf(adev)) {
171171
/*

0 commit comments

Comments
 (0)