Skip to content
Commit 761fc8a4 authored by Max Ramanouski's avatar Max Ramanouski Committed by Nate Graham
Browse files

Write brightness to all raw devices

On some laptops, there are multiple enabled raw backlight devices, and
backlighthelper can't choose right device.

For example: NVIDIA Optimus laptop, Lenovo 15ARH05. It has two GPUs: AMD
and NVIDIA, both of them provide their backlight device, both backlight
devices are raw type and enabled(in case prime is used). Backlighthelper
without this fix selects NVIDIA device for backlight, but on this laptop
brightness is controlled by AMD gpu, so user can't control brightness.

This fix implements additional list for all raw devices. This list is
loaded on initUsingBacklightType. List contains pairs of sysfs path and
max brightness of device. When brightness is changed, backlighthelper goes
through entries starting from second(first device is written by data from
m_dirname) and writes brightness with correcting difference between
max_brightness in different devices. For all other cases(read brightness
and other) first raw device is used.

BUG: 399646
FIXED-IN: 5.25
parent 7586da3a
Loading
Loading
Loading
Pipeline #154206 passed with stage
in 1 minute and 11 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment