Commit e95924f4 authored by Dan Robinson's avatar Dan Robinson Committed by Nate Graham
Browse files

Check if backlight device is enabled

Check the enabled property on each backlight device before using
it as a backlight device, so the correct device is used in multi
GPU setups

BUG: 399646
FIXED-IN: 5.24
parent 5ff9737c
......@@ -85,6 +85,16 @@ void BacklightHelper::initUsingBacklightType()
QStringList firmware, platform, raw, leds;
for (const QString & interface : interfaces) {
QFile enabled(BACKLIGHT_SYSFS_PATH + interface + "/device/enabled");
if (! | QIODevice::Text)) {
if (enabled.readLine().trimmed() != "enabled") {
// this backlight device isn't connected to a display, so move on
// to the next one and see if it does.
file.setFileName(BACKLIGHT_SYSFS_PATH + interface + "/type");
if (! | QIODevice::Text)) {
Supports Markdown
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