drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume
authorPrike Liang <Prike.Liang@amd.com>
Mon, 13 Dec 2021 08:17:02 +0000 (16:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Dec 2021 18:34:14 +0000 (13:34 -0500)
In the s0ix entry need retain gfx in the gfxoff state,so here need't
set gfx cgpg in the S0ix suspend-resume process. Moreover move the S0ix
check into SMU12 can simplify the code condition check.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c

index 2d718c30c8eb3234c0a7f3a7b60927aa9f8fc529..af98fa140d83c02caaf81ca2da93c4b198a21b04 100644 (file)
@@ -1569,9 +1569,7 @@ static int smu_suspend(void *handle)
 
        smu->watermarks_bitmap &= ~(WATERMARKS_LOADED);
 
-       /* skip CGPG when in S0ix */
-       if (smu->is_apu && !adev->in_s0ix)
-               smu_set_gfx_cgpg(&adev->smu, false);
+       smu_set_gfx_cgpg(&adev->smu, false);
 
        return 0;
 }
@@ -1602,8 +1600,7 @@ static int smu_resume(void *handle)
                return ret;
        }
 
-       if (smu->is_apu)
-               smu_set_gfx_cgpg(&adev->smu, true);
+       smu_set_gfx_cgpg(&adev->smu, true);
 
        smu->disable_uclk_switch = 0;
 
index 43028f2cd28b5e57cda8d2a78294022c025b5318..9c91e79c955fb24b8905b8b913253580cd69f4c6 100644 (file)
@@ -120,7 +120,8 @@ int smu_v12_0_powergate_sdma(struct smu_context *smu, bool gate)
 
 int smu_v12_0_set_gfx_cgpg(struct smu_context *smu, bool enable)
 {
-       if (!(smu->adev->pg_flags & AMD_PG_SUPPORT_GFX_PG))
+       /* Until now the SMU12 only implemented for Renoir series so here neen't do APU check. */
+       if (!(smu->adev->pg_flags & AMD_PG_SUPPORT_GFX_PG) || smu->adev->in_s0ix)
                return 0;
 
        return smu_cmn_send_smc_msg_with_param(smu,