[Bug 76811] Kernel sets wrong screen brightness resuming from suspend on Optimus enabled laptop

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Tue Jun 10 20:27:02 PDT 2014


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

Aaron Lu <aaron.lu at intel.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEEDINFO

--- Comment #5 from Aaron Lu <aaron.lu at intel.com> ---
(In reply to Jani Nikula from comment #4)
> On resume, ACPI video driver restores the backlight brightness on all
> devices that have a backlight interface, in order. In your case I think
> whatever has been set for acpi_video1 will override the acpi_video0 setting.

I agree.

> 
> The brightness hotkeys probably only change acpi_video0 (please confirm!).
> I'm not sure if the keys get routed through userspace on your machine or not

That would require the acpidump to be attached:
# acpidump > acpidump.txt

Also, the /sys/module/video/parameters/brightness_switch_enabled parameter may
play a role. Please disable it:
# echo 0 > /sys/module/video/parameters/brightness_switch_enabled
BTW, this param's value will be 0 by default in v3.15.

> (Aaron can check), and I'm also not sure what the userspace does (or should
> do) given multiple acpi backlight interfaces.

The xorg driver will only pick one interface as the control interface for
backlight and user space will rely on xorg driver so I think only one interface
is used and it is acpi_video0.

> 
> In any case acpi_video0 and intel_backlight seem to work, and more or less
> in sync, so not our bug. Reassigning to ACPI video.

Agree.
The problem is the firmware made the two ACPI interfaces both work that caused
problems. The driver did its job: restore the backlight level to what it is set
previously. And the acpi_video1 is the latter one, so its brightness level gets
restored later and becoming the end result. By default, we will set the
brightness level to full during boot so that's why you get a full backlight
level on resume if you didn't do any echo to acpi_video1.

The acpi video interface is different in that only it does the backlight level
restore. I wonder perhaps we shouldn't do that either, but then I guess people
who rely on this feature will complain regressions since the user space tool
hasn't caught up yet.

For now, maybe use a pre-suspend/post-resume script to save/restore backlight
level. I just googled and think the following may work:
# cat >/etc/pm/sleep.d/66-backlight
#!/bin/bash
case $1 in
    resume)
        cat /sys/class/backlight/acpi_video0/brightness >
/sys/class/backlight/acpi_video1/brightness
    ;;
esac

I haven't tested it, please give it a try. I'm looking here:
https://wiki.archlinux.org/index.php/pm-utils

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the intel-gfx-bugs mailing list