Skip to content

Commit 3c26d03

Browse files
committed
drm/amdgpu/swsmu/smu12: fix force clock handling for mclk
The state array is in the reverse order compared to other asics (high to low rather than low to high). Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1313 Reviewed-by: Prike Liang <Prike.Liang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent a39d0d7 commit 3c26d03

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

drivers/gpu/drm/amd/powerplay/renoir_ppt.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,16 @@ static int renoir_get_profiling_clk_mask(struct smu_context *smu,
232232
*sclk_mask = 0;
233233
} else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK) {
234234
if (mclk_mask)
235-
*mclk_mask = 0;
235+
/* mclk levels are in reverse order */
236+
*mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
236237
} else if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK) {
237238
if(sclk_mask)
238239
/* The sclk as gfxclk and has three level about max/min/current */
239240
*sclk_mask = 3 - 1;
240241

241242
if(mclk_mask)
242-
*mclk_mask = NUM_MEMCLK_DPM_LEVELS - 1;
243+
/* mclk levels are in reverse order */
244+
*mclk_mask = 0;
243245

244246
if(soc_mask)
245247
*soc_mask = NUM_SOCCLK_DPM_LEVELS - 1;
@@ -333,7 +335,7 @@ static int renoir_get_dpm_ultimate_freq(struct smu_context *smu,
333335
case SMU_UCLK:
334336
case SMU_FCLK:
335337
case SMU_MCLK:
336-
ret = renoir_get_dpm_clk_limited(smu, clk_type, 0, min);
338+
ret = renoir_get_dpm_clk_limited(smu, clk_type, NUM_MEMCLK_DPM_LEVELS - 1, min);
337339
if (ret)
338340
goto failed;
339341
break;

0 commit comments

Comments
 (0)