summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2022-01-19 10:51:23 +0800
committerAlex Deucher <alexander.deucher@amd.com>2022-02-16 16:57:34 -0500
commitb874c6671b911ffab69f70b298d074a1897b8aff (patch)
tree270b26678598e34c29f47d3873318ae258ccddbf /drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
parent92ede25eceb251ec31e1599065b98d681a419046 (diff)
drm/amd/pm: correct the default DriverSmuConfig table settings
For Some ASICs, with the PMFW default settings, we may see the power consumption reported via metrics table is "Very Erratic". With the socket power alpha filter set as 10/100ms, we can correct that issue. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index e846231412bc..6535cf336fa5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -609,6 +609,18 @@ err_out:
return ret;
}
+static int smu_apply_default_config_table_settings(struct smu_context *smu)
+{
+ struct amdgpu_device *adev = smu->adev;
+ int ret = 0;
+
+ ret = smu_get_default_config_table_settings(smu,
+ &adev->pm.config_table);
+ if (ret)
+ return ret;
+
+ return smu_set_config_table(smu, &adev->pm.config_table);
+}
static int smu_late_init(void *handle)
{
@@ -663,6 +675,12 @@ static int smu_late_init(void *handle)
smu->smu_dpm.dpm_level,
AMD_PP_TASK_COMPLETE_INIT);
+ ret = smu_apply_default_config_table_settings(smu);
+ if (ret && (ret != -EOPNOTSUPP)) {
+ dev_err(adev->dev, "Failed to apply default DriverSmuConfig settings!\n");
+ return ret;
+ }
+
smu_restore_dpm_user_profile(smu);
return 0;