mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
drm/amdgpu/swsmu: always force a state reprogram on init
commit d420c857d85777663e8d16adfc24463f5d5c2dbc upstream. Always reprogram the hardware state on init. This ensures the PMFW state is explicitly programmed and we are not relying on the default PMFW state. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3131 Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit c50fe289ed7207f71df3b5f1720512a9620e84fb) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6f492daa7d
commit
44e99078f6
@@ -1829,8 +1829,9 @@ static int smu_bump_power_profile_mode(struct smu_context *smu,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
||||||
enum amd_dpm_forced_level level,
|
enum amd_dpm_forced_level level,
|
||||||
bool skip_display_settings)
|
bool skip_display_settings,
|
||||||
|
bool force_update)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@@ -1859,7 +1860,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (smu_dpm_ctx->dpm_level != level) {
|
if (force_update || smu_dpm_ctx->dpm_level != level) {
|
||||||
ret = smu_asic_set_performance_level(smu, level);
|
ret = smu_asic_set_performance_level(smu, level);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(smu->adev->dev, "Failed to set performance level!");
|
dev_err(smu->adev->dev, "Failed to set performance level!");
|
||||||
@@ -1875,7 +1876,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
|
|||||||
index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;
|
index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;
|
||||||
workload[0] = smu->workload_setting[index];
|
workload[0] = smu->workload_setting[index];
|
||||||
|
|
||||||
if (smu->power_profile_mode != workload[0])
|
if (force_update || smu->power_profile_mode != workload[0])
|
||||||
smu_bump_power_profile_mode(smu, workload, 0);
|
smu_bump_power_profile_mode(smu, workload, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1896,11 +1897,13 @@ static int smu_handle_task(struct smu_context *smu,
|
|||||||
ret = smu_pre_display_config_changed(smu);
|
ret = smu_pre_display_config_changed(smu);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
ret = smu_adjust_power_state_dynamic(smu, level, false);
|
ret = smu_adjust_power_state_dynamic(smu, level, false, false);
|
||||||
break;
|
break;
|
||||||
case AMD_PP_TASK_COMPLETE_INIT:
|
case AMD_PP_TASK_COMPLETE_INIT:
|
||||||
|
ret = smu_adjust_power_state_dynamic(smu, level, true, true);
|
||||||
|
break;
|
||||||
case AMD_PP_TASK_READJUST_POWER_STATE:
|
case AMD_PP_TASK_READJUST_POWER_STATE:
|
||||||
ret = smu_adjust_power_state_dynamic(smu, level, true);
|
ret = smu_adjust_power_state_dynamic(smu, level, true, false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user