Skip to contentSkip to conversation

drm/amd/pm: fix debugfs pm_info output

PATCH In review Alex Deucher 2 participants 2 messages Aug 18, 2023 – Aug 21, 2023

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/pm: fix debugfs pm_info output

Print both input and avg power.

Fixes 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`")
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +3 -0
index 5b1d73b00ef7..1c3745b3ca85 100644
@@ -3471,6 +3471,9 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a
 	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);
+	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);
 	size = sizeof(value);
 	seq_printf(m, "\n");
 
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw

[Public]

Regards,
Guchun

Quoted 39 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, August 19, 2023 3:21 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amd/pm: fix debugfs pm_info output

Print both input and avg power.

Fixes 47f1724db4fe ("drm/amd: Introduce

AMDGPU_PP_SENSOR_GPU_INPUT_POWER")

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +0 -0
index 5b1d73b00ef7..1c3745b3ca85 100644
@@ -3471,6 +3471,9 @@ static int amdgpu_debugfs_pm_info_pp(struct

seq_file *m, struct amdgpu_device *a

      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);

drivers/gpu/drm/amd/pm/amdgpu_pm.c +2 -0
+     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);
      size = sizeof(value);
      seq_printf(m, "\n");

--
2.41.0