Skip to contentSkip to conversation

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

PATCH In review Yuxian Dai 2 participants 3 messages Apr 15, 2020 – Apr 17, 2020

Subsystems (2)
lore
Share & tools
lore

Yuxian Dai

author
#0 lore raw

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

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

Change-Id Ib66d0cf34a866fa6f0cedd1d5fc642f59236787d
---
 drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +2 -0
index 281b7b6cf1a4..e4e7a352d032 100644
@@ -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)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Yuxian Dai

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

Change-Id Ib66d0cf34a866fa6f0cedd1d5fc642f59236787d

Please add comment in the commit message to explain some asic only have 2 level, and cause the invalid level as 0.

With that fixed, patch is

Quoted 24 lines
---
 drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +2 -0
index 281b7b6cf1a4..e4e7a352d032 100644
@@ -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)
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cray.huang%40amd.com%7C4858c507c09943274af508d7e12f15a1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637225464660212899&amp;sdata=eNcYS0dWUHPpQQXPHD6M5%2BqRI8dj1OC2auB0ZQB9Rgs%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

author Reviewed-by Huang Rui
#2 lore raw

[AMD Official Use Only - Internal Distribution Only]

Quoted 5 lines · Yuxian Dai

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

Change-Id Ib66d0cf34a866fa6f0cedd1d5fc642f59236787d

Please add comment in the commit message to explain some asic only have 2 level, and cause the invalid level as 0.

With that fixed, patch is

Quoted 1 line

ok

Quoted 22 lines
---
 drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/powerplay/renoir_ppt.c +2 -0
index 281b7b6cf1a4..e4e7a352d032 100644
@@ -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

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cra y.huang%40amd.com%7C4858c507c09943274af508d7e12f15a1%7C3dd8961fe4884e6 08e11a82d994e183d%7C0%7C0%7C637225464660212899&amp;sdata=eNcYS0dWUHPpQ QXPHD6M5%2BqRI8dj1OC2auB0ZQB9Rgs%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx