Bug 11769 - LCD brightness constantly set back to 100% - Gateway MX6961 laptop w/ Intel GMA950 graphics
LCD brightness constantly set back to 100% - Gateway MX6961 laptop w/ Intel G...
Status: REJECTED INVALID
Product: ACPI
Classification: Unclassified
Component: Power-Video
All Linux
: P1 normal
Assigned To: Zhang Rui
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-15 12:12 UTC by Marc St-Laurent
Modified: 2008-12-08 00:21 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.27
Tree: Mainline
Regression: Yes


Attachments
Kernel 2.6.27 .config file (44.21 KB, text/plain)
2008-10-15 12:14 UTC, Marc St-Laurent
Details
The output of acpidump (113.15 KB, text/plain)
2008-10-20 13:59 UTC, Marc St-Laurent
Details
debug patch (2.03 KB, patch)
2008-11-10 23:49 UTC, Zhang Rui
Details | Diff
debug patch (2.26 KB, application/octet-stream)
2008-11-10 23:54 UTC, Zhang Rui
Details
Dmesg for patch from comment #19 (40.71 KB, text/plain)
2008-11-11 20:33 UTC, Marc St-Laurent
Details
commands and output for test in comment 22 (839 bytes, text/plain)
2008-11-12 16:32 UTC, Marc St-Laurent
Details
Output of "xrandr --verbose" (2.12 KB, text/plain)
2008-11-12 20:09 UTC, Marc St-Laurent
Details
Various commands that show the brightness file levels w/ 2.6.27.5 (6.94 KB, text/plain)
2008-11-13 08:30 UTC, Marc St-Laurent
Details
Tests with 2.6.28-rc6 from git (3.69 KB, text/plain)
2008-11-25 21:23 UTC, Marc St-Laurent
Details

Description Marc St-Laurent 2008-10-15 12:12:44 UTC
Latest working kernel version: 2.6.26.6
Earliest failing kernel version: 2.6.27
Distribution: Arch Linux
Hardware Environment: Gateway MX6961 laptop w/ Intel GMA950 graphics
Software Environment:
Problem Description:

Shortly after boot, the LCD's brightness gets set to 100%.  I can set it back to the desired level using "echo 62 > /proc/acpi/video/VGA/LCD/brightness".  However, there are many actions that will return the brightness to 100%, such as switching to a console with ctrl+alt+fn, or returning from xorg screen blanking.  Just about anything that changes the monitor's mode is accompanied by a return to 100% brightness.

Steps to reproduce:
1) Boot computer.  Brightness will go to 100%.
2) Set brightness back to desired level using either /proc/acpi/video... or /sys/class/backlight...
3) Press ctrl+alt+f1.  Brightness will return to 100% every time.
4) Leave xorg idle until screen blanks.  When the screen is "woken up", brightness gets set back to 100%.
Comment 1 Marc St-Laurent 2008-10-15 12:14:47 UTC
Created attachment 18327 [details]
Kernel 2.6.27 .config file
Comment 2 Marc St-Laurent 2008-10-15 15:42:21 UTC
Reverting the following patch has made the brightness changes go away:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=c2c789057f075022658b38b498755c29c1ba8055

However, it also makes /sys/class/backlight disappear, and /proc/acpi/video/VGA/LCD/brightness says that the current level is 0%, when it is 62%.
Comment 3 ykzhao 2008-10-20 01:17:02 UTC
Will you please attach the output of acpidump?
Thanks.
Comment 4 ykzhao 2008-10-20 01:31:31 UTC
Hi, Marc
    How about this issue if you change the brightness by using the "/sys/class/backlight/acpi_vide*/brightness"?
    
    From the description it seems that there is no _BQC ACPI object. But the acpi video backlight is still registered and the brightness will be set to the maxmium in the boot phase. After the system is booted, how to change the brightness depends on the user input or ACPI event.
    Will you please kill the process which is using the "/proc/acpi/event" and see whether the brightness is still constantly set to 100%?
    Thanks.
    
    
Comment 5 ykzhao 2008-10-20 01:35:58 UTC
Please use the command of "lsof /proc/acpi/event" to get the process which is using the /proc/acpi/event.
   Thanks.
Comment 6 Marc St-Laurent 2008-10-20 13:59:30 UTC
Created attachment 18385 [details]
The output of acpidump
Comment 7 Marc St-Laurent 2008-10-20 15:05:03 UTC
Hello,
I can confirm that _BQC is always = 0.  I added some printk() calls to a test kernel last week.

The process that reads /proc/acpi/event is acpid.  I rebooted with all daemons disabled, and it made no difference.  There are no video related actions in my acpid configuration.  It is only used to suspend the laptop.

After booting, the value of /sys/class/backlight/*/brightness is 7 (maximum), and the value in /proc/acpi/video/VGA/LCD/brightness is 100.  Using the brightness functions keys, the brightness of the monitor obviously changes, but the values in those 2 files remain at maximum.  If I echo a different value into either of those files, both the brightness and the value change, as they should.

Switching to console or returning form xorg screen blank set the brightness to maximum, but the values in the 2 files remain unchanged.
Example:
1) After boot, screen is at 100%
2) I do "echo 62 > /proc/acpi/.../brightness".  Screen brightness goes down, and the brightness file contains the correct value.
3) I switch to console using Ctrl+Alt+F1.  The brightness goes to 100%, but the /proc/acpi... file still says 62%.

I hope I've given you all the info you need.  Thanks for looking into this.
Marc


Comment 8 Shaohua 2008-10-21 23:29:11 UTC
did you try latest intel x-windows gfx driver?
Comment 9 Marc St-Laurent 2008-10-22 01:25:39 UTC
I have intel driver 2.3.2, but the problems occur outside of xorg, too.

I think that in the absence of the _BQC object, if there is no way of reading the current brightness level, then it should be left unchanged and unititialized.  Setting it to any value would only be a (wrong) guess.

Then if the user specifically requests a brightness change with the Fn keys, set it to maximum (or some value), then let the user adjust the brightness himself.

This would be very close to the former behavior from 2.6.26, I believe.  What do you think?
Comment 10 Marc St-Laurent 2008-10-22 13:27:18 UTC
I upgraded xf86-video-intel to version 2.5.0, and there is no change.
Comment 11 ykzhao 2008-10-23 19:04:24 UTC
Hi, Marc
    Will you please do the test as mentioned in comment #7 on the 2.6.26.6 kernel and confirm whether the brightness returned by /proc/acpi/. is consistent with the real brightness?
    From the test in comment #7 it seems that the brightness is changed by BIOS after pressing CTRL+AL+F1. As there is no _BQC object, the /proc/acpi/ or /sys/class/backlight/*  can't reflect the current brightness.
    thanks.
Comment 12 Marc St-Laurent 2008-10-25 12:14:50 UTC
Here is my test with 2.6.26.6

1) Before rebooting into 2.6.26.6, I set the brightness to 62%, my preferred level.

2) After booting into 2.6.26.6, the brightness level does NOT change.  /sys/class/backlight is an empty directory, and /proc/acpi/video/VGA/LCD/brightness says the current level is 0%.  There is an inconsistency.

3) Switching between xorg and console does not change the /proc/.. file, nor the brightness level.  Everything stays the same.

4) If I echo a value into /proc/acpi.., the brightness will change accordingly, and the file will now contain the correct value.

5) After echoing the value into /proc/acpi.., switching from xorg to console does not change the brightness nor the /proc/acpi.. file.  They are still at the correct values.
Comment 13 Zhang Rui 2008-10-29 18:51:12 UTC
(In reply to comment #7)
> After booting, the value of /sys/class/backlight/*/brightness is 7 (maximum),
> and the value in /proc/acpi/video/VGA/LCD/brightness is 100.  Using the
> brightness functions keys, the brightness of the monitor obviously changes, but
> the values in those 2 files remain at maximum.
test1:
kill acpid and run "cat /proc/acpi/event",
what do you get when pressing the hotkey?
test2:
"echo 0 > /sys/module/video/parameters/brightness_switch_enabled"
can you change the backlight via hotkey any more?


Note that the BIOS is tricky.
Method (LBCM, 1, NotSerialized)
{
   If (\_OSI ("Windows 2006"))
   {
      ...
   }
}
the method for backlight control only works on windows Vista.
i.e. any previous windows releases don't use this method for backlight control.
what if you boot with acpi_osi="!Windows 2006"?
PS, in this case, both the proc and sys backlight I/F may not work for you.
Comment 14 Marc St-Laurent 2008-10-29 22:19:27 UTC
Test 1 done with 2.6.27.3 and acpid killed:
[root@~] cat /proc/acpi/event 
video DD04 00000086 00000000
video DD04 00000086 00000000
video DD04 00000087 00000000
video DD04 00000087 00000000

Test 2:
No I can't change the brightness with the hotkeys after running 
"echo 0 > /sys/module/video/parameters/brightness_switch_enabled"
But echoing a value into /sys/class/backlight/... still works.

I will reboot with the acpi_osi argument and give you the results in a few minutes.
Comment 15 Marc St-Laurent 2008-10-29 22:57:59 UTC
I have now booted with the acpi_osi argument.
- At boot time, the brightness level did not get set to 100%.  It remained at the level I want (62%).
- The brightness files in /sys and /proc both exist, they report maximum brightness.
- Switching to console and back to xorg makes no difference in brightness.
- Writing different values into the brightness files makes no change either.
- Echoing a value in the /sys brightness file does not change the /proc brightness file.  They are in an inconsistent state.
- Using the hotkeys, the actual brightness changes, but the /sys and /proc files do not get updated.
Comment 16 ykzhao 2008-10-29 23:56:34 UTC
Hi, Marc
    Will you please apply the patch in http://bugzilla.kernel.org/show_bug.cgi?id=10206#C13 on the 2.6.26.6 kernel and see whether the issue still exists?
    thanks.
Comment 17 Marc St-Laurent 2008-11-10 22:37:27 UTC
Hello,
Sorry for taking so long.  I discovered that I cannot easily revert to an older kernel, so I had to install a 2nd copy of linux on a temporary partition.  Anyway, here are the results with kernel 2.6.26.6, and the patch in comment 16.

- At boot time, when video.ko gets loaded, the brightness goes to 100%.  /sys/class/backlight gets created properly.  All brightness files say 100%.

- Echoing a value in /proc/acpi... changes that file and the actual brightness, but /sys/class.. never gets updated.  It remains inconsistent throughout the whole test.

- Switching from xorg to console sets the actual brightness to 100%, but the brightness files remain as they were before the switch.



Comment 18 Zhang Rui 2008-11-10 23:49:40 UTC
Created attachment 18795 [details]
debug patch

please apply this patch on the latest kernel source,
redo the test and attach the dmesg output.
Comment 19 Zhang Rui 2008-11-10 23:54:43 UTC
Created attachment 18796 [details]
debug patch

sorry, wrong patch attached.
Comment 20 Marc St-Laurent 2008-11-11 20:33:18 UTC
Created attachment 18813 [details]
Dmesg for patch from comment #19
Comment 21 Marc St-Laurent 2008-11-11 20:34:59 UTC
23:15 - Boot.  Brightness goes up to 100%
23:17 - echo 62 > /proc/acpi/video/VGA/LCD/brightness.  The actual brightness changes, and that file has the correct value, but both backlight brightness files (acpi_video0, acpi_video1) still say level 7 (100%).
23:19 - I go to console using Ctrl-Alt-F1.  The actual brightness goes to 100%.  The /proc file still says 62%, but both backlight device files say level 7 (100%).
23:19 - Return to xorg (Ctrl-Alt-F7).  Actual brightness is still at 100%, the file values are unchanged.
23:21 - I press the brightness up/down switches a few times.  The values in the brightness files never change.
23:22 - echo {3,4} > /sys/class/backlight/acpi_vide0/brightness (a few times).  Actual brightness changes.  the /proc file changes accordingly.  acpi_video0/brightness also changes, but acpi_video1/brightness remains the same.
Comment 22 Zhang Rui 2008-11-11 23:28:00 UTC
Hi, Marc, nice bug report. :)
one question, at 23:17, how did you know /proc/acpi/video/VGA/LCD/brightness has the correct value, and acpi_video0, acpi_video1 still say level 7?
did you "cat" them?
it's really strange because there is no debug output at 23:17 showing that you tried to get the brightness level.
will you please do the following test?
1. set the brightness value via /proc/acpi/video/VGA/LCD/brightness
2. "cat /proc/acpi/video/VGA/LCD/brightness"
3. "cat /sys/class/backlight/acpi_vide0/brightness"
4. "cat /sys/class/backlight/acpi_vide1/brightness"
5. wait for a minute,
6. set the brightness value via /sys/class/backlight/acpi_vide0/brightness(only once)
7. redo 2,3 and 4
8. attach the dmesg output.
Comment 23 Len Brown 2008-11-12 01:01:49 UTC
Please try Linux-2.6.28-rc4 or later, with the i915 and
ACPI video drivers included.
The OSI on the brightness here specifies Vista, and Vista includes IGD support
that we've recently added to the i915 and the video driver that should
handle brightness.
Comment 24 Marc St-Laurent 2008-11-12 16:01:12 UTC
Hello Zhang,

In response to comment 22 : after every step in the test I did, I used "cat" to view the contents of the /proc and the 2 /sys brightness files.

There is debug output at 23:17, but just one line.  That's all that gets logged when I echo a value into /proc../brightness.  I just tried it again right now, and there's only 1 new line in dmesg.

I will redo the test you asked for, and try the latest rc kernel per Len Brown's request.  Thank you all again for looking into this.
Comment 25 Marc St-Laurent 2008-11-12 16:32:08 UTC
Created attachment 18836 [details]
commands and output for test in comment 22
Comment 26 Zhang Rui 2008-11-12 18:45:20 UTC
Hi, Marc,
you don't need to do the test in comment #22.

(In reply to comment #21)
> 23:15 - Boot.  Brightness goes up to 100%
good, the ACPI video driver set the brightness level to maximum if no _BQC available.

> 23:17 - echo 62 > /proc/acpi/video/VGA/LCD/brightness.  The actual brightness
> changes, and that file has the correct value, but both backlight brightness
> files (acpi_video0, acpi_video1) still say level 7 (100%).
good. the ACPI control methods works on this laptop.
and the "brightness" file only returns a cached value, in order to get the real brightness level, you need to run "cat actual_brightness"

> 23:19 - I go to console using Ctrl-Alt-F1.  The actual brightness goes to 100%.
this is strange, this is not done by ACPI driver.
please do this test, unload the ACPI video driver before you go to console.
does the brightness still goes to 100%?

>  The /proc file still says 62%, but both backlight device files say level 7
> (100%).

> 23:19 - Return to xorg (Ctrl-Alt-F7).  Actual brightness is still at 100%, the
> file values are unchanged.
> 23:21 - I press the brightness up/down switches a few times.  The values in 
> the brightness files never change.
this is weird, the dmesg shows that ACPI video driver does change the brightness level upon hotkey event, please press the brightness down button for 5 times, if the brightness doesn't change, attach the output of "cat /proc/.../brightness"

BTW: please attach the output of "xrandr --verbose".
please run "xrandr --verbose | grep BACKLIGHT",
if the BACKLIGHT_CONTROL is not "kernel" mode,
please run "xrandr --output LVDS --set BACKLIGHT_CONTROL kernel"
and check if this helps.
Comment 27 Marc St-Laurent 2008-11-12 20:07:23 UTC
(In reply to comment #26)
> Hi, Marc,
> you don't need to do the test in comment #22.

Too late :)

> (In reply to comment #21)
> > 23:15 - Boot.  Brightness goes up to 100%
> good
I respectfully disagree :)

> > 23:17 - echo 62 > /proc/acpi/video/VGA/LCD/brightness.  The actual brightness
> > changes, and that file has the correct value, but both backlight brightness
> > files (acpi_video0, acpi_video1) still say level 7 (100%).
> good. the ACPI control methods works on this laptop.
> and the "brightness" file only returns a cached value, in order to get the real
> brightness level, you need to run "cat actual_brightness"

I will use actual_brightness from now on.

> > 23:19 - I go to console using Ctrl-Alt-F1.  The actual brightness goes to 100%.
> this is strange, this is not done by ACPI driver.
> please do this test, unload the ACPI video driver before you go to console.
> does the brightness still goes to 100%?

No, it does not.  There are absolutely no brightness changes under any circumstance when video.ko is not loaded.

> > 23:21 - I press the brightness up/down switches a few times.  The values in 
> > the brightness files never change.
> this is weird, the dmesg shows that ACPI video driver does change the
> brightness level upon hotkey event, please press the brightness down button for
> 5 times, if the brightness doesn't change, attach the output of "cat
> /proc/.../brightness"

The hotkeys change the physical brightness, but the files remain unchanged.  I have just used the keys to reduce the brightness to a very low level, but /proc.. still says 100%.
[root@~] cat /proc/acpi/video/VGA/LCD/brightness 
levels:  100 37 12 25 37 50 62 75 87 100
current: 100

> BTW: please attach the output of "xrandr --verbose".
> please run "xrandr --verbose | grep BACKLIGHT",
> if the BACKLIGHT_CONTROL is not "kernel" mode,
> please run "xrandr --output LVDS --set BACKLIGHT_CONTROL kernel"
> and check if this helps.

BACKLIGHT_CONTROL is "kernel".  I'll attach the output in a moment.
Comment 28 Marc St-Laurent 2008-11-12 20:09:13 UTC
Created attachment 18839 [details]
Output of "xrandr --verbose"
Comment 29 Zhang Rui 2008-11-12 23:17:38 UTC
(In reply to comment #27)
> (In reply to comment #26)
> > > 23:19 - I go to console using Ctrl-Alt-F1.  The actual brightness goes to 100%.
> > this is strange, this is not done by ACPI driver.
> > please do this test, unload the ACPI video driver before you go to console.
> > does the brightness still goes to 100%?
> 
> No, it does not.  There are absolutely no brightness changes under any
> circumstance when video.ko is not loaded.
> 



> > > 23:21 - I press the brightness up/down switches a few times.  The values in 
> > > the brightness files never change.
> > this is weird, the dmesg shows that ACPI video driver does change the
> > brightness level upon hotkey event, please press the brightness down button for
> > 5 times, if the brightness doesn't change, attach the output of "cat
> > /proc/.../brightness"
> 
> The hotkeys change the physical brightness,
good. :)

> but the files remain unchanged.  I
> have just used the keys to reduce the brightness to a very low level, but
> /proc.. still says 100%.
> [root@~] cat /proc/acpi/video/VGA/LCD/brightness 
> levels:  100 37 12 25 37 50 62 75 87 100
> current: 100
>
hmmm, there are two directories under /proc/acpi/video/, right?
what's the content of /proc/acpi/video/GFX0/DD04/brightness?
what's the content of /sys/.../acpi_video{0,1}/actual_brightness?

I suspect that some other applications, maybe X, changes the backlight when you press ctrl+alt+f1.
but it's still weird that the value of the procfs I/F is not updated correctly.
Comment 30 Marc St-Laurent 2008-11-13 08:30:33 UTC
Created attachment 18850 [details]
Various commands that show the brightness file levels w/ 2.6.27.5

Hello Zhang,

I have created a file which I hope will answer all your questions in comment #29.  It is a test in 5 parts.  I have found 2 cases where the brightness does not go back to 100% after switching to console.  In both cases, acpi_video1/brightness contains the correct value (that matches the physical level), and is non-zero.  In my previous tests, I always used acpi_video0, which is probably why I never found these 2 successful cases before.

I also discovered this, in /var/log/Xorg.0.log:
(II) intel(0): found backlight control method /sys/class/backlight/acpi_video1
Comment 31 Zhang Rui 2008-11-13 17:50:43 UTC
excellent tests and valuable info. You make my work much easier, Marc. :)

The problem is caused by some wrong interactions between ACPI and some user applications, maybe X.
so the next step is,
1. kill acpid, run "cat /proc/acpi/event", is there any output if you switch to console and get back to X for several times?
2. pull linus' git tree to get the latest kernel source. there is a patch set shipped in yesterday, which can fix the duplicate video devices issue for you.
and IMO, it would also help for this bug.

if the problem still exists, please re-do the tests in comment #30 and attach the test result. BTW, I really like it. :p
Comment 32 Marc St-Laurent 2008-11-13 20:16:04 UTC
(In reply to comment #31)

> 1. kill acpid, run "cat /proc/acpi/event" ...

Sorry, no output from /proc/acpi/event with acpid killed.

> 2. pull linus' git tree ...

This will unfortunately have to wait several days.  Take the week off! :P
Comment 33 Zhang Rui 2008-11-24 22:37:40 UTC
hah, any update?
Comment 34 Marc St-Laurent 2008-11-25 21:23:46 UTC
Created attachment 19021 [details]
Tests with 2.6.28-rc6 from git

Sorry for the long delay.  I finally pulled a kernel from git and redid the big test from comment 30.  First of all, the test is smaller because /proc/acpi/video/VGA and /sys/class/backlight/acpi_video1 no longer exist.  I now only have /proc/acpi/video/GFX0 and /sys/class/backlight/acpi_video0.

There's been a lot of progress with this new kernel.  All tests are good except #1.  When actual_brightness = 0, the brightness still gets reset to 100%.  There is still progress with the failed test: before, the brightness would go to max as soon as I switched to the console.  Now, it only happens when I return to xorg.
Comment 35 Marc St-Laurent 2008-11-25 21:27:44 UTC
Disregard the first line in attachment #19021 [details].  The tests were not done with 2.6.27.5.
Comment 36 Zhang Rui 2008-11-25 22:29:23 UTC
according to ZhangYu's explanation, the graphics driver saves the backlight value before switching to console, and then restore it when switching back to X.

the only exception is the zero brightness level. it's thought to be invalid and the maximum brightness value will be restored instead.


cc Zhangyu.
Comment 37 Zhang Rui 2008-12-08 00:21:40 UTC
ZhenYu has already generate a patch and he'll push this to
xf86-video-intel master ASAP.

Reject this as it's not an Linux/ACPI bug.
Marc,
patch is at http://marc.info/?l=linux-acpi&m=122831633210069&w=2
you can give it a try if you want. :)

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