]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/amd/pm: fix debugfs pm_info output
authorAlex Deucher <alexander.deucher@amd.com>
Fri, 18 Aug 2023 19:18:07 +0000 (15:18 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 31 Aug 2023 22:02:30 +0000 (18:02 -0400)
Print both input and avg power.

Fixes: 47f1724db4fe ("drm/amd: Introduce `AMDGPU_PP_SENSOR_GPU_INPUT_POWER`")
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/amdgpu_pm.c

index f03647fa3df634da3a5ffc840347ce5f52c15512..41147da54458943b4b70ae9664b3860b00193f68 100644 (file)
@@ -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");