[PATCH 14/14] drm/amd/powerplay: drop unused APIs and parameters

Alex Deucher alexdeucher at gmail.com
Thu Jul 9 20:47:22 UTC 2020


On Fri, Jul 3, 2020 at 4:34 AM Evan Quan <evan.quan at amd.com> wrote:
>
> Leftover of previous performance level setting cleanups.
>
> Change-Id: Idddc4adce365b34eacbc13f75cc0629859c6d412
> Signed-off-by: Evan Quan <evan.quan at amd.com>

patches 5-10, 12-14:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c         | 12 ++++++------
>  drivers/gpu/drm/amd/powerplay/amdgpu_smu.c     |  9 +++------
>  drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 12 +-----------
>  drivers/gpu/drm/amd/powerplay/renoir_ppt.c     |  2 --
>  drivers/gpu/drm/amd/powerplay/smu_internal.h   |  5 -----
>  5 files changed, 10 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> index 26c8e39a78bd..c418613699ed 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> @@ -1105,7 +1105,7 @@ static ssize_t amdgpu_set_pp_dpm_sclk(struct device *dev,
>         }
>
>         if (is_support_sw_smu(adev))
> -               ret = smu_force_clk_levels(&adev->smu, SMU_SCLK, mask, true);
> +               ret = smu_force_clk_levels(&adev->smu, SMU_SCLK, mask);
>         else if (adev->powerplay.pp_funcs->force_clock_level)
>                 ret = amdgpu_dpm_force_clock_level(adev, PP_SCLK, mask);
>
> @@ -1173,7 +1173,7 @@ static ssize_t amdgpu_set_pp_dpm_mclk(struct device *dev,
>         }
>
>         if (is_support_sw_smu(adev))
> -               ret = smu_force_clk_levels(&adev->smu, SMU_MCLK, mask, true);
> +               ret = smu_force_clk_levels(&adev->smu, SMU_MCLK, mask);
>         else if (adev->powerplay.pp_funcs->force_clock_level)
>                 ret = amdgpu_dpm_force_clock_level(adev, PP_MCLK, mask);
>
> @@ -1241,7 +1241,7 @@ static ssize_t amdgpu_set_pp_dpm_socclk(struct device *dev,
>         }
>
>         if (is_support_sw_smu(adev))
> -               ret = smu_force_clk_levels(&adev->smu, SMU_SOCCLK, mask, true);
> +               ret = smu_force_clk_levels(&adev->smu, SMU_SOCCLK, mask);
>         else if (adev->powerplay.pp_funcs->force_clock_level)
>                 ret = amdgpu_dpm_force_clock_level(adev, PP_SOCCLK, mask);
>         else
> @@ -1311,7 +1311,7 @@ static ssize_t amdgpu_set_pp_dpm_fclk(struct device *dev,
>         }
>
>         if (is_support_sw_smu(adev))
> -               ret = smu_force_clk_levels(&adev->smu, SMU_FCLK, mask, true);
> +               ret = smu_force_clk_levels(&adev->smu, SMU_FCLK, mask);
>         else if (adev->powerplay.pp_funcs->force_clock_level)
>                 ret = amdgpu_dpm_force_clock_level(adev, PP_FCLK, mask);
>         else
> @@ -1381,7 +1381,7 @@ static ssize_t amdgpu_set_pp_dpm_dcefclk(struct device *dev,
>         }
>
>         if (is_support_sw_smu(adev))
> -               ret = smu_force_clk_levels(&adev->smu, SMU_DCEFCLK, mask, true);
> +               ret = smu_force_clk_levels(&adev->smu, SMU_DCEFCLK, mask);
>         else if (adev->powerplay.pp_funcs->force_clock_level)
>                 ret = amdgpu_dpm_force_clock_level(adev, PP_DCEFCLK, mask);
>         else
> @@ -1451,7 +1451,7 @@ static ssize_t amdgpu_set_pp_dpm_pcie(struct device *dev,
>         }
>
>         if (is_support_sw_smu(adev))
> -               ret = smu_force_clk_levels(&adev->smu, SMU_PCIE, mask, true);
> +               ret = smu_force_clk_levels(&adev->smu, SMU_PCIE, mask);
>         else if (adev->powerplay.pp_funcs->force_clock_level)
>                 ret = amdgpu_dpm_force_clock_level(adev, PP_PCIE, mask);
>         else
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> index 4080b3c792ac..38b3b47d12b7 100644
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
> @@ -1764,8 +1764,7 @@ int smu_set_display_count(struct smu_context *smu, uint32_t count)
>
>  int smu_force_clk_levels(struct smu_context *smu,
>                          enum smu_clk_type clk_type,
> -                        uint32_t mask,
> -                        bool lock_needed)
> +                        uint32_t mask)
>  {
>         struct smu_dpm_context *smu_dpm_ctx = &(smu->smu_dpm);
>         int ret = 0;
> @@ -1778,14 +1777,12 @@ int smu_force_clk_levels(struct smu_context *smu,
>                 return -EINVAL;
>         }
>
> -       if (lock_needed)
> -               mutex_lock(&smu->mutex);
> +       mutex_lock(&smu->mutex);
>
>         if (smu->ppt_funcs && smu->ppt_funcs->force_clk_levels)
>                 ret = smu->ppt_funcs->force_clk_levels(smu, clk_type, mask);
>
> -       if (lock_needed)
> -               mutex_unlock(&smu->mutex);
> +       mutex_unlock(&smu->mutex);
>
>         return ret;
>  }
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> index 91c8b69da026..470b0377a860 100644
> --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
> @@ -476,13 +476,6 @@ struct pptable_funcs {
>         int (*display_config_changed)(struct smu_context *smu);
>         int (*apply_clocks_adjust_rules)(struct smu_context *smu);
>         int (*notify_smc_display_config)(struct smu_context *smu);
> -       int (*force_dpm_limit_value)(struct smu_context *smu, bool highest);
> -       int (*unforce_dpm_levels)(struct smu_context *smu);
> -       int (*get_profiling_clk_mask)(struct smu_context *smu,
> -                                     enum amd_dpm_forced_level level,
> -                                     uint32_t *sclk_mask,
> -                                     uint32_t *mclk_mask,
> -                                     uint32_t *soc_mask);
>         int (*set_cpu_power_state)(struct smu_context *smu);
>         bool (*is_dpm_running)(struct smu_context *smu);
>         int (*tables_init)(struct smu_context *smu, struct smu_table *tables);
> @@ -498,8 +491,6 @@ struct pptable_funcs {
>         int (*display_disable_memory_clock_switch)(struct smu_context *smu, bool disable_memory_clock_switch);
>         void (*dump_pptable)(struct smu_context *smu);
>         int (*get_power_limit)(struct smu_context *smu);
> -       int (*get_dpm_clk_limited)(struct smu_context *smu, enum smu_clk_type clk_type,
> -                                  uint32_t dpm_level, uint32_t *freq);
>         int (*set_df_cstate)(struct smu_context *smu, enum pp_df_cstate state);
>         int (*allow_xgmi_power_down)(struct smu_context *smu, bool en);
>         int (*update_pcie_parameters)(struct smu_context *smu, uint32_t pcie_gen_cap, uint32_t pcie_width_cap);
> @@ -745,8 +736,7 @@ size_t smu_sys_get_pp_feature_mask(struct smu_context *smu, char *buf);
>  int smu_sys_set_pp_feature_mask(struct smu_context *smu, uint64_t new_mask);
>  int smu_force_clk_levels(struct smu_context *smu,
>                          enum smu_clk_type clk_type,
> -                        uint32_t mask,
> -                        bool lock_needed);
> +                        uint32_t mask);
>  int smu_set_mp1_state(struct smu_context *smu,
>                       enum pp_mp1_state mp1_state);
>  int smu_set_df_cstate(struct smu_context *smu,
> diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> index 5b76d67d03d7..866ae014eda2 100644
> --- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
> @@ -1041,13 +1041,11 @@ static const struct pptable_funcs renoir_ppt_funcs = {
>         .get_smu_table_index = renoir_get_smu_table_index,
>         .tables_init = renoir_tables_init,
>         .set_power_state = NULL,
> -       .get_dpm_clk_limited = renoir_get_dpm_clk_limited,
>         .print_clk_levels = renoir_print_clk_levels,
>         .get_current_power_state = renoir_get_current_power_state,
>         .dpm_set_vcn_enable = renoir_dpm_set_vcn_enable,
>         .dpm_set_jpeg_enable = renoir_dpm_set_jpeg_enable,
>         .get_workload_type = renoir_get_workload_type,
> -       .get_profiling_clk_mask = renoir_get_profiling_clk_mask,
>         .force_clk_levels = renoir_force_clk_levels,
>         .set_power_profile_mode = renoir_set_power_profile_mode,
>         .set_performance_level = renoir_set_performance_level,
> diff --git a/drivers/gpu/drm/amd/powerplay/smu_internal.h b/drivers/gpu/drm/amd/powerplay/smu_internal.h
> index 1b357e349d1e..6eb375af543d 100644
> --- a/drivers/gpu/drm/amd/powerplay/smu_internal.h
> +++ b/drivers/gpu/drm/amd/powerplay/smu_internal.h
> @@ -68,8 +68,6 @@
>  #define smu_display_config_changed(smu)                                        smu_ppt_funcs(display_config_changed, 0 , smu)
>  #define smu_apply_clocks_adjust_rules(smu)                             smu_ppt_funcs(apply_clocks_adjust_rules, 0, smu)
>  #define smu_notify_smc_display_config(smu)                             smu_ppt_funcs(notify_smc_display_config, 0, smu)
> -#define smu_force_dpm_limit_value(smu, highest)                                smu_ppt_funcs(force_dpm_limit_value, 0, smu, highest)
> -#define smu_unforce_dpm_levels(smu)                                    smu_ppt_funcs(unforce_dpm_levels, 0, smu)
>  #define smu_set_cpu_power_state(smu)                                   smu_ppt_funcs(set_cpu_power_state, 0, smu)
>  #define smu_msg_get_index(smu, msg)                                    smu_ppt_funcs(get_smu_msg_index, -EINVAL, smu, msg)
>  #define smu_clk_get_index(smu, clk)                                    smu_ppt_funcs(get_smu_clk_index, -EINVAL, smu, clk)
> @@ -92,7 +90,6 @@
>  #define smu_get_dpm_ultimate_freq(smu, param, min, max)                        smu_ppt_funcs(get_dpm_ultimate_freq, 0, smu, param, min, max)
>  #define smu_asic_set_performance_level(smu, level)                     smu_ppt_funcs(set_performance_level, -EINVAL, smu, level)
>  #define smu_dump_pptable(smu)                                          smu_ppt_funcs(dump_pptable, 0, smu)
> -#define smu_get_dpm_clk_limited(smu, clk_type, dpm_level, freq)                smu_ppt_funcs(get_dpm_clk_limited, -EINVAL, smu, clk_type, dpm_level, freq)
>  #define smu_override_pcie_parameters(smu)                              smu_ppt_funcs(override_pcie_parameters, 0, smu)
>  #define smu_update_pcie_parameters(smu, pcie_gen_cap, pcie_width_cap)  smu_ppt_funcs(update_pcie_parameters, 0, smu, pcie_gen_cap, pcie_width_cap)
>  #define smu_set_thermal_range(smu, range)                              smu_ppt_funcs(set_thermal_range, 0, smu, range)
> @@ -103,7 +100,5 @@
>  #define smu_get_unique_id(smu)                                         smu_ppt_funcs(get_unique_id, 0, smu)
>  #define smu_log_thermal_throttling(smu)                                        smu_ppt_funcs(log_thermal_throttling_event, 0, smu)
>  #define smu_get_asic_power_limits(smu)                                 smu_ppt_funcs(get_power_limit, 0, smu)
> -#define smu_get_profiling_clk_mask(smu, level, sclk_mask, mclk_mask, soc_mask) \
> -       smu_ppt_funcs(get_profiling_clk_mask, 0, smu, level, sclk_mask, mclk_mask, soc_mask)
>
>  #endif
> --
> 2.27.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list