On 2/7/2024 2:03 PM, Kenneth Feng wrote:
> denote S to the actual clock in smu v13.0.0/v13.0.7/v13.0.10
> 
> Signed-off-by: Kenneth Feng <[email protected]>
> ---
>  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 12 ++++++------
>  drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 12 ++++++------
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
> index 2e7518f4ae1a..63a930c4da01 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
> @@ -1270,18 +1270,18 @@ static int smu_v13_0_0_print_clk_levels(struct 
> smu_context *smu,
>                        *   - level 1 -> max clock freq
>                        * And the current clock frequency can be any value 
> between them.
>                        * So, if the current clock frequency is not at level 0 
> or level 1,
> -                      * we will fake it as three dpm levels:
> +                      * we will denote it to S:
> +                      *   - level S -> current actual clock freq

S is not used to indicate actual clock always.

'S' is only used to indicate the "deep sleep state" of the clock. If the
clock is at deep sleep frequency ex: 95MHz, it's indicated by special
level S.

S:95Mhz*
0:500Mhz
1:1900Mhz

If the clock is active and operating as normal ex:1120MHz, the level is
not indicated by S. Sample values at that state will be

0:500Mhz
1:1120Mhz*
2:1900Mhz

Thanks,
Lijo

>                        *   - level 0 -> min clock freq
> -                      *   - level 1 -> current actual clock freq
> -                      *   - level 2 -> max clock freq
> +                      *   - level 1 -> max clock freq
>                        */
>                       if ((single_dpm_table->dpm_levels[0].value != 
> curr_freq) &&
>                            (single_dpm_table->dpm_levels[1].value != 
> curr_freq)) {
> +                             size += sysfs_emit_at(buf, size, "S: %uMhz *\n",
> +                                             curr_freq);
>                               size += sysfs_emit_at(buf, size, "0: %uMhz\n",
>                                               
> single_dpm_table->dpm_levels[0].value);
> -                             size += sysfs_emit_at(buf, size, "1: %uMhz *\n",
> -                                             curr_freq);
> -                             size += sysfs_emit_at(buf, size, "2: %uMhz\n",
> +                             size += sysfs_emit_at(buf, size, "1: %uMhz\n",
>                                               
> single_dpm_table->dpm_levels[1].value);
>                       } else {
>                               size += sysfs_emit_at(buf, size, "0: %uMhz 
> %s\n",
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c 
> b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
> index 0ffdb58af74e..dbdb50173de7 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
> @@ -1259,18 +1259,18 @@ static int smu_v13_0_7_print_clk_levels(struct 
> smu_context *smu,
>                        *   - level 1 -> max clock freq
>                        * And the current clock frequency can be any value 
> between them.
>                        * So, if the current clock frequency is not at level 0 
> or level 1,
> -                      * we will fake it as three dpm levels:
> +                      * we will denote it to S:
> +                      *   - level S -> current actual clock freq
>                        *   - level 0 -> min clock freq
> -                      *   - level 1 -> current actual clock freq
> -                      *   - level 2 -> max clock freq
> +                      *   - level 1 -> max clock freq
>                        */
>                       if ((single_dpm_table->dpm_levels[0].value != 
> curr_freq) &&
>                            (single_dpm_table->dpm_levels[1].value != 
> curr_freq)) {
> +                             size += sysfs_emit_at(buf, size, "S: %uMhz *\n",
> +                                             curr_freq);
>                               size += sysfs_emit_at(buf, size, "0: %uMhz\n",
>                                               
> single_dpm_table->dpm_levels[0].value);
> -                             size += sysfs_emit_at(buf, size, "1: %uMhz *\n",
> -                                             curr_freq);
> -                             size += sysfs_emit_at(buf, size, "2: %uMhz\n",
> +                             size += sysfs_emit_at(buf, size, "1: %uMhz\n",
>                                               
> single_dpm_table->dpm_levels[1].value);
>                       } else {
>                               size += sysfs_emit_at(buf, size, "0: %uMhz 
> %s\n",

Reply via email to