Skip to content

Commit df0279e

Browse files
Tim Huangalexdeucher
authored andcommitted
drm/amd/pm: print pp_dpm_mclk in ascending order on SMU v14.0.0
Currently, the pp_dpm_mclk values are reported in descending order on SMU IP v14.0.0/1/4. Adjust to ascending order for consistency with other clock interfaces. Signed-off-by: Tim Huang <[email protected]> Reviewed-by: Yifan Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit d4be16c) Cc: [email protected]
1 parent d641a15 commit df0279e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ static int smu_v14_0_common_get_dpm_level_count(struct smu_context *smu,
11321132
static int smu_v14_0_0_print_clk_levels(struct smu_context *smu,
11331133
enum smu_clk_type clk_type, char *buf)
11341134
{
1135-
int i, size = 0, ret = 0;
1135+
int i, idx, ret = 0, size = 0;
11361136
uint32_t cur_value = 0, value = 0, count = 0;
11371137
uint32_t min, max;
11381138

@@ -1168,7 +1168,8 @@ static int smu_v14_0_0_print_clk_levels(struct smu_context *smu,
11681168
break;
11691169

11701170
for (i = 0; i < count; i++) {
1171-
ret = smu_v14_0_common_get_dpm_freq_by_index(smu, clk_type, i, &value);
1171+
idx = (clk_type == SMU_MCLK) ? (count - i - 1) : i;
1172+
ret = smu_v14_0_common_get_dpm_freq_by_index(smu, clk_type, idx, &value);
11721173
if (ret)
11731174
break;
11741175

0 commit comments

Comments
 (0)