Skip to content

Commit 022ac4c

Browse files
Yuxian Daialexdeucher
authored andcommitted
drm/amdgpu/powerplay: using the FCLK DPM table to set the MCLK
1.Using the FCLK DPM table to set the MCLK for DPM states consist of three entities: FCLK UCLK MEMCLK All these three clk change together, MEMCLK from FCLK, so use the fclk frequency. 2.we should show the current working clock freqency from clock table metric Signed-off-by: Yuxian Dai <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Reviewed-by: Huang Rui <[email protected]> Reviewed-by: Kevin Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 3148a6a commit 022ac4c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ static int renoir_print_clk_levels(struct smu_context *smu,
239239
uint32_t cur_value = 0, value = 0, count = 0, min = 0, max = 0;
240240
DpmClocks_t *clk_table = smu->smu_table.clocks_table;
241241
SmuMetrics_t metrics;
242+
bool cur_value_match_level = false;
242243

243244
if (!clk_table || clk_type >= SMU_CLK_COUNT)
244245
return -EINVAL;
@@ -297,8 +298,13 @@ static int renoir_print_clk_levels(struct smu_context *smu,
297298
GET_DPM_CUR_FREQ(clk_table, clk_type, i, value);
298299
size += sprintf(buf + size, "%d: %uMhz %s\n", i, value,
299300
cur_value == value ? "*" : "");
301+
if (cur_value == value)
302+
cur_value_match_level = true;
300303
}
301304

305+
if (!cur_value_match_level)
306+
size += sprintf(buf + size, " %uMhz *\n", cur_value);
307+
302308
return size;
303309
}
304310

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern void renoir_set_ppt_funcs(struct smu_context *smu);
3737
freq = table->SocClocks[dpm_level].Freq; \
3838
break; \
3939
case SMU_MCLK: \
40-
freq = table->MemClocks[dpm_level].Freq; \
40+
freq = table->FClocks[dpm_level].Freq; \
4141
break; \
4242
case SMU_DCEFCLK: \
4343
freq = table->DcfClocks[dpm_level].Freq; \

0 commit comments

Comments
 (0)