drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume
Subsystems (3)
PATCH v2 1/1 drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume
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.
---v1->v2:
- Move s0ix check into SMU12.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ++----- drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -5
@@ -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 ;
drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +2 -1
@@ -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,
Signature · 1 line
2.17.1
[AMD Official Use Only]
Quoted 69 lines
-----Original Message-----
From: Liang, Prike <[email protected]>
Sent: Tuesday, December 14, 2021 11:17 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Huang, Ray <[email protected]>; Quan, Evan <[email protected]>; Limonciello, Mario <[email protected]>; Liang, Prike <[email protected]>
Subject: [PATCH v2] drm/amd/pm: skip setting gfx cgpg in the s0ix suspend- resumeIn 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 <[email protected]>---
v1->v2:
- Move s0ix check into SMU12.--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 7 ++----- drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-)drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2
-5@@ -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 ;drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +1
-1@@ -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. */
drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +1
-0+ if (!(smu->adev->pg_flags & AMD_PG_SUPPORT_GFX_PG) || smu-Quoted 1 line
adev->in_s0ix)drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c +0
-1return 0 ; return smu_cmn_send_smc_msg_with_param(smu, --2.17.1