Skip to content

Commit 4e95269

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Restore cached manual clock settings during resume
If the SCLK limits have been set before S3 they will not be restored. The limits are however cached in the driver and so they can be restored by running a commit sequence during resume. Acked-by: Alex Deucher <alexander.deucher@amd.com> Link: https://lore.kernel.org/r/20250725031222.3015095-3-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 26a609e commit 4e95269

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ static void smu_power_profile_mode_get(struct smu_context *smu,
7777
static void smu_power_profile_mode_put(struct smu_context *smu,
7878
enum PP_SMC_POWER_PROFILE profile_mode);
7979
static enum smu_clk_type smu_convert_to_smuclk(enum pp_clock_type type);
80+
static int smu_od_edit_dpm_table(void *handle,
81+
enum PP_OD_DPM_TABLE_COMMAND type,
82+
long *input, uint32_t size);
8083

8184
static int smu_sys_get_pp_feature_mask(void *handle,
8285
char *buf)
@@ -2195,6 +2198,7 @@ static int smu_resume(struct amdgpu_ip_block *ip_block)
21952198
int ret;
21962199
struct amdgpu_device *adev = ip_block->adev;
21972200
struct smu_context *smu = adev->powerplay.pp_handle;
2201+
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
21982202

21992203
if (amdgpu_sriov_multi_vf_mode(adev))
22002204
return 0;
@@ -2232,6 +2236,12 @@ static int smu_resume(struct amdgpu_ip_block *ip_block)
22322236
return ret;
22332237
}
22342238

2239+
if (smu_dpm_ctx->dpm_level == AMD_DPM_FORCED_LEVEL_MANUAL) {
2240+
ret = smu_od_edit_dpm_table(smu, PP_OD_COMMIT_DPM_TABLE, NULL, 0);
2241+
if (ret)
2242+
return ret;
2243+
}
2244+
22352245
dev_info(adev->dev, "SMU is resumed successfully!\n");
22362246

22372247
return 0;

0 commit comments

Comments
 (0)