Skip to contentSkip to conversation

drm/amd/powerplay: correct current clock level label for Arcturus

PATCH In review Quan, Evan 2 participants 2 messages Oct 24, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Quan, Evan

author
#0 lore raw

PATCH 1/1 drm/amd/powerplay: correct current clock level label for Arcturus

For dpm disabled case, it's assumed the only one support clock level is always current clock level.

Change-Id I5cc2b7e82af888dc5e8268597ee761e9e1a26855
---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 24 +++++++++++++-------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +16 -8
index 1bcc5ab2873d..fcc9b6d24e8e 100644
@@ -670,12 +670,17 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
 			return ret;
 		}
 
+		/*
+		 * For DPM disabled case, there will be only one clock level.
+		 * And it's safe to assume that is always the current clock.
+		 */
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n", i,
 					clocks.data[i].clocks_in_khz / 1000,
-					arcturus_freqs_in_same_level(
+					(clocks.num_levels == 1) ? "*" :
+					(arcturus_freqs_in_same_level(
 					clocks.data[i].clocks_in_khz / 1000,
-					now / 100) ? "*" : "");
+					now / 100) ? "*" : ""));
 		break;
 
 	case SMU_MCLK:
@@ -695,9 +700,10 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, clocks.data[i].clocks_in_khz / 1000,
-				arcturus_freqs_in_same_level(
+				(clocks.num_levels == 1) ? "*" :
+				(arcturus_freqs_in_same_level(
 				clocks.data[i].clocks_in_khz / 1000,
-				now / 100) ? "*" : "");
+				now / 100) ? "*" : ""));
 		break;
 
 	case SMU_SOCCLK:
@@ -717,9 +723,10 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, clocks.data[i].clocks_in_khz / 1000,
-				arcturus_freqs_in_same_level(
+				(clocks.num_levels == 1) ? "*" :
+				(arcturus_freqs_in_same_level(
 				clocks.data[i].clocks_in_khz / 1000,
-				now / 100) ? "*" : "");
+				now / 100) ? "*" : ""));
 		break;
 
 	case SMU_FCLK:
@@ -739,9 +746,10 @@ static int arcturus_print_clk_levels(struct smu_context *smu,
 		for (i = 0; i < single_dpm_table->count; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, single_dpm_table->dpm_levels[i].value,
-				arcturus_freqs_in_same_level(
+				(clocks.num_levels == 1) ? "*" :
+				(arcturus_freqs_in_same_level(
 				clocks.data[i].clocks_in_khz / 1000,
-				now / 100) ? "*" : "");
+				now / 100) ? "*" : ""));
 		break;
 
 	default:
Signature · 6 lines
2.23.0

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

A message that is not in the archive (sent off-list or not yet received): [email protected]

Acked-by Alex Deucher
#2 lore raw
Quoted 9 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Quan, Evan
Sent: Thursday, October 24, 2019 2:25 AM
To: [email protected]
Cc: Li, Candice <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/powerplay: correct current clock level label for Arcturus

Quoted 5 lines

For dpm disabled case, it's assumed the only one support clock level is always current clock level.

Change-Id I5cc2b7e82af888dc5e8268597ee761e9e1a26855
Quoted 76 lines
---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 24 +++++++++++++------
(quoted diff) +0 -1
-
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +7 -2
index 1bcc5ab2873d..fcc9b6d24e8e 100644
@@ -670,12 +670,17 @@ static int arcturus_print_clk_levels(struct
 smu_context *smu,
 			return ret;
 		}
 
+		/*
+		 * For DPM disabled case, there will be only one clock level.
+		 * And it's safe to assume that is always the current clock.
+		 */
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n", i,
 					clocks.data[i].clocks_in_khz / 1000,
-					arcturus_freqs_in_same_level(
+					(clocks.num_levels == 1) ? "*" :
+					(arcturus_freqs_in_same_level(
 					clocks.data[i].clocks_in_khz / 1000,
-					now / 100) ? "*" : "");
+					now / 100) ? "*" : ""));
 		break;
 
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +3 -2
 	case SMU_MCLK:
@@ -695,9 +700,10 @@ static int arcturus_print_clk_levels(struct
 smu_context *smu,
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, clocks.data[i].clocks_in_khz / 1000,
-				arcturus_freqs_in_same_level(
+				(clocks.num_levels == 1) ? "*" :
+				(arcturus_freqs_in_same_level(
 				clocks.data[i].clocks_in_khz / 1000,
-				now / 100) ? "*" : "");
+				now / 100) ? "*" : ""));
 		break;
 
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +3 -2
 	case SMU_SOCCLK:
@@ -717,9 +723,10 @@ static int arcturus_print_clk_levels(struct
 smu_context *smu,
 		for (i = 0; i < clocks.num_levels; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, clocks.data[i].clocks_in_khz / 1000,
-				arcturus_freqs_in_same_level(
+				(clocks.num_levels == 1) ? "*" :
+				(arcturus_freqs_in_same_level(
 				clocks.data[i].clocks_in_khz / 1000,
-				now / 100) ? "*" : "");
+				now / 100) ? "*" : ""));
 		break;
 
drivers/gpu/drm/amd/powerplay/arcturus_ppt.c +3 -2
 	case SMU_FCLK:
@@ -739,9 +746,10 @@ static int arcturus_print_clk_levels(struct
 smu_context *smu,
 		for (i = 0; i < single_dpm_table->count; i++)
 			size += sprintf(buf + size, "%d: %uMhz %s\n",
 				i, single_dpm_table->dpm_levels[i].value,
-				arcturus_freqs_in_same_level(
+				(clocks.num_levels == 1) ? "*" :
+				(arcturus_freqs_in_same_level(
 				clocks.data[i].clocks_in_khz / 1000,
-				now / 100) ? "*" : "");
+				now / 100) ? "*" : ""));
 		break;
 

default:
--
2.23.0

Quoted 4 lines

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

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