Bug 21212 - initial brightness is minimum - ATI Radeon HD 5850 - HP Envy 17
initial brightness is minimum - ATI Radeon HD 5850 - HP Envy 17
Status: CLOSED PATCH_ALREADY_AVAILABLE
Product: ACPI
Classification: Unclassified
Component: Power-Video
All Linux
: P1 normal
Assigned To: Zhang Rui
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-10-26 21:36 UTC by Louis
Modified: 2011-07-30 06:53 UTC (History)
4 users (show)

See Also:
Kernel Version:
Tree: Mainline
Regression: No


Attachments
acpidump (285.66 KB, application/octet-stream)
2010-10-29 09:02 UTC, Louis
Details
grep . /sys/class/backlight/*/* (391 bytes, application/octet-stream)
2010-10-29 09:04 UTC, Louis
Details
grep . /sys/class/backlight/*/device/* (506 bytes, text/plain)
2010-11-01 09:01 UTC, Louis
Details
dmesg with ubuntu kernel 2.6.35-22-generic (56.23 KB, application/octet-stream)
2010-11-02 13:12 UTC, Louis
Details
patch: do not trust BIOS initial backlight (1.22 KB, patch)
2010-11-03 05:57 UTC, Zhang Rui
Details | Diff
custom DSDT (538.68 KB, application/octet-stream)
2010-11-04 02:13 UTC, Zhang Rui
Details
dmesg from custom DSDT on gentoo kernel 2.6.36 (43.25 KB, application/octet-stream)
2010-11-06 10:44 UTC, Louis
Details
custom DSDT (538.46 KB, application/octet-stream)
2010-11-08 01:39 UTC, Zhang Rui
Details
lscpi -vvxxx (73.72 KB, text/plain)
2010-11-08 10:05 UTC, Louis
Details
dmesg from custom DSDT on gentoo kernel 2.6.36 (72.86 KB, text/plain)
2010-11-08 10:08 UTC, Louis
Details

Description Louis 2010-10-26 21:36:57 UTC
On my HP Envy 17, with ATI Radeon HD 5850, using kernels >= 2.6.34, every boot time the screen brightness goes to 0 when the acpi is enabled.

The only way to fix it is setting acpi=off. 
After many tests, this bug seems to me not dependent of any kind of graphics modules activated on the kernel, in fact it appears always.

This bug affects also all distribution kernels, like Ubuntu, Fedora, Gentoo, etc..
Comment 1 Zhang Rui 2010-10-29 03:27:35 UTC
(In reply to comment #0)
> On my HP Envy 17, with ATI Radeon HD 5850, using kernels >= 2.6.34, every boot
> time the screen brightness goes to 0 when the acpi is enabled.
> 
so the system is still working well at this time, right?
can you change the backlight via hotkeys?
please remote login, and
1. attach the acpidump of this laptop.
2. attach the output of "grep . /sys/class/backlight/*/*"
Comment 2 Louis 2010-10-29 09:00:55 UTC
Thanks for reply! Yes, the system is still working well.

The backlight hotkeys work, on Gentoo they increment correctly, using this clear .config file: http://pappy-mcfae.pastebin.com/F9enuzP1
However on Ubuntu it goes always to 0 before increment.

Another important point is that if I'm using KDE or Gnome Desktop the power manager can change the brightness using the power profiles.

In attached you have acpidump and grep, note that my video is video0, and I'm under kde with performance profile (100% brightness).
Comment 3 Louis 2010-10-29 09:02:26 UTC
Created attachment 35442 [details]
acpidump
Comment 4 Louis 2010-10-29 09:04:15 UTC
Created attachment 35452 [details]
grep . /sys/class/backlight/*/*
Comment 5 Zhang Rui 2010-11-01 02:11:34 UTC
(In reply to comment #4)
please attach the output of "grep . /sys/class/backlight/*/device/*" as well.
Comment 6 Louis 2010-11-01 09:01:41 UTC
Created attachment 35722 [details]
grep . /sys/class/backlight/*/device/*
Comment 7 Zhang Rui 2010-11-02 06:49:21 UTC
(In reply to comment #0)
> On my HP Envy 17, with ATI Radeon HD 5850, using kernels >= 2.6.34, every boot
> time the screen brightness goes to 0 when the acpi is enabled.
> 
so this is a 2.6.34 regression, right?
does the problem exist in 2.6.33?

IMO, this is a BIOS problem which set initial _BQC value to minimum.
But as you said, this is a regression, so I need to find out which commit exposes this problem.
Comment 8 Louis 2010-11-02 12:43:19 UTC
(In reply to comment #7) 
> so this is a 2.6.34 regression, right?
> does the problem exist in 2.6.33?

Not really, sorry. I bought my Envy in August, so I only tested it with ubuntu 2.6.32, gentoo 2.6.34-r6, 2.6.34-r11, 2.6.34-r12, 2.6.35-r1. For all these kernels I'm observing this issue. So I don't think that it's a regression.

Here you have a "blog" where someone shows this issue, called in this case black console, for another envy model, HP envy 14, with similar ATI drive:
http://www.andreas-demmer.de/2010/07/18/testbericht-linux-auf-dem-hp-envy-14

Please let me know if you need more information.
Comment 9 Louis 2010-11-02 13:11:20 UTC
Another precision:
All attachments are from Ubuntu 10.10 with kernel 2.6.35-22-generic, using HP Bios F13.
I'm posting the dmesg, there is nothing strange (like _BQC wanings).

I don't know if it's usefull for you or maybe it's correlated: at 60s I get "bios memory corruption in low memory". I can remove this warning setting CONFIG_X86_RESERVE_LOW_64K=n. So probably it's only a bios bug. 

> [   62.516112] WARNING: at /build/buildd/linux-2.6.35/arch/x86/kernel/check.c:134 check_for_bios_corruption+0xe5/0xf0()
> [   62.516118] Hardware name: HP ENVY 17 Notebook PC
> [   62.516122] Memory corruption detected in low memory
Comment 10 Louis 2010-11-02 13:12:34 UTC
Created attachment 35902 [details]
dmesg with ubuntu kernel 2.6.35-22-generic
Comment 11 Zhang Rui 2010-11-03 05:57:39 UTC
Created attachment 35972 [details]
patch: do not trust BIOS initial backlight

please apply this patch, set CONFIG_ACPI_VIDEO=y. rebuild the kernel and boot with video.use_bios_initial_backlight=0.
please attach the output of "grep . /sys/module/video/parameters/*" if the problem still exists.
Comment 12 Louis 2010-11-03 21:01:38 UTC
Thank you very much for your patch, I'll try it this weekend. Looking to your code it seems a good workaround.

I would like to ask your opinion about the origin of this bug.
If you think that it's a BIOS bug I will report it to hp. Are you sure that it's not a kernel new BIOS models incompatibility? (i.e. new BIOS commands/function/controls...)

Thank you again, and in the next days I'll let you know if it solves the issue.
Comment 13 Zhang Rui 2010-11-04 02:13:57 UTC
Created attachment 36072 [details]
custom DSDT

If the patch works, we only know that BIOS exports minimum backlight values to OS.
To find the root cause why BIOS behaves in this way, please:
1. build a 2.6.36 kernel with this custom DSDT.
2. reboot with boot option "acpi.aml_debug_output=1"
3. you should get a dimming screen after system boot now, and save the dmesg
4. attach the dmesg output
Comment 14 Zhang Rui 2010-11-04 02:15:24 UTC
BTW: to apply a custom DSDT, you need to follow step 5,6 and 7 at 
http://www.lesswatts.org/projects/acpi/overridingDSDT.php
Comment 15 Louis 2010-11-06 10:33:52 UTC
(In reply to comment #11)
> patch: do not trust BIOS initial backlight
I just finished the test with gentoo kernel 2.6.34-r12, your patch works perfectly, the backlight is now preserved. Thanks very much!
Comment 16 Louis 2010-11-06 10:44:15 UTC
Created attachment 36302 [details]
dmesg from custom DSDT on gentoo kernel 2.6.36

Here you have the dmesg from gentoo kernel 2.6.36 using the custom DSDT table.

With this kernel I have two strange points to highlight:
1. with this kernel, considered unstable by gentoo, the backlight does not change during the boot. (I don't need to apply your patch)
2. the backlight buttons do not work anymore with this kernel!!!

Well, for me both points are correlated, I'm not sure about the actual quality of this gentoo kernel, maybe you can suggest me another one.
Comment 17 Zhang Rui 2010-11-08 01:38:10 UTC
please attach the output of "lspci -vvxxx".
Comment 18 Zhang Rui 2010-11-08 01:39:44 UTC
Created attachment 36622 [details]
custom DSDT

please try this DSDT instead.
Comment 19 Louis 2010-11-08 10:05:50 UTC
Created attachment 36712 [details]
lscpi -vvxxx
Comment 20 Louis 2010-11-08 10:08:05 UTC
Created attachment 36722 [details]
dmesg from custom DSDT on gentoo kernel 2.6.36

Here you have the new output.
Now backlight buttons work, and the blacklight issue returned.
Comment 21 Louis 2010-11-10 10:47:52 UTC
I don't know if here is the good place, maybe is correlated to the bios, but the suspend to raw doesn't work on this machine.
Comment 22 Zhang Rui 2010-12-16 06:31:11 UTC
Patch in comment #11 has been shipped in acpi test tree.

(In reply to comment #21)
> I don't know if here is the good place, maybe is correlated to the bios, but
> the suspend to raw doesn't work on this machine.

I guess you mean suspend to ram, right?
please file a new bug report about this issue.
Comment 23 Louis 2010-12-16 11:59:48 UTC
Thanks for reply.
Could you please confirm me if this issue is from my BIOs model or from kernel linux ACPI?
Thanks.
Comment 24 Len Brown 2011-01-20 05:48:39 UTC
shipped in 2.6.38-rc1:


commit 99fd1895ef603f1a0fa9af478c96c637a7b4529d
Author: Zhang Rui <rui.zhang@intel.com>
Date:   Mon Dec 6 15:04:27 2010 +0800

    ACPI video: introduce module parameter video.use_bios_initial_backlight
    
    Introduce module parameter video.use_bios_initial_backlight.
    
    Some BIOSes claim they use the minimum backlight at boot,
    and this may bring dimming screen after boot.
    https://bugzilla.kernel.org/show_bug.cgi?id=21212
    
    use video.use_bios_initl_backlight=0 to use
    the maximum backlight level after boot.
    
    Signed-off-by: Zhang Rui <rui.zhang@intel.com>

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