Commit 00f522a7 authored by Sandeep Raghuraman's avatar Sandeep Raghuraman Committed by Nate Graham

Add support for power sensors from lm-sensors

Summary:
Some AMD GPUs do report power which can be read by lm-sensors. This diff adds support for showing those power readings in ksysguard.

Note: SENSORS_SUBFEATURE_POWER_AVERAGE is checked as a backup, because AMDGPU reports power as an average and not as input.

Reviewers: mlaurent, davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28166
parent 404ea7e9
......@@ -140,6 +140,14 @@ void initLmSensors( struct SensorModul* sm )
ssubf = sensors_get_subfeature( scn, sf,
SENSORS_SUBFEATURE_TEMP_INPUT );
break;
case SENSORS_FEATURE_POWER:
ssubf = sensors_get_subfeature( scn, sf,
SENSORS_SUBFEATURE_POWER_INPUT );
if ( !ssubf )
ssubf = sensors_get_subfeature( scn, sf,
SENSORS_SUBFEATURE_POWER_AVERAGE );
break;
default:
ssubf = NULL;
}
......@@ -290,6 +298,8 @@ void printLmSensorInfo( const char* cmd )
output( "%s\t0\t0\t°C\n", label );
else if( strncmp(s->sfd->name, "fan", sizeof("fan")-1) == 0)
output( "%s\t0\t0\trpm\n", label );
else if( strncmp(s->sfd->name, "power", sizeof("power")-1) == 0)
output( "%s\t0\t0\tW\n", label );
else
output( "%s\t0\t0\tV\n", label ); /* For everything else, say it's in volts. */
#if SENSORS_API_VERSION & 0x400
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment