Bug 55701

Summary: Backlight control not functioning anymore on Acer Aspire V5 since kernel 3.7
Product: Drivers Reporter: Peter Verthez (peter.verthez)
Component: Video(DRI - Intel)Assignee: Jani Nikula (jani.nikula)
Status: RESOLVED CODE_FIX    
Severity: normal CC: aaron.lu, cnsturgeon2000, daniel, intel-gfx-bugs
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 3.7.x - 3.8.x Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 56331    
Attachments: acpidump
dmesg on kernel 3.6.11
dmesg on kernel 3.7.2
dmidecode output
Config of 3.6.11 kernel
Config of 3.8.3 kernel
dmesg with debug on kernel 3.6.11
dmesg with debug on kernel 3.8.3
drm/i915: ensure single initialization and cleanup of backlight device
dmesg with debug on kernel 3.8.0-23

Description Peter Verthez 2013-03-24 13:12:48 UTC
Created attachment 96051 [details]
acpidump

Acer Aspire V5-571G
Fedora 18

With kernel 3.6.x on Fedora 17 the backlight control (via the Fn keys) of this laptop functioned when adding acpi_osi=Linux acpi_backlight=vendor to the grub command line, and I found I could also modify the backlight by echoing values to /sys/class/backlight/intel_backlight.

Since moving to kernel 3.7 in Fedora 18 (and also now at kernel 3.8) the backlight control doesn't function anymore, and there is no more /sys/class/backlight/intel_backlight file, only an acpi_video0 file.  Echoing to that file doesn't change anything to the backlight.

I've tried with various values of acpi_osi, but none work:
- with no value given: only /sys/class/backlight/acpi_video0
- with acpi_osi=Linux acpi_backlight=vendor: /sys/class/backlight is empty
- with acpi_osi=Linux: only /sys/class/backlight/acpi_video0
- with acpi_osi="!Windows 2012": only /sys/class/backlight/acpi_video0

I've experimented a bit further by installing old kernels and booting from them, and found:
- kernel-3.6.11-5.fc17.x86_64.rpm: backlight control worked, intel_backlight file present
- kernel-3.7.2-201.fc18.x86_64.rpm: backlight control doesn't work, intel_backlight file not present

These tests are both done with 'acpi_osi=Linux acpi_backlight=vendor'.   So something was broken between kernel 3.6 and 3.7.

I'm attaching dmesg on both kernels, and acpidump.
Comment 1 Peter Verthez 2013-03-24 13:13:13 UTC
Created attachment 96061 [details]
dmesg on kernel 3.6.11
Comment 2 Peter Verthez 2013-03-24 13:13:30 UTC
Created attachment 96071 [details]
dmesg on kernel 3.7.2
Comment 3 Peter Verthez 2013-03-24 13:20:28 UTC
My current kernel is kernel-3.8.3-203.fc18.x86_64 (latest one in Fedora 18) and has the same problem as the 3.7.2 kernel.
Comment 4 Aaron Lu 2013-03-26 07:25:14 UTC
Hi Peter,

Please attach dmidecode output, thanks.

And please also list the directory of /sys/class/backlight both under v3.6 and v3.7, is there an acer_wmi entry?
Comment 5 Peter Verthez 2013-03-27 19:13:19 UTC
Created attachment 96421 [details]
dmidecode output
Comment 6 Peter Verthez 2013-03-27 19:15:31 UTC
I've attached the dmidecode output.

With 'acpi_osi=Linux acpi_backlight=vendor' (the case that works under 3.6), the contents of the directory is:

- 3.6: only the intel_backlight file
- 3.7: empty directory

With other settings, the directory contains only an acpi_video0 file, both in 3.6 and 3.7.
Comment 7 Aaron Lu 2013-03-28 02:32:41 UTC
Thanks Peter.

So this means acpi video driver can't handle your backlight, the reason probably lies in the BIOS acpi table and I don't see much we can do here, sorry.

And in v3.6, intel gpu driver's interface can handle the backlight, but in v3.7+, no such interface any more. I think you can file a separate bug against Drivers/DRI-intel on this.
Comment 8 Peter Verthez 2013-03-28 06:40:40 UTC
OK, shouldn't this bug then simply be moved to that Product/Component?
Comment 9 Aaron Lu 2013-03-28 07:23:58 UTC
Hello intel graphics experts,

Peter encountered a problem: the intel_backlight interface disappeared starting from v3.7, v3.6 is good. Please help to take a look, thanks.
Comment 10 Daniel Vetter 2013-03-28 09:45:04 UTC
CONFIG_BACKLIGHT_CLASS_DEVICE unset? There's no other way (besides not having a lvds/edp panel) we don't register the backlight device.
Comment 11 Daniel Vetter 2013-03-28 09:49:08 UTC
Also, please boot latest kernels with drm.debug=0xe and attach the complete dmesg after the boot completes.
Comment 12 Jani Nikula 2013-03-28 10:38:56 UTC
(In reply to comment #10)
> CONFIG_BACKLIGHT_CLASS_DEVICE unset? There's no other way (besides not having
> a
> lvds/edp panel) we don't register the backlight device.

In theory also if we fail to read the max backlight value we bail out. But that went in already in 3.6. This can be easily confirmed from the dmesg Daniel asks in comment #11.
Comment 13 Peter Verthez 2013-03-28 16:51:03 UTC
The config parameter is definitely set.  From /boot/config-3.8.3-203.fc18.x86_64:
CONFIG_BACKLIGHT_CLASS_DEVICE=y
# CONFIG_BACKLIGHT_GENERIC is not set
CONFIG_BACKLIGHT_APPLE=m
# CONFIG_BACKLIGHT_SAHARA is not set
# CONFIG_BACKLIGHT_ADP8860 is not set
# CONFIG_BACKLIGHT_ADP8870 is not set
# CONFIG_BACKLIGHT_LM3630 is not set
# CONFIG_BACKLIGHT_LM3639 is not set
CONFIG_BACKLIGHT_LP855X=m

I'm adding the config of 3.6.11 and 3.8.3 as attachment here.  I'm also adding the dmesg output with the debug setting enabled, on both 3.6.11 and 3.8.3.
Comment 14 Peter Verthez 2013-03-28 16:51:26 UTC
Created attachment 96481 [details]
Config of 3.6.11 kernel
Comment 15 Peter Verthez 2013-03-28 16:51:44 UTC
Created attachment 96491 [details]
Config of 3.8.3 kernel
Comment 16 Peter Verthez 2013-03-28 16:52:02 UTC
Created attachment 96501 [details]
dmesg with debug on kernel 3.6.11
Comment 17 Peter Verthez 2013-03-28 16:52:23 UTC
Created attachment 96511 [details]
dmesg with debug on kernel 3.8.3
Comment 18 Daniel Vetter 2013-04-02 08:47:44 UTC
From the logs I don't see why your intel backlight device disappeared at all - it seems to work as expected. Can you please try to bisect where this regression has been introduced?
Comment 19 Peter Verthez 2013-04-02 12:48:08 UTC
Can you clarify what you mean with 'bisect'?  I'm not a kernel developer.
Comment 20 Daniel Vetter 2013-04-02 13:55:31 UTC
My favourite howto for kernel bisecting: http://www.reactivated.net/weblog/archives/2006/01/using-git-bisect-to-find-buggy-kernel-patches/
Comment 21 Peter Verthez 2013-04-06 11:00:46 UTC
OK, seems clear.   Although I'm a developer, I have no experience in building kernels.  But I've found a pointer to that (http://www.wikihow.com/Compile-the-Linux-Kernel) and I'll try it out when I have enough time.
Comment 22 Jani Nikula 2013-04-09 11:55:26 UTC
It's a subtle bug. We try and enable LVDS and create backlight. Then we go on to try to enable eDP, realize this doesn't work on the machine in question, and clean up. Unfortunately the cleanup path throws away the backlight initialized for LVDS...
Comment 23 Jani Nikula 2013-04-09 13:44:48 UTC
Created attachment 97831 [details]
drm/i915: ensure single initialization and cleanup of backlight device

Please try the attached patch on top of the drm-intel-nightly branch of Daniels drm-intel repo at git://people.freedesktop.org/~danvet/drm-intel.
Comment 24 Peter Verthez 2013-04-13 12:04:47 UTC
I can confirm that the problem is fixed with the patch.  The intel_backlight file is there, and I can also change the backlight brightness with the Fn+arrow keys.

Thanks!
Comment 25 Daniel Vetter 2013-04-20 18:24:14 UTC
Patch merged as

commit dc652f90e088798bfa31f496ba994ddadd5d5680
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Fri Apr 12 15:18:38 2013 +0300

    drm/i915: ensure single initialization and cleanup of backlight device

for 3.10 with cc: stable
Comment 26 cnsturgeon2000 2013-06-06 00:59:05 UTC
I have the same problem on Ubuntu / Linux Mint 15 with kernel 3.8.0-23-generic, it was reported here (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1179315?comments=all) that even with kernel 3.10, the backlight control still doesn't work.

My hardware is: dell xps ultrabook 13' with intel hd 3000?
Comment 27 Jani Nikula 2013-06-06 06:07:08 UTC
(In reply to comment #26)
> I have the same problem on Ubuntu / Linux Mint 15 with kernel
> 3.8.0-23-generic,

If you really can be absolutely certain comment #22 explains all your symptoms, please attach your dmesg with drm.debug=0xe exhibiting the problem. Otherwise, please just file a new bug. Thanks.
Comment 28 cnsturgeon2000 2013-06-06 23:40:24 UTC
Created attachment 103711 [details]
dmesg with debug on kernel 3.8.0-23
Comment 29 cnsturgeon2000 2013-06-06 23:43:19 UTC
Comment on attachment 103711 [details]
dmesg with debug on kernel 3.8.0-23

either 
 echo 0 > /sys/class/backlight/intel_backlight/brightness

or
echo 100 > /sys/class/backlight/intel_backlight/brightness

has no effect on the screen brightness.
Comment 30 Jani Nikula 2013-06-07 04:46:21 UTC
(In reply to comment #28)
> Created an attachment (id=103711) [details]
> dmesg with debug on kernel 3.8

This dmesg does not have drm.debug=0xe module parameter enabled. Please also use a more recent kernel.

(In reply to comment #29)
> (From update of attachment 103711 [details])
> either 
>  echo 0 > /sys/class/backlight/intel_backlight/brightness
> 
> or
> echo 100 > /sys/class/backlight/intel_backlight/brightness
> 
> has no effect on the screen brightness.

One of the symptoms of this fixed and closed bug is that the whole file ceases to exist. This is not the same bug. Please file a new bug instead of littering the logs of an old one, and attach dmesg there. Thank you.