blob: bf81b8bf68ebfb3f22d272bacc8b7a41fb990084 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
From 88722b18c92f3a688a69abef9022cbcdcb5163bb Mon Sep 17 00:00:00 2001
From: David Redondo <kde@david-redondo.de>
Date: Fri, 29 Apr 2022 13:59:38 +0200
Subject: [PATCH] Fall back to power average if input is not available
Some power sensors don't expose a current value most notably amdgpu.
For those fall back to the average reading if available.
BUG:445920
(cherry picked from commit 7758d202eed28169c031e099e408ea258469e408)
---
systemstats/SensorsFeatureSensor.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/systemstats/SensorsFeatureSensor.cpp b/systemstats/SensorsFeatureSensor.cpp
index 6c8bdb34..3555115f 100644
--- a/systemstats/SensorsFeatureSensor.cpp
+++ b/systemstats/SensorsFeatureSensor.cpp
@@ -95,6 +95,9 @@ makeSensorsFeatureSensor(const QString &id, const sensors_chip_name *const chipN
break;
case SENSORS_FEATURE_POWER:
valueFeature = sensors_get_subfeature(chipName, feature, SENSORS_SUBFEATURE_POWER_INPUT);
+ if (!valueFeature) {
+ valueFeature = sensors_get_subfeature(chipName, feature, SENSORS_SUBFEATURE_POWER_AVERAGE);
+ }
unit = UnitWatt;
maximum = getValueOfFirstExisting({SENSORS_SUBFEATURE_POWER_CRIT, SENSORS_SUBFEATURE_POWER_MAX});
break;
--
GitLab
|