[Public] This patch is:
Reviewed-by: Yifan Zhang <yifan1.zh...@amd.com> -----Original Message----- From: Ma, Li <li...@amd.com> Sent: Wednesday, October 25, 2023 10:31 AM To: amd-gfx@lists.freedesktop.org; Zhang, Yifan <yifan1.zh...@amd.com> Cc: Deucher, Alexander <alexander.deuc...@amd.com>; Feng, Kenneth <kenneth.f...@amd.com>; StDenis, Tom <tom.stde...@amd.com>; Ma, Li <li...@amd.com> Subject: [PATCH v2] 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...@amd.com> --- drivers/gpu/drm/amd/pm/amdgpu_pm.c | 4 ++-- 1 file 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"); -- 2.25.1