Skip to contentSkip to conversation

drm/amd/pm: Report uclk and sclk limit

PATCH In review Asad Kamal 1 participant 2 messages Apr 2, 2024

Subsystems (3)
lore
Share & tools
lore

Asad Kamal

author
#0 lore raw

PATCH 1/1 drm/amd/pm: Report uclk and sclk limit

Report max set uclk and sclk for smu_v_13_0_6

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c   | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +10 -4
index 575292314f57..f81096bfbf2c 100644
@@ -1010,8 +1010,11 @@ static int smu_v13_0_6_print_clk_levels(struct smu_context *smu,
 
 	switch (type) {
 	case SMU_OD_SCLK:
-		size += sysfs_emit_at(buf, size, "%s:\n", "GFXCLK");
-		fallthrough;
+		size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
+		size += sysfs_emit_at(buf, size, "0: %uMhz\n1: %uMhz\n",
+				      pstate_table->gfxclk_pstate.curr.min,
+				      pstate_table->gfxclk_pstate.curr.max);
+		break;
 	case SMU_SCLK:
 		ret = smu_v13_0_6_get_current_clk_freq_by_table(smu, SMU_GFXCLK,
 								&now);
@@ -1052,8 +1055,11 @@ static int smu_v13_0_6_print_clk_levels(struct smu_context *smu,
 		break;
 
 	case SMU_OD_MCLK:
-		size += sysfs_emit_at(buf, size, "%s:\n", "MCLK");
-		fallthrough;
+		size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
+		size += sysfs_emit_at(buf, size, "0: %uMhz\n1: %uMhz\n",
+				      pstate_table->uclk_pstate.curr.min,
+				      pstate_table->uclk_pstate.curr.max);
+		break;
 	case SMU_MCLK:
 		ret = smu_v13_0_6_get_current_clk_freq_by_table(smu, SMU_UCLK,
 								&now);
Signature · 1 line
2.42.0
#1 lore raw

[AMD Official Use Only - General]

Please ignore this patch will send a fresh one

-----Original Message-----
From: Kamal, Asad <[email protected]>
Sent: Tuesday, April 2, 2024 3:45 PM
To: [email protected]
Cc: Lazar, Lijo <[email protected]>; Zhang, Hawking <[email protected]>; Ma, Le <[email protected]>; Zhang, Morris <[email protected]>; Kamal, Asad <[email protected]>; Cheung, Donald <[email protected]>; Khatir, Sepehr <[email protected]>; Oliveira, Daniel <[email protected]>; Poag, Charis <[email protected]>; Liu, Shuzhou (Bill) <[email protected]>
Subject: [PATCH] drm/amd/pm: Report uclk and sclk limit

Report max set uclk and sclk for smu_v_13_0_6

---
 .../gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c   | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +10 -4
index 575292314f57..f81096bfbf2c 100644
@@ -1010,8 +1010,11 @@ static int smu_v13_0_6_print_clk_levels(struct smu_context *smu,
 
        switch (type) {
        case SMU_OD_SCLK:
-               size += sysfs_emit_at(buf, size, "%s:\n", "GFXCLK");
-               fallthrough;
+               size += sysfs_emit_at(buf, size, "%s:\n", "OD_SCLK");
+               size += sysfs_emit_at(buf, size, "0: %uMhz\n1: %uMhz\n",
+                                     pstate_table->gfxclk_pstate.curr.min,
+                                     pstate_table->gfxclk_pstate.curr.max);
+               break;
        case SMU_SCLK:
                ret = smu_v13_0_6_get_current_clk_freq_by_table(smu, SMU_GFXCLK,
                                                                &now);
@@ -1052,8 +1055,11 @@ static int smu_v13_0_6_print_clk_levels(struct smu_context *smu,
                break;
 
        case SMU_OD_MCLK:
-               size += sysfs_emit_at(buf, size, "%s:\n", "MCLK");
-               fallthrough;
+               size += sysfs_emit_at(buf, size, "%s:\n", "OD_MCLK");
+               size += sysfs_emit_at(buf, size, "0: %uMhz\n1: %uMhz\n",
+                                     pstate_table->uclk_pstate.curr.min,
+                                     pstate_table->uclk_pstate.curr.max);
+               break;
        case SMU_MCLK:
                ret = smu_v13_0_6_get_current_clk_freq_by_table(smu, SMU_UCLK,
                                                                &now);

--
2.42.0