[PATCH] drm/amdgpu/powerplay:avoid to show invalid DPM table info

Yuxian Dai Yuxian.Dai at amd.com
Wed Apr 15 11:20:31 UTC 2020


we should avoid to show the invalid level value when the
DPM_LEVELS supported number changed

Signed-off-by: Yuxian Dai <Yuxian.Dai at amd.com>
Change-Id: Ib66d0cf34a866fa6f0cedd1d5fc642f59236787d
---
 drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
index 281b7b6cf1a4..e4e7a352d032 100644
--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
@@ -296,6 +296,8 @@ static int renoir_print_clk_levels(struct smu_context *smu,
 
 	for (i = 0; i < count; i++) {
 		GET_DPM_CUR_FREQ(clk_table, clk_type, i, value);
+		if (!value)
+			continue;
 		size += sprintf(buf + size, "%d: %uMhz %s\n", i, value,
 				cur_value == value ? "*" : "");
 		if (cur_value == value)
-- 
2.17.1



More information about the amd-gfx mailing list