Bug 5665

Summary: All ACPI events interpreted as input, breaking DPMS / input timeouts
Product: xorg Reporter: Kevin Shanahan <kevin>
Component: Server/GeneralAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high CC: danielle, esigra, mitch, mlists, ninex, shrek
Version: 6.9.0Keywords: regression
Hardware: x86 (IA32)   
OS: Linux (All)   
URL: http://lists.freedesktop.org/archives/xorg/2006-January/012304.html
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 6666    

Description Kevin Shanahan 2006-01-20 13:25:58 UTC
When the laptop screen is switched off (e.g. using 'xset dpms force off'), the
backlight comes back on again after a few seconds (usually between 2 and 10
seconds) though the screen stays blank.

I'm using the Debian packages of xorg 6.9.
Downgrading to 6.8.2 makes the problem go away.

I'm using the ati/radeon driver, though I'm not sure if it's specific to that,
so I'll put this under Server/general. Some details of my config are below:

# lspci | grep VGA
0000:00:04.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY

-- xorg.conf:

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"

Section "Files"
	RgbPath      "/usr/X11R6/lib/X11/rgb"
	ModulePath   "/usr/X11R6/lib/modules"
	FontPath     "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
	FontPath     "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
	FontPath     "/usr/X11R6/lib/X11/fonts/misc:unscaled"
	FontPath     "/usr/X11R6/lib/X11/fonts/TTF/"
	FontPath     "/usr/X11R6/lib/X11/fonts/Type1/"
	FontPath     "/usr/X11R6/lib/X11/fonts/CID/"
	FontPath     "/usr/X11R6/lib/X11/fonts/75dpi/"
	FontPath     "/usr/X11R6/lib/X11/fonts/100dpi/"
	FontPath     "/usr/X11R6/lib/X11/fonts/misc/"

Section "Module"
	Load  "extmod"
	Load  "glx"
	Load  "dri"
	Load  "dbe"
	Load  "record"
	Load  "xtrap"
	Load  "type1"
	Load  "freetype"

Section "Extensions"
	Option	"RENDER"	"Enable"
#	Option	"Composite"	"Enable"

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"

Section "Monitor"
	#DisplaySize	  230   110	# mm
	DisplaySize  300 145 # mm (faked, but in proportion)
	Identifier   "Monitor0"
	VendorName   "TOS"
	ModelName    ""
	Option	    "DPMS"

Section "Device"
	Identifier  "Card0"
	Driver      "ati"
	VendorName  "ATI Technologies Inc"
	BoardName   "Radeon Mobility M6 LY"
	BusID       "PCI:0:4:0"
	Option	    "DPMS"
	Option      "AccelMethod" "exa"

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	SubSection "Display"
		Viewport   0 0
		Depth     4
	SubSection "Display"
		Viewport   0 0
		Depth     8
	SubSection "Display"
		Viewport   0 0
		Depth     15
	SubSection "Display"
		Viewport   0 0
		Depth     16
	SubSection "Display"
		Viewport   0 0
		Depth     24

Section "DRI"
	Mode	0666
Comment 1 Kevin Shanahan 2006-01-20 13:59:48 UTC
Please note these suggestions and tests already carried out:
Comment 2 Kevin Shanahan 2006-01-22 09:59:17 UTC
Okay, Felix says it looks like a driver bug, so reassigning to componenet
- http://lists.freedesktop.org/archives/xorg/2006-January/012446.html
Comment 3 Alex Deucher 2006-01-26 01:08:02 UTC
It could be a battery acpi event or a laptop specific bios event.  I've heard of
some users that had this sort of thing wake their PCs.
Comment 4 Kevin Shanahan 2006-01-26 08:21:11 UTC
I can see this coming up regularly in acpid.log:

[Thu Jan 26 07:53:54 2006] received event "battery BAT1 00000080 00000001"
[Thu Jan 26 07:53:54 2006] notifying client 3267[0:0]
[Thu Jan 26 07:53:54 2006] completed event "battery BAT1 00000080 00000001"

Could this be causing X to wake up the screen for any reason? As I say, the
problem doesn't occur with xorg-6.8.2 so something must have changed.
Comment 5 Kevin Shanahan 2006-01-29 12:48:12 UTC
If I start the server from the console using "startx -- -noacpi" DPMS works
again (the screen stays switched off when I ask it to). The only events showed
when I run acpi_listen are the battery events.

According to xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c all
events that don't start with "video" should be getting ignored. Hopefully I'm
looking in the right place, but I'm going to start inserting some debug
statements to learn what's going on. Any tips appreciated.
Comment 6 Kevin Shanahan 2006-01-31 07:11:59 UTC
Okay, I've now narrowed it down to the call to DPMSSet in
xc/programs/Xserver/os/WaitFor.c. For some reason, the acpi battery events are
causing this to trigger. At this stage I'm getting out of my depth and need some
Comment 7 Kevin Shanahan 2006-01-31 18:27:01 UTC
Okay, maybe I see now what's going on. In
xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_acpi.c::lnxACPIOpen, the
ACPI socket fd is registered as an input handler. When we're in
WaitForSomething, this fd will become readable, and immediately the DPMSSet()
call is made. There is no opportunity to see if the event handler
(xf86HandlePMEvents) is going to discard the event or not (as it would for a
battery event).

So with the current structure, a battery status change registers as an input
event, screwing with DPMS.

I think that establishes well enought that it's not a Radeon bug, so I'm going
to change the component to Server/general and re-title to something perhaps more
descriptive of the underlying problem.
Comment 8 Mitch 2006-02-27 09:15:23 UTC
P.s. I'm seeing this on nvidia using the free 'nv' driver also on my Toshiba
tecra M2. I think you're right this is not a radeon specific issue
Comment 9 Michel Dänzer 2006-05-16 15:50:57 UTC
*** Bug 6931 has been marked as a duplicate of this bug. ***
Comment 10 Alan Hourihane 2006-06-19 06:07:36 UTC
*** Bug 7264 has been marked as a duplicate of this bug. ***
Comment 11 Adam Jackson 2006-10-01 20:33:47 UTC
I think Kevin's analysis in comment #7 is correct.  This is definitely a release
blocker for 7.2.
Comment 12 Daniel Stone 2006-11-04 09:44:04 UTC
we have AddGeneralSocket() now in master; it's a pretty simple change.
Comment 13 Daniel Stone 2006-11-08 05:27:41 UTC
fixed in master
Comment 14 Erik 2007-01-28 14:29:32 UTC
Could someone please take a look at Gentoo bug #150028 [http://bugs.gentoo.org/show_bug.cgi?id=150028] and tell if this is the same problem?
Comment 15 Grzegorz {NineX} Krzystek 2007-01-29 00:25:01 UTC
(In reply to comment #14)
> Could someone please take a look at Gentoo bug #150028
> [http://bugs.gentoo.org/show_bug.cgi?id=150028] and tell if this is the same
> problem?

yes it's the same bug
Comment 16 Danielle Madeley 2007-03-10 07:29:39 UTC
This might still be broken after a suspend/resume (S3).
Comment 17 Danielle Madeley 2007-04-07 22:52:54 UTC
Yeah, this is fixed just as long as you don't suspend/resume your machine. When you first power up, things are fine, after you come back from an S3 resume the LCD refuses to go to sleep.
Comment 18 Daniel Stone 2007-04-08 01:21:25 UTC
obviously it's not adding the acpi pipe as an input handler after (but only after) s3, and adding it as a general handler before s3: you've encountered another bug.  please open a new one on whichever driver you use, attaching xorg.0.log and xorg.conf.
Comment 19 Danielle Madeley 2007-04-08 01:52:51 UTC
Ok. Filed as bug #10565

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.