Commit 8e33376b authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

drm/amd/powerplay: fix save dpm level error for smu

the save dpm level should be save previous dpm profile level,
should not modified by get dpm level function.
eg: default auto
1. auto -> standard ==> dpm_level = standard, save_dpm = auto.
2. standard -> auto ==> dpm_level = auto, save_dpm = standard.
Signed-off-by: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 42b3aa9a
......@@ -1448,17 +1448,16 @@ int smu_handle_task(struct smu_context *smu,
enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu)
{
struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
enum amd_dpm_forced_level level;
if (!smu_dpm_ctx->dpm_context)
return -EINVAL;
mutex_lock(&(smu->mutex));
if (smu_dpm_ctx->dpm_level != smu_dpm_ctx->saved_dpm_level) {
smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level;
}
level = smu_dpm_ctx->dpm_level;
mutex_unlock(&(smu->mutex));
return smu_dpm_ctx->dpm_level;
return level;
}
int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment