Bug 10206

Summary: backlight brighness control with video missing /sys/class/backlight interface
Product: ACPI Reporter: M G Berberich (kernel)
Component: Power-VideoAssignee: ykzhao (yakui.zhao)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: normal CC: acpi-bugzilla, dunghungwen, kernel
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.24.3 Subsystem:
Regression: --- Bisected commit-id:
Attachments: acpidump output
debug patch
the updated patch
patch vs 2.6.26.6 sent to stable@kernel.org

Description M G Berberich 2008-03-09 12:29:26 UTC
Latest working kernel version:
Earliest failing kernel version:
Distribution: Kubuntu
Hardware Environment: Fujitsu-Siemens Stylistic ST503X
Software Environment: 
Problem Description:

The backlight of the LCD is recognised by the video-module (video.ko) and entries in /proc/acpi/video/GFX0 are generated and are working after boot¹, but there are no entries in /sys/class/backlight/.
The fujitsu_laptop.ko does generate entries in /sys/class/backlight/fujitsu-laptop, but these are not working.

¹ It does not work after resome from suspend-to-RAM.

Steps to reproduce:
Comment 1 M G Berberich 2008-03-09 12:31:46 UTC
Created attachment 15190 [details]
acpidump output
Comment 2 ykzhao 2008-03-09 22:49:49 UTC
Created attachment 15195 [details]
debug patch

Will you please try the debug patch and see whether the entry is created in /sys/class/backlight/? 
Thanks.
Comment 3 ykzhao 2008-03-09 23:09:47 UTC
Now there are some problems about the fujitu-laptop platform driver. 
Please ignore the entry in /sys/class/backlight/fujitsu-laptop . 

After the debug patch in comment #2 is applied, please confirm whether the brightness can be changed by Sys I/F?
Thanks.
Comment 4 M G Berberich 2008-03-10 11:57:11 UTC
I tried the debug_patch and it is working¹. I get /sys/class/backlight/acpi_video0/ and brightness can be changed by writing to /sys/class/backlight/acpi_video0/brightness.

Thanks.

¹After suspend-to-RAM it does not work until the xserver ist restartet.
Comment 5 ykzhao 2008-03-10 19:27:57 UTC
Thanks for the test.

According to the description it seems that the system can be resumed from suspend state. The only problem is that it is necessary to restart the xserver.

Will you please confirm whether the system can be resumed in console mode? (Add the boot option of "3")

Thanks.
Comment 6 ykzhao 2008-03-10 23:54:45 UTC
  The _BQC object is required by current video driver.  But unfortuately the optional _BQC object doesn't exist in the laptop. So the video driver won't register backlight device, which causes that there is no entry in /sys/class/backlight/
   
   As pointed in comment #3, there are some problems about the fujitu-laptop platform driver. The driver will register backlight device even when the acpi device of "FUJ02B1" HID doesn't exist. It is incorrect.
   
   The remaining problem is that it doesn't work until the xserver is restarted.
   Please confirm whether the system can be resumed succefully in console mode?(Add the boot option of "3" to enter the console mode.)
   Thanks.
Comment 7 M G Berberich 2008-03-11 13:59:42 UTC
Yes, the system can resume from suspend-to-ram.

• If I suspend from within X (via kpowersave or /usr/sbin/pm-suspend), after resume the backlight is on and brightness-control does not work. After restarting the X-server brightness-control works.

• After suspend the consoles are dark and blank¹, regardless if X is running or not. This might be some other problem.

a) If X is running and I suspend from a console, after resume the console is dark and blank¹ and brightness-control does not work. After restarting X brightness-control does work.

b) If no X is running, and I suspend from a console, after resume the console is dark and blank¹ and brightness-control does not work. After starting X brightness-control does still not work.
__________
¹ “console is blank” means there are no characters on it and there is no visible difference to a powerless LCD. 
Comment 8 Len Brown 2008-03-11 19:35:57 UTC
re: no backlight on resume from console mode.
Looks like this is an Intel GMA 900 machine.
So please try the latest upstream i915 driver ie. 2.6.25-rc5
which should be able to restore video even in console mode.

applied the list version of the patch in comment #3 to acpi tree.

ie. just this part:

-       if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){
+       if (device->cap._BCL && device->cap._BCM && max_level > 0) {
Comment 9 M G Berberich 2008-03-12 14:41:04 UTC
I tried 2.6.25-rc5 with the BQC-patch and now the brightness-control works after suspend-to-ram on X and on consoles and consoles are no longer blank after resume.

Thanks.
Comment 10 Len Brown 2008-03-12 19:21:29 UTC
thanks for testing!
Comment 11 Len Brown 2008-03-14 19:05:33 UTC
shipped in linux-2.6.25-rc5-git4
closed.
Comment 12 M G Berberich 2008-04-26 00:15:08 UTC
Bug has been reintroduced in 2.6.25, with commit 797de7bdb253624c16144f40b72ec65d63cdcca2
Comment 13 ykzhao 2008-05-28 19:58:02 UTC
Created attachment 16310 [details]
the updated patch

The attached it the updated patch.
Will you please try it and see whether it works for you?
Thanks.
Comment 14 M G Berberich 2008-06-04 13:30:36 UTC
Sorry for needing so long for testing.

I tried the patch with 2.6.25.4 and it's working.

Thanks.
Comment 15 M G Berberich 2008-08-06 10:35:09 UTC
The last patch is still not in 2.6.26.1. Why is this?
Comment 16 ykzhao 2008-08-06 18:10:12 UTC
Now the commit is already in upstream kernel. But we have to wait for some time before it is in stable kernel.

>commit c2c789057f075022658b38b498755c29c1ba8055
>Author: Zhao Yakui <yakui.zhao@intel.com>
<Date:   Thu Jul 17 10:46:05 2008 +0800

    ACPI: Ignore _BQC object when registering backlight device
Thanks.
Comment 17 Len Brown 2008-10-16 23:16:59 UTC
shipped in 2.6.27:

Author: Zhao Yakui <yakui.zhao@intel.com>  2008-07-16 22:46:05
Committer: Andi Kleen <ak@linux.intel.com>  2008-07-17 19:41:49
Parent: 4a5e3638b11978262ab76bbb2062e57fefaaedba (ACPI: stop complaints about interrupt link End Tags and blank IRQ descriptors)
Branches: master, remotes/origin/master
Follows: v2.6.26
Precedes: v2.6.27-rc1

    ACPI: Ignore _BQC object when registering backlight device
Comment 18 Len Brown 2008-10-16 23:18:06 UTC
Created attachment 18346 [details]
patch vs 2.6.26.6 sent to stable@kernel.org
Comment 19 Henry Tung 2009-11-06 06:54:35 UTC
find the same bug in v2.6.30
is this patched in 2.6.30?