summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorLi Ma <li.ma@amd.com>2023-10-24 18:28:24 +0800
committerAlex Deucher <alexander.deucher@amd.com>2023-10-26 19:04:45 -0400
commitf0b8f65b482548c9d1d87c20fa4850c61305ff47 (patch)
treed4eb4aaf203cffec741427702e2e1997ace1e356 /drivers/gpu/drm
parentd055714a21cc0287c7e1b15c355795c42fb3a5cf (diff)
downloadlinux-stable-f0b8f65b482548c9d1d87c20fa4850c61305ff47.tar.gz
linux-stable-f0b8f65b482548c9d1d87c20fa4850c61305ff47.tar.bz2
linux-stable-f0b8f65b482548c9d1d87c20fa4850c61305ff47.zip
drm/amd/amdgpu: fix the GPU power print error in pm info
Modify the print format of the fractional part to avoid display error. Signed-off-by: Li Ma <li.ma@amd.com> Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/pm/amdgpu_pm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index 358bb5e485f2..517b9fb4624c 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -4290,10 +4290,10 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a
seq_printf(m, "\t%u mV (VDDNB)\n", value);
size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_AVG_POWER, (void *)&query, &size))
- seq_printf(m, "\t%u.%u W (average GPU)\n", query >> 8, query & 0xff);
+ seq_printf(m, "\t%u.%02u W (average GPU)\n", query >> 8, query & 0xff);
size = sizeof(uint32_t);
if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_INPUT_POWER, (void *)&query, &size))
- seq_printf(m, "\t%u.%u W (current GPU)\n", query >> 8, query & 0xff);
+ seq_printf(m, "\t%u.%02u W (current GPU)\n", query >> 8, query & 0xff);
size = sizeof(value);
seq_printf(m, "\n");