summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/pm/swsmu
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2024-01-11 15:28:53 +0530
committerAlex Deucher <alexander.deucher@amd.com>2024-01-15 18:33:08 -0500
commita992c90d8ed3929b70ae815ce21ca5651cc0a692 (patch)
tree84b8fad8d35fc7689edb7e195b30a9311a9c124d /drivers/gpu/drm/amd/pm/swsmu
parent91739a897c12dcec699e53f390be1b4abdeef3a0 (diff)
downloadlinux-stable-a992c90d8ed3929b70ae815ce21ca5651cc0a692.tar.gz
linux-stable-a992c90d8ed3929b70ae815ce21ca5651cc0a692.tar.bz2
linux-stable-a992c90d8ed3929b70ae815ce21ca5651cc0a692.zip
drm/amd/pm: Fix smuv13.0.6 current clock reporting
When current clock is equal to max dpm level clock, the level is not indicated correctly with *. Fix by comparing current clock against dpm level value. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org # 6.7.x
Diffstat (limited to 'drivers/gpu/drm/amd/pm/swsmu')
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
index 7513d1cfeebd..a28649f21093 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c
@@ -970,7 +970,9 @@ static int smu_v13_0_6_print_clks(struct smu_context *smu, char *buf, int size,
if (i < (clocks.num_levels - 1))
clk2 = clocks.data[i + 1].clocks_in_khz / 1000;
- if (curr_clk >= clk1 && curr_clk < clk2) {
+ if (curr_clk == clk1) {
+ level = i;
+ } else if (curr_clk >= clk1 && curr_clk < clk2) {
level = (curr_clk - clk1) <= (clk2 - curr_clk) ?
i :
i + 1;