Bug 79159 - Systemd sets wrong screen brightness resuming from suspend on Optimus enabled laptop
Summary: Systemd sets wrong screen brightness resuming from suspend on Optimus enabled...
Status: RESOLVED NOTOURBUG
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-23 23:52 UTC by JU
Modified: 2014-05-24 02:43 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description JU 2014-05-23 23:52:52 UTC
On systems with only one graphics card (or with Optimus disabled in BIOS), systemd works correctly: whatever the screen brightness when suspend is initiated is the screen brightness that is set upon resuming from suspend. 

If the system has Optimus enabled however, resuming from suspend always sets the backlight to 100%. This is because systemd is apparently looking at the wrong device in /sys/class/backlight (the device of the nvidia card, not the intel card which controls the backlight).

Consider the following contents of /sys/class/backlight on a system with Optimus disabled:
$ ls /sys/class/backlight
acpi_video0  intel_backlight

Now consider the results of a system with Optimus enabled:
$ ls /sys/class/backlight
acpi_video0  acpi_video1  intel_backlight

In the second case, if I manually:
echo "50" > /sys/class/backlight/acpi_video1/brightness
the laptop will resume from suspend with 50% screen brightness (regardless of what the brightness is actually set at).

I believe the solution is to have either a config option in logind.conf for which device to use in /sys/class/backlight, or for systemd to determine this automatically.

Information:
Lenovo Thinkpad T530
EFI setup
Arch Linux (64bit) (Fully up to date as of this posting)
systemd version: 212 (or: 212-3 in the Arch repos)
lspci | grep "VGA" (Optimus enabled)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [NVS 5400M] (rev a1)


I am not sure whether this is a regression or if it has just never came up- I only recently starting using Optimus (having disabled it via BIOS before) so..

If you need any other information, just ask :)
Comment 1 Lennart Poettering 2014-05-24 00:46:49 UTC
systemd doesn't save/restore backlight settings across suspend/resume, only across reboots, hence is not involved. AFAIK the kernel is responsible for doing that part on its own, hence please file a bug against the kernel driver. Thanks!
Comment 2 JU 2014-05-24 02:34:22 UTC
(In reply to comment #1)
> systemd doesn't save/restore backlight settings across suspend/resume, only
> across reboots, hence is not involved. AFAIK the kernel is responsible for
> doing that part on its own, hence please file a bug against the kernel
> driver. Thanks!

Ok, apologies. Heres a link to the kernel bug in case anyone else makes the same mistake:

https://bugzilla.kernel.org/show_bug.cgi?id=76811

Ill also file a bug with Arch...


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.