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
Pipeline #104932 passed with stage
in 1 minute and 55 seconds
......@@ -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 (!enabled.open(QIODevice::ReadOnly | QIODevice::Text)) {
continue;
}
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.
continue;
}
file.setFileName(BACKLIGHT_SYSFS_PATH + interface + "/type");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
continue;
......
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