Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 284033 - backlight doesn't switch off on lid closed, while backlight control buttons do work.
Summary: backlight doesn't switch off on lid closed, while backlight control buttons d...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-07 20:58 UTC by Morse
Modified: 2009-11-13 01:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
.config (.config,53.68 KB, text/plain)
2009-09-07 21:03 UTC, Morse
Details
dmesg kernel-2.6.31-gentoo (dmesg_f,45.37 KB, text/plain)
2009-09-28 10:27 UTC, Morse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Morse 2009-09-07 20:58:13 UTC
kernel: gentoo-sources-2.6.30-r5
vanilla-sources-2.6.30.5 & 2.6.31_rc9 also affected

the problem seems to be with acpi/video module. if i boot with "acpi=off" everything works fine.

I used to have gentoo-x86-64 on that very laptop, and the kernel was 2.6.29, and everything worked there. then i was forced to reinstall my system completely, i installed 2.6.30 (x86) and the backlight broke. i don't know what went wrong, but the fact is: backlight did work on my system.

both /proc/acpi/button/lid... and /sys/class/backlight/... shows the correct values

another weird thing: gnome-screensaver blanks display, but doesn't switch off backlight. console blanker (or whatever) does switch off the backlight, but after it resumed it has minimal brightness.

Reproducible: Always

Steps to Reproduce:
1. get HP COMPAQ nc6320
2. emerge gentoo-sources-2.6.30-r6
3. close the lid (or just press corresponding button)

Actual Results:  
nothing happens

Expected Results:  
backlight off, lcd blanked

laptop HP Compaq nc6320
video - intel 945GM

Portage 2.1.6.13 (default/linux/x86/10.0, gcc-4.4.1, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r6 i686)
=================================================================
System uname: Linux-2.6.30-gentoo-r6-i686-Intel-R-_Core-TM-2_CPU_T5600_@_1.83GHz-with-gentoo-2.0.1
Timestamp of tree: Mon, 07 Sep 2009 12:00:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=core2 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O3 -march=core2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ ftp://mirror.yandex.ru/gentoo-distfiles/"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en_US ru"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa automount berkdb bzip2 cairo cdrtools cli cracklib crypt cups dbus dhcp directfb djvu dri dri2 eselect exif fat fbcon fbcondecor ffmpeg fortran fuse gdbm geoip gif gnome gpm gstreamer gtk hal iconv ipv6 isdnlog java java6 jpeg laptop lzo mmx mmxext mudflap nautilus ncurses networkmanager nls nptl nptlonly nsplugin ntfs opengl openmp pam pcre perl png ppp pppd python readline reflection samba session sha smb spl sse sse2 sse3 ssl ssse3 svg svga sysfs tcpd tiff totem trayicon truetype unicode utf8 wxwidgets wxwindows x86 xcb xcomposite xfs xorg xv zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_US ru" USERLAND="GNU" VIDEO_CARDS="intel vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Morse 2009-09-07 21:03:34 UTC
Created attachment 203413 [details]
.config

my current config
Comment 2 George Kadianakis (RETIRED) gentoo-dev 2009-09-24 15:42:07 UTC
(In reply to comment #0)
> kernel: gentoo-sources-2.6.30-r5
> vanilla-sources-2.6.30.5 & 2.6.31_rc9 also affected
> 
> the problem seems to be with acpi/video module. if i boot with "acpi=off"
> everything works fine.
> 
> I used to have gentoo-x86-64 on that very laptop, and the kernel was 2.6.29,
> and everything worked there. then i was forced to reinstall my system
> completely, i installed 2.6.30 (x86) and the backlight broke. i don't know what
> went wrong, but the fact is: backlight did work on my system.
> 
> both /proc/acpi/button/lid... and /sys/class/backlight/... shows the correct
> values
> 

So, if you cat /proc/acpi/button/lid/*/state when the lid is closed you are gonna get 'state: closed'?

If you boot with 2.6.29 right now (without upgrading packages) the backlight will be working?

Can you attach a copy of your dmesg after closing and reopening the lid, and a copy of your /var/log/acpid before closing the lid and another copy of your /var/log/acpid after reopening the lid.

Thanks!
Comment 3 Federico Ferri (RETIRED) gentoo-dev 2009-09-24 23:32:43 UTC
are you using laptop-mode? is laptop-mode started?
sorry for the stupid question but you didn't mention it.

in my case, I have this lid problem too (gentoo-sources-2.6.31), and starting laptop-mode didn't help. `laptop_mode status` shows correctly the status of acpi peripherals, including showing correctly the status of the lid, but it seems that `laptop_mode` script doesn't react to the change (even calling it manually)

as a workaround, I've replaced the default acpi action for lid event with this (it's for radeon card, if you want to use it with intel card, you may want to find how to turn off/on backlight for your card):

#! /bin/sh

# AC adapter state (off-line / on-line)
AC_STATE=$(awk '/^state:/{print $2}' /proc/acpi/ac_adapter/AC/state)
# LID state (open / closed)
LID_STATE=$(awk '/^state:/{print $2}' /proc/acpi/button/lid/LID/state)

if [ "x$LID_STATE" = "xopen" ]; then
        radeontool light on
elif [ "x$AC_STATE" = "xoff-line" ]; then
        if [ "x$LID_STATE" = "xclosed" ]; then
                radeontool light off
        fi
fi
Comment 4 Morse 2009-09-25 18:27:30 UTC
(In reply to comment #2)
> So, if you cat /proc/acpi/button/lid/*/state when the lid is closed you are
> gonna get 'state: closed'?

exactly.

> If you boot with 2.6.29 right now (without upgrading packages) the backlight
> will be working?

i emerged 2.6.29-r6, configured and builded it. there was no module "acpi/video" (CONFIG_ACPI_VIDEO in .30 & .31), so i couldn't build the same config (but everything else is the same). backlight worked well, but intel's modesetting (CONFIG_DRM_I915_KMS) makes console broke (it is: i see anithing sane only in X).

> Can you attach a copy of your dmesg after closing and reopening the lid, and a
> copy of your /var/log/acpid before closing the lid and another copy of your
> /var/log/acpid after reopening the lid.

that's dmesg (first 4 lines - on close, last on open)
[  884.315401] [drm] TV-14: set mode NTSC 480i 0
[  884.456888] [drm] TV-14: set mode NTSC 480i 0
[  884.726479] [drm] TV-14: set mode NTSC 480i 0
[  884.867636] [drm] TV-14: set mode NTSC 480i 0
[  890.812418] [drm] TV-14: set mode NTSC 480i 0
[  890.953688] [drm] TV-14: set mode NTSC 480i 0
[  891.223391] [drm] TV-14: set mode NTSC 480i 0
[  891.364469] [drm] TV-14: set mode NTSC 480i 0

can't provide you with /var/log/acpid as i don't have one.


(In reply to comment #3)
> are you using laptop-mode? is laptop-mode started?
> sorry for the stupid question but you didn't mention it.

i tried laptop-mode once, but i didn't understand what it do so i unmerged it.

> as a workaround .....

yep, i did try some workarounds myself including xset and vbetool. but first only works when X started, and second in contrary doesn't work when X screen is active. besides every event (e.g. libnotify) maked backlight back on, and sometimes script didn't work properly doing the wrong action ("status" in /proc/acpi/... updated too late). and another thing: i want full monitor blanking - including LCD, not just backlight, although backlight is of course the main power consumer.
so i'm still where i was.
Comment 5 George Kadianakis (RETIRED) gentoo-dev 2009-09-28 02:20:51 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > So, if you cat /proc/acpi/button/lid/*/state when the lid is closed you are
> > gonna get 'state: closed'?
> 
> exactly.
> 
> > If you boot with 2.6.29 right now (without upgrading packages) the backlight
> > will be working?
> 
> i emerged 2.6.29-r6, configured and builded it. there was no module
> "acpi/video" (CONFIG_ACPI_VIDEO in .30 & .31), so i couldn't build the same
> config (but everything else is the same). backlight worked well, but intel's
> modesetting (CONFIG_DRM_I915_KMS) makes console broke (it is: i see anithing
> sane only in X).
> 
> > Can you attach a copy of your dmesg after closing and reopening the lid, and a
> > copy of your /var/log/acpid before closing the lid and another copy of your
> > /var/log/acpid after reopening the lid.
> 
> that's dmesg (first 4 lines - on close, last on open)
> [  884.315401] [drm] TV-14: set mode NTSC 480i 0
> [  884.456888] [drm] TV-14: set mode NTSC 480i 0
> [  884.726479] [drm] TV-14: set mode NTSC 480i 0
> [  884.867636] [drm] TV-14: set mode NTSC 480i 0
> [  890.812418] [drm] TV-14: set mode NTSC 480i 0
> [  890.953688] [drm] TV-14: set mode NTSC 480i 0
> [  891.223391] [drm] TV-14: set mode NTSC 480i 0
> [  891.364469] [drm] TV-14: set mode NTSC 480i 0
> 
> can't provide you with /var/log/acpid as i don't have one.
> 
> 
> (In reply to comment #3)
> > are you using laptop-mode? is laptop-mode started?
> > sorry for the stupid question but you didn't mention it.
> 
> i tried laptop-mode once, but i didn't understand what it do so i unmerged it.
> 
> > as a workaround .....
> 
> yep, i did try some workarounds myself including xset and vbetool. but first
> only works when X started, and second in contrary doesn't work when X screen is
> active. besides every event (e.g. libnotify) maked backlight back on, and
> sometimes script didn't work properly doing the wrong action ("status" in
> /proc/acpi/... updated too late). and another thing: i want full monitor
> blanking - including LCD, not just backlight, although backlight is of course
> the main power consumer.
> so i'm still where i was.
> 

There are many reports about oopses/hangs when closing the lid on 2.6.30 kernels (see: http://bugzilla.kernel.org/show_bug.cgi?id=13751).
Even tho you are not getting such issues, would you mind trying out this patch:
http://bugzilla.kernel.org/attachment.cgi?id=22528 ?

Also, post a full copy of your dmesg if that patch doesn't work.

Thanks :)
Comment 6 Morse 2009-09-28 10:27:33 UTC
Created attachment 205453 [details]
dmesg kernel-2.6.31-gentoo
Comment 7 Morse 2009-09-28 10:41:33 UTC
i tried to apply a patch http://bugzilla.kernel.org/attachment.cgi?id=22528, but i couldn't. then i looked at the page from where it came (http://bugzilla.kernel.org/show_bug.cgi?id=13751), and saw:

>74b5820808215f65b70b05a099d6d3c969b82689
>ACPI: bind workqueues to CPU 0 to avoid SMI corruption
>shipped in v2.6.31-rc6
>
>closed.

as i currently have 2.6.31 it's already applied for me. i even checked the /driver/acpi/osl.c to be sure.

another thing may be relaited - that's the log from lshw:

*-display:0
     description: VGA compatible controller
     product: Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller
     vendor: Intel Corporation
     physical id: 2
     bus info: pci@0000:00:02.0
     version: 03
     width: 32 bits
     clock: 33MHz
     capabilities: msi pm vga_controller bus_master cap_list
     configuration: driver=i915 latency=0 module=drm
*-display:1 UNCLAIMED
     description: Display controller
     product: Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller
     vendor: Intel Corporation
     physical id: 2.1
     bus info: pci@0000:00:02.1
     version: 03
     width: 32 bits
     clock: 33MHz
     capabilities: pm bus_master cap_list
     configuration: latency=0

the first device - "VGA compatible controller" is detected normally, but the second one - "Display controller" marked "unclaimed".
Comment 8 George Kadianakis (RETIRED) gentoo-dev 2009-09-29 03:08:51 UTC
What happens:
a) When you boot 2.6.30 with CONFIG_DRM_I915_KMS _disabled_ and you close the lid? Does the backlight switch off or not? Does your dmesg have any more info with KMS disabled (apart from the ones you posted in your previous comments)?
b) When you boot 2.6.30 without CONFIG_ACPI_VIDEO? It works alright?

By the way, the "[drm] TV-14: set mode NTSC 480i 0" warnings seem to be fixed in 2.6.31-23 (https://bugzilla.redhat.com/show_bug.cgi?id=522909 and https://bugzilla.redhat.com/show_bug.cgi?id=522611)
Comment 9 Morse 2009-09-29 10:28:32 UTC
CONFIG_DRM_I915_KMS doesn't influence on backlight. as of CONFIG_ACPI_VIDEO - i can't just disable it - i915 has it as dependency. there are two ways
1) to disable the whole intel DRM (agp, i915) enabling VESA instead, and then disable acpi/video/.
2) to boot with "acpi=off".
backlight would work either way
Comment 10 George Kadianakis (RETIRED) gentoo-dev 2009-09-29 14:11:13 UTC
I think that "[Firmware Bug]: ACPI: ACPI brightness control misses _BQC function" in your dmesg is quite important. I'll read about the _BQC function and get back with you soon.

For now, make sure, you enable CONFIG_ACPI_DEBUG and see if you get a "Found generic backlight support". As a matter of fact just attach your whole dmesg...
Also, please, attach the dmesg of a 2.6.29-r6 kernel (which should work for you) with CONFIG_ACPI_DEBUG enabled after closing and reopening the lid.

Thanks!
Comment 11 George Kadianakis (RETIRED) gentoo-dev 2009-09-29 15:03:22 UTC
Also, use acpi_listen and close/open the lid to see what kind of ACPI events you get and post them here. 

Thanks!
Comment 12 George Kadianakis (RETIRED) gentoo-dev 2009-09-30 01:48:23 UTC
Finally, and sorry for the multiple replies, can you attach the ACPI script that should be turning on/off your backlight?
Comment 13 Morse 2009-10-01 11:31:24 UTC
somehow i managed to broke my X-system, so i'm out to fix this for a couple of days. also there is a new release of a package (sort of) of intel's video system (http://intellinuxgraphics.org/2009Q3.html) but it needs 2.6.32 kernel, so i'll wait for it and will post here if the problem will remain.
Comment 14 George Kadianakis (RETIRED) gentoo-dev 2009-10-02 14:53:29 UTC
(In reply to comment #13)
> somehow i managed to broke my X-system, so i'm out to fix this for a couple of
> days. also there is a new release of a package (sort of) of intel's video
> system (http://intellinuxgraphics.org/2009Q3.html) but it needs 2.6.32 kernel,
> so i'll wait for it and will post here if the problem will remain.
> 

I found this on the new Intel's video driver release changelog:
* Add support for BACKLIGHT property. This allows backlight adjustment with programs such as "xbacklight -set " or "xrandr --set BACKLIGHT ": bug#20963.
If your ACPI script was using xbacklight or xrandr to turn the backlight off, the new release may fix your problem. 
https://bugs.freedesktop.org/show_bug.cgi?id=20963 includes a patch and a couple of hotfixes that you can try if you like :)