]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/amd/pm: Report uclk/sclk current limits
authorAsad Kamal <asad.kamal@amd.com>
Tue, 2 Apr 2024 10:11:27 +0000 (18:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Apr 2024 02:10:44 +0000 (22:10 -0400)
Use OD (pp_od_clk_voltage) interface to report current limits,
default or those set by user, for SCLK and UCLK on smu_v_13_0_6

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c

index 7998c188db5ba5488b6493dd8828b726d1cfcf7b..56ed0cfb675e2fa66b7f7962af6e86feb65980d0 100644 (file)
@@ -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);