Commit 9b259eae authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: drop unnecessary wrappers around clock retrieving

By calling the target APIs directly.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ec114eb4
......@@ -661,7 +661,7 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
switch (type) {
case SMU_SCLK:
ret = smu_get_current_clk_freq(smu, SMU_GFXCLK, &now);
ret = smu_v11_0_get_current_clk_freq(smu, SMU_GFXCLK, &now);
if (ret) {
dev_err(smu->adev->dev, "Attempt to get current gfx clk Failed!");
return ret;
......@@ -688,7 +688,7 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
break;
case SMU_MCLK:
ret = smu_get_current_clk_freq(smu, SMU_UCLK, &now);
ret = smu_v11_0_get_current_clk_freq(smu, SMU_UCLK, &now);
if (ret) {
dev_err(smu->adev->dev, "Attempt to get current mclk Failed!");
return ret;
......@@ -711,7 +711,7 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
break;
case SMU_SOCCLK:
ret = smu_get_current_clk_freq(smu, SMU_SOCCLK, &now);
ret = smu_v11_0_get_current_clk_freq(smu, SMU_SOCCLK, &now);
if (ret) {
dev_err(smu->adev->dev, "Attempt to get current socclk Failed!");
return ret;
......@@ -734,7 +734,7 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
break;
case SMU_FCLK:
ret = smu_get_current_clk_freq(smu, SMU_FCLK, &now);
ret = smu_v11_0_get_current_clk_freq(smu, SMU_FCLK, &now);
if (ret) {
dev_err(smu->adev->dev, "Attempt to get current fclk Failed!");
return ret;
......@@ -2597,7 +2597,6 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
.get_enabled_mask = smu_v11_0_get_enabled_mask,
.notify_display_change = NULL,
.set_power_limit = smu_v11_0_set_power_limit,
.get_current_clk_freq = smu_v11_0_get_current_clk_freq,
.init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
.enable_thermal_alert = smu_v11_0_enable_thermal_alert,
.disable_thermal_alert = smu_v11_0_disable_thermal_alert,
......
......@@ -521,7 +521,6 @@ struct pptable_funcs {
int (*get_enabled_mask)(struct smu_context *smu, uint32_t *feature_mask, uint32_t num);
int (*notify_display_change)(struct smu_context *smu);
int (*set_power_limit)(struct smu_context *smu, uint32_t n);
int (*get_current_clk_freq)(struct smu_context *smu, enum smu_clk_type clk_id, uint32_t *value);
int (*init_max_sustainable_clocks)(struct smu_context *smu);
int (*enable_thermal_alert)(struct smu_context *smu);
int (*disable_thermal_alert)(struct smu_context *smu);
......
......@@ -877,7 +877,7 @@ static int navi10_print_clk_levels(struct smu_context *smu,
case SMU_UCLK:
case SMU_FCLK:
case SMU_DCEFCLK:
ret = smu_get_current_clk_freq(smu, clk_type, &cur_value);
ret = smu_v11_0_get_current_clk_freq(smu, clk_type, &cur_value);
if (ret)
return size;
......@@ -2438,7 +2438,6 @@ static const struct pptable_funcs navi10_ppt_funcs = {
.get_enabled_mask = smu_v11_0_get_enabled_mask,
.notify_display_change = smu_v11_0_notify_display_change,
.set_power_limit = smu_v11_0_set_power_limit,
.get_current_clk_freq = smu_v11_0_get_current_clk_freq,
.init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
.enable_thermal_alert = smu_v11_0_enable_thermal_alert,
.disable_thermal_alert = smu_v11_0_disable_thermal_alert,
......
......@@ -953,7 +953,6 @@ static const struct pptable_funcs renoir_ppt_funcs = {
.fini_smc_tables = smu_v12_0_fini_smc_tables,
.set_default_dpm_table = smu_v12_0_set_default_dpm_tables,
.get_enabled_mask = smu_v12_0_get_enabled_mask,
.get_current_clk_freq = smu_v12_0_get_current_clk_freq,
.get_dpm_ultimate_freq = smu_v12_0_get_dpm_ultimate_freq,
.mode2_reset = smu_v12_0_mode2_reset,
.set_soft_freq_limited_range = smu_v12_0_set_soft_freq_limited_range,
......
......@@ -781,7 +781,7 @@ static int sienna_cichlid_print_clk_levels(struct smu_context *smu,
case SMU_UCLK:
case SMU_FCLK:
case SMU_DCEFCLK:
ret = smu_get_current_clk_freq(smu, clk_type, &cur_value);
ret = smu_v11_0_get_current_clk_freq(smu, clk_type, &cur_value);
if (ret)
goto print_clk_out;
......@@ -2517,7 +2517,6 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = {
.get_enabled_mask = smu_v11_0_get_enabled_mask,
.notify_display_change = NULL,
.set_power_limit = smu_v11_0_set_power_limit,
.get_current_clk_freq = smu_v11_0_get_current_clk_freq,
.init_max_sustainable_clocks = smu_v11_0_init_max_sustainable_clocks,
.enable_thermal_alert = smu_v11_0_enable_thermal_alert,
.disable_thermal_alert = smu_v11_0_disable_thermal_alert,
......
......@@ -59,7 +59,6 @@
#define smu_set_default_dpm_table(smu) smu_ppt_funcs(set_default_dpm_table, 0, smu)
#define smu_populate_umd_state_clk(smu) smu_ppt_funcs(populate_umd_state_clk, 0, smu)
#define smu_set_default_od8_settings(smu) smu_ppt_funcs(set_default_od8_settings, 0, smu)
#define smu_get_current_clk_freq(smu, clk_id, value) smu_ppt_funcs(get_current_clk_freq, 0, smu, clk_id, value)
#define smu_tables_init(smu, tab) smu_ppt_funcs(tables_init, 0, smu, tab)
#define smu_set_thermal_fan_table(smu) smu_ppt_funcs(set_thermal_fan_table, 0, smu)
#define smu_enable_thermal_alert(smu) smu_ppt_funcs(enable_thermal_alert, 0, smu)
......
......@@ -1183,11 +1183,11 @@ int smu_v11_0_read_sensor(struct smu_context *smu,
switch (sensor) {
case AMDGPU_PP_SENSOR_GFX_MCLK:
ret = smu_get_current_clk_freq(smu, SMU_UCLK, (uint32_t *)data);
ret = smu_v11_0_get_current_clk_freq(smu, SMU_UCLK, (uint32_t *)data);
*size = 4;
break;
case AMDGPU_PP_SENSOR_GFX_SCLK:
ret = smu_get_current_clk_freq(smu, SMU_GFXCLK, (uint32_t *)data);
ret = smu_v11_0_get_current_clk_freq(smu, SMU_GFXCLK, (uint32_t *)data);
*size = 4;
break;
case AMDGPU_PP_SENSOR_VDDGFX:
......
......@@ -214,11 +214,11 @@ int smu_v12_0_read_sensor(struct smu_context *smu,
switch (sensor) {
case AMDGPU_PP_SENSOR_GFX_MCLK:
ret = smu_get_current_clk_freq(smu, SMU_UCLK, (uint32_t *)data);
ret = smu_v12_0_get_current_clk_freq(smu, SMU_UCLK, (uint32_t *)data);
*size = 4;
break;
case AMDGPU_PP_SENSOR_GFX_SCLK:
ret = smu_get_current_clk_freq(smu, SMU_GFXCLK, (uint32_t *)data);
ret = smu_v12_0_get_current_clk_freq(smu, SMU_GFXCLK, (uint32_t *)data);
*size = 4;
break;
default:
......
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