Skip to content

Commit

Permalink
drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume
Browse files Browse the repository at this point in the history
[ Upstream commit 8c45096 ]

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.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1712
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Prike Liang authored and gregkh committed Jan 11, 2022
1 parent 80f2290 commit fbabb82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
Expand Up @@ -1536,9 +1536,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;
}
Expand Down Expand Up @@ -1569,8 +1567,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;

Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
Expand Up @@ -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,
Expand Down

0 comments on commit fbabb82

Please sign in to comment.