summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Heider <[email protected]>2018-10-27 09:45:37 +0200
committerMarek Olšák <[email protected]>2018-10-30 16:30:32 -0400
commit25a3ce97d5237659ceda50f54ac2623f974d8b7e (patch)
tree78bc17a158272a57c6eb0004d0a885bdf97d6296
parent5172eb231d9e9c632569426c7768d921e98d711f (diff)
gallium/hud: fix power sensor readings for amdgpu users
amdgpu doesn't use the INPUT but the AVERAGE subfeature: $ sensors -u amdgpu-pci-0100 Adapter: PCI adapter power1: power1_average: 17.233 power1_cap: 180.000 Signed-off-by: Andre Heider <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/auxiliary/hud/hud_sensors_temp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/hud/hud_sensors_temp.c b/src/gallium/auxiliary/hud/hud_sensors_temp.c
index c26e7b9b2a7..c226e89cc42 100644
--- a/src/gallium/auxiliary/hud/hud_sensors_temp.c
+++ b/src/gallium/auxiliary/hud/hud_sensors_temp.c
@@ -122,6 +122,9 @@ get_sensor_values(struct sensors_temp_info *sti)
case SENSORS_POWER_CURRENT:
sf = sensors_get_subfeature(sti->chip, sti->feature,
SENSORS_SUBFEATURE_POWER_INPUT);
+ if (!sf)
+ sf = sensors_get_subfeature(sti->chip, sti->feature,
+ SENSORS_SUBFEATURE_POWER_AVERAGE);
if (sf) {
/* Sensors API returns in WATTs, even though driver is reporting mW,
* convert back to mW */