Bug 42726 - Software backlight controls don't work - Emachine e725 and e525
Summary: Software backlight controls don't work - Emachine e725 and e525
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Video (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Aaron Lu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-04 09:03 UTC by Uldis
Modified: 2013-04-09 05:07 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.1.10
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Dmesg boot output. (42.90 KB, text/plain)
2012-02-04 09:03 UTC, Uldis
Details
lspci -v output (8.70 KB, text/plain)
2012-02-04 09:04 UTC, Uldis
Details
Acpidump output (190.56 KB, text/plain)
2012-02-07 17:19 UTC, Uldis
Details
Tweaked DSDT table to use AINT in _BCM (38.21 KB, application/octet-stream)
2013-03-28 08:12 UTC, Aaron Lu
Details

Description Uldis 2012-02-04 09:03:32 UTC
Created attachment 72276 [details]
Dmesg boot output. 

I have 2 laptops Emachine e725 and e525 , both with  Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller using i915 with kernel modsetting. 

After the kernel has loaded the i915 driver on both laptops, the backlight turns off. 

There are 2 ways to get it back: 1st is to use brightness control keys (Turn the backlight 1 step down and then 1 step up) on keyboard which only work if there is an acpi_osi="Linux" option in the boot parammetrs, the second is using setpci -s 00:02.0 F4.B=00. The backlight turns off too when a switch between tty7 and tty8 happens (if xorg is running on both). 

Attached dmesg output on boot and lspci -v
Comment 1 Uldis 2012-02-04 09:04:00 UTC
Created attachment 72277 [details]
lspci -v output
Comment 2 Len Brown 2012-02-07 03:57:59 UTC
re: acpi_osi=Linux
please attach the output from acpidump

this will also tell us if this machine supports IGD Opregion brightness control.
Comment 3 Uldis 2012-02-07 17:19:43 UTC
Created attachment 72312 [details]
Acpidump output

Hope this is it :)
Comment 4 Zhang Rui 2012-02-13 05:09:39 UTC
This is an IGG Opregion BIOS and "acpi_osi=Linux" makes Linux run different ASL code from windows.

Uldis,
if you boot without "acpi_osi=linux", can you change the backlight manually via /sys/class/backlight/?
Comment 5 Uldis 2012-02-13 07:15:24 UTC
I have 2 entries in /sys/class/backlight : acpi_video0 and intel_backlight . acpi_video does not work, but intel_backlight works:


setting brightness to 3316785 (reported by max_brightness) will set display to black lowering brightness makes it brighter up until about 1000 which is the brightest that display gets.. continuing to 0 does no create visible change.  

Hardware controls does not work anymore with no acpi_osi.
Comment 6 Uldis 2012-02-13 17:05:22 UTC
Sorry for double post, but 

echo "xxx" > /sys/class/backlight/intel_backlight/brightness  

works with acpi_osi="Linux" too. 

It seems that if I do
echo "xxx" > /sys/class/backlight/acpi_video0/brightness  
it accepts the value, but nothing changes. After i try to control brightness with hardware keys, it jumps to value writen in the acpi_video0/brightness file. It would mean, that after change in acpi_video0/brightness the hardware stuff isn't updated.
Comment 7 Terry Jones 2012-03-07 03:46:16 UTC
I have an emachine 725 and have filed a bug report with Ubuntu.  They recommended that I file it upstream.  My bug is the same (boots to a screen with the backlight off). I use a boot parameter acpi_osi=Linx as a workaround. This is a kernel regression.  Older versions of Ubuntu did not have this problem. I think the regression happened around June 2011. It is not only Ubuntu, as I test a lot of different distros. Older versions work fine, newer versions boot to a blank screen.

Link to my Ubuntu bug report https://bugs.launchpad.net/ubuntu/+source/linux/+bug/934707
Comment 8 Terry Jones 2012-03-07 03:50:22 UTC
acpi_osi=Linx above should be acpi_osi=Linux
Comment 9 Uldis 2012-03-07 06:51:37 UTC
At least for me black screen started with around 2.6.36 or 2.6.37 kernel, but the brightness control didn't work before that either. I think the black screen is because software controls don't work or as far as they work, they work incorrectly. It could be because of some acpi bugs in the bios (probably), but i can confirm, that on Win 7 the brightness controls work fine and using acpi_osi="Windows 2006" does not help.
Comment 10 Terry Jones 2012-03-17 00:43:36 UTC
@Uldis Try using boot up kernel parameter acpi_osi= with a space after =. It works so good for me that I added it to Grub default,  See how it works before making it permanent in Grub default. I still have to use the brightness keys (Fn + <) which is supposed to be brightness down to make the screen brighter at boot up.  It awakes from suspend OK.
Comment 11 Uldis 2012-03-30 06:15:43 UTC
Zhang Rui, will there be any input from you regarding bug status/plans? :)
Comment 12 Zhang Rui 2012-11-13 07:59:41 UTC
(In reply to comment #6)
> Sorry for double post, but 
> 
> echo "xxx" > /sys/class/backlight/intel_backlight/brightness  
> 
> works with acpi_osi="Linux" too. 
> 
does this work if you boot without acpi_osi="Linux" ?
Comment 13 Zhang Rui 2012-11-21 01:29:36 UTC
ping...
Comment 14 Zhang Rui 2012-11-28 10:17:58 UTC
ping...
Comment 15 Zhang Rui 2012-12-11 01:44:27 UTC
Hi, Uldis,
any update on this?
Comment 16 Aaron Lu 2013-03-15 03:25:52 UTC
The corresponding asl code to set/get brightness are:

Method (_BCM, 1, NotSerialized)
{
    Divide (Arg0, 0x0A, Local0, Local1)
    Decrement (Local1)
    Store (Local1, ^^^^LPC.EC0.BRTS)
}

Method (_BQC, 0, NotSerialized)
{
    Store (^^^^LPC.EC0.BRTS, Local0)
    Add (Local0, One, Local0)
    Multiply (Local0, 0x0A, Local0)
    Store (Local0, P80H)
    Sleep (0x64)
    Return (Local0)
}

Which simply convert the value to index and then write to BRTS in EC space. So I don't see much we can do here.

And the acpi_osi=Linux should only affect the handling of hotkey. In the acpi_osi=Linux case, when hotkey is pressed, instead of sending out a notification, it directly handles this by calling a function defined under this vga controller device node - AINT, so that can probably explain why hotkey can change brightness level.

So looks like acpi will not be able to handle your backlight, you can use acpi_backlight=vendor kernel command line to workaround this. And if you still have problem, that would mean the i915 driver has a problem too, and you are advised to file a bug against Drivers/DRI-intel, see if they can fix it. Thanks.
Comment 17 Aaron Lu 2013-03-22 13:09:16 UTC
_BCM uses EC to change brightness level, while AINT uses IGD operation region to change brightness level.
Comment 18 Aaron Lu 2013-03-28 08:12:46 UTC
Created attachment 96461 [details]
Tweaked DSDT table to use AINT in _BCM

Uldis,

I've tweaked your original DSDT table, please give the new DSDT table a try. And please do not use any acpi_osi= command line, thanks.
Comment 19 Aaron Lu 2013-04-07 05:43:55 UTC
Anyone still there to try the customized DSDT in comment #18 please? For howto override DSDT, please see: Documentation/acpi/initrd_table_override.txt, thanks.

Note You need to log in before you can comment on or make changes to this bug.