]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amdgpu: fix AGP init order
authorAlex Deucher <alexander.deucher@amd.com>
Tue, 7 Nov 2023 19:07:44 +0000 (14:07 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 9 Nov 2023 21:59:46 +0000 (16:59 -0500)
The default AGP settings were overwriting the IP selected
ones since the default was getting set after the IP ones
were selected.

Fixes: de59b69932e6 ("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>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

index 0dcb6c36b02c0baa29c0c98347724ed0970f2c3a..cef920a93924b60140f40fb5020871a3e0c883eb 100644 (file)
@@ -1062,9 +1062,6 @@ static const char * const amdgpu_vram_names[] = {
  */
 int amdgpu_bo_init(struct amdgpu_device *adev)
 {
-       /* set the default AGP aperture state */
-       amdgpu_gmc_set_agp_default(adev, &adev->gmc);
-
        /* On A+A platform, VRAM can be mapped as WB */
        if (!adev->gmc.xgmi.connected_to_cpu && !adev->gmc.is_app_apu) {
                /* reserve PAT memory space to WC for VRAM */
index d8a4fddab9c1d074855c6f8bf52def44cb254a38..ef80ea0929fe8895f72bf40d3b8c091e3d522f22 100644 (file)
@@ -672,6 +672,7 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev,
        /* add the xgmi offset of the physical node */
        base += adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
 
+       amdgpu_gmc_set_agp_default(adev, mc);
        amdgpu_gmc_vram_location(adev, &adev->gmc, base);
        amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
        if (!amdgpu_sriov_vf(adev))
index 4713a62ad586f9a54a283030f3bca0a8259c8ed4..5f794a9079450fd89678722d9a71be76f11faf81 100644 (file)
@@ -637,6 +637,7 @@ static void gmc_v11_0_vram_gtt_location(struct amdgpu_device *adev,
 
        base = adev->mmhub.funcs->get_fb_location(adev);
 
+       amdgpu_gmc_set_agp_default(adev, mc);
        amdgpu_gmc_vram_location(adev, &adev->gmc, base);
        amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_HIGH);
        if (!amdgpu_sriov_vf(adev) ||
index 7f66954fd3027c2c1a683ecfc67bf5343129fc5c..42e103d7077d52d5bbe556f70f2b03bb0d5ae8db 100644 (file)
@@ -211,6 +211,7 @@ static void gmc_v6_0_vram_gtt_location(struct amdgpu_device *adev,
 
        base <<= 24;
 
+       amdgpu_gmc_set_agp_default(adev, mc);
        amdgpu_gmc_vram_location(adev, mc, base);
        amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
 }
index 61ca1a82b651aa5f603f3a8bfeea2ad70390fd61..efc16e580f1e27e384b7c80323c72d0e59fba473 100644 (file)
@@ -239,6 +239,7 @@ static void gmc_v7_0_vram_gtt_location(struct amdgpu_device *adev,
 
        base <<= 24;
 
+       amdgpu_gmc_set_agp_default(adev, mc);
        amdgpu_gmc_vram_location(adev, mc, base);
        amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
 }
index fa59749c2aefa63c91d1b82c8339890725a6a5ae..ff4ae73d27ecd26aaf399bdfe158e22c1de3009f 100644 (file)
@@ -413,6 +413,7 @@ static void gmc_v8_0_vram_gtt_location(struct amdgpu_device *adev,
                base = RREG32(mmMC_VM_FB_LOCATION) & 0xFFFF;
        base <<= 24;
 
+       amdgpu_gmc_set_agp_default(adev, mc);
        amdgpu_gmc_vram_location(adev, mc, base);
        amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
 }
index b66c5f7e1c56572e183f3aed4ffd105526c26f98..fe52d132b629a5cc1d76500277dce4355fb9e417 100644 (file)
@@ -1614,6 +1614,8 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
 {
        u64 base = adev->mmhub.funcs->get_fb_location(adev);
 
+       amdgpu_gmc_set_agp_default(adev, mc);
+
        /* add the xgmi offset of the physical node */
        base += adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size;
        if (adev->gmc.xgmi.connected_to_cpu) {