diff options
| author | Eric Huang <[email protected]> | 2017-01-24 21:59:27 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2017-03-30 03:52:53 +0000 |
| commit | 4f9afc9bd23fce85f2022af50d0127a64121bb37 (patch) | |
| tree | a8ce6bdc1230be1f5405f2f4f6266addab7e14c3 /drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |
| parent | drm/amd/powerplay: change parameter type pointer from int32_t to void in read... (diff) | |
| download | kernel-4f9afc9bd23fce85f2022af50d0127a64121bb37.tar.gz kernel-4f9afc9bd23fce85f2022af50d0127a64121bb37.zip | |
drm/amd/powerplay: add power consumption display support in debugfs
The additional output are:
vddc power in Watt;
vddci power in Watt;
max gpu power in Watt;
average gpu power in Watt.
Signed-off-by: Eric Huang <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index fc4d61cf34c1..8a9a75a44b62 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c @@ -1533,6 +1533,7 @@ void amdgpu_pm_compute_clocks(struct amdgpu_device *adev) static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *adev) { uint32_t value; + struct pp_gpu_power query = {0}; /* sanity check PP is enabled */ if (!(adev->powerplay.pp_funcs && @@ -1549,6 +1550,16 @@ static int amdgpu_debugfs_pm_info_pp(struct seq_file *m, struct amdgpu_device *a seq_printf(m, "\t%u mV (VDDGFX)\n", value); if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_VDDNB, (void *)&value)) seq_printf(m, "\t%u mV (VDDNB)\n", value); + if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_GPU_POWER, (void *)&query)) { + seq_printf(m, "\t%u.%u W (VDDC)\n", query.vddc_power >> 8, + query.vddc_power & 0xff); + seq_printf(m, "\t%u.%u W (VDDCI)\n", query.vddci_power >> 8, + query.vddci_power & 0xff); + seq_printf(m, "\t%u.%u W (max GPU)\n", query.max_gpu_power >> 8, + query.max_gpu_power & 0xff); + seq_printf(m, "\t%u.%u W (average GPU)\n", query.average_gpu_power >> 8, + query.average_gpu_power & 0xff); + } seq_printf(m, "\n"); /* GPU Temp */ |
