Skip to content

Commit bff3315

Browse files
committed
drm/amdgpu: fix AGP init order
The default AGP settings were overwriting the IP selected ones since the default was getting set after the IP ones were selected. Fixes: de59b69 ("drm/amdgpu/gmc: set a default disable value for AGP") Link: https://lists.freedesktop.org/archives/amd-gfx/2023-November/100966.html Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
1 parent 20238a2 commit bff3315

7 files changed

Lines changed: 7 additions & 3 deletions

File tree

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,6 @@ static const char * const amdgpu_vram_names[] = {
10621062
*/
10631063
int amdgpu_bo_init(struct amdgpu_device *adev)
10641064
{
1065-
/* set the default AGP aperture state */
1066-
amdgpu_gmc_set_agp_default(adev, &adev->gmc);
1067-
10681065
/* On A+A platform, VRAM can be mapped as WB */
10691066
if (!adev->gmc.xgmi.connected_to_cpu && !adev->gmc.is_app_apu) {
10701067
/* reserve PAT memory space to WC for VRAM */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev,
672672
/* add the xgmi offset of the physical node */
673673
base += adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
674674

675+
amdgpu_gmc_set_agp_default(adev, mc);
675676
amdgpu_gmc_vram_location(adev, &adev->gmc, base);
676677
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
677678
if (!amdgpu_sriov_vf(adev))

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

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

638638
base = adev->mmhub.funcs->get_fb_location(adev);
639639

640+
amdgpu_gmc_set_agp_default(adev, mc);
640641
amdgpu_gmc_vram_location(adev, &adev->gmc, base);
641642
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_HIGH);
642643
if (!amdgpu_sriov_vf(adev) ||

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

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

212212
base <<= 24;
213213

214+
amdgpu_gmc_set_agp_default(adev, mc);
214215
amdgpu_gmc_vram_location(adev, mc, base);
215216
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
216217
}

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

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

240240
base <<= 24;
241241

242+
amdgpu_gmc_set_agp_default(adev, mc);
242243
amdgpu_gmc_vram_location(adev, mc, base);
243244
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
244245
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ static void gmc_v8_0_vram_gtt_location(struct amdgpu_device *adev,
413413
base = RREG32(mmMC_VM_FB_LOCATION) & 0xFFFF;
414414
base <<= 24;
415415

416+
amdgpu_gmc_set_agp_default(adev, mc);
416417
amdgpu_gmc_vram_location(adev, mc, base);
417418
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
418419
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,8 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
16141614
{
16151615
u64 base = adev->mmhub.funcs->get_fb_location(adev);
16161616

1617+
amdgpu_gmc_set_agp_default(adev, mc);
1618+
16171619
/* add the xgmi offset of the physical node */
16181620
base += adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
16191621
if (adev->gmc.xgmi.connected_to_cpu) {

0 commit comments

Comments
 (0)