Bug 612413

Summary: intel [GM45] Xserver crash when switching from clone to extended screen mode (Assertion in libdrm)
Product: [openSUSE] openSUSE 11.4 Reporter: Johann-Nikolaus Andreae <johann-nikolaus.andreae>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED NORESPONSE QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Critical    
Priority: P3 - Medium CC: b.nolte, forgotten_--EoyBps8f, harbrink, wstephenson
Version: Factory   
Target Milestone: ---   
Hardware: x86   
OS: openSUSE 11.3   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: xorg.conf
Xorg.0.log old
kdm.log
libdrm-2.4.21-17.1.i586.rpm

Description Johann-Nikolaus Andreae 2010-06-08 06:25:06 UTC
User-Agent:       Mozilla/5.0 (compatible; Konqueror/4.4; Linux; de) KHTML/4.4.3 (like Gecko) SUSE

I have enabled the second monitor using Fn+F7 on ThinkPad T500
I use the KDE Display Settings to switch from the clone mode to extended screen mode.
After i click aply x.org crash and switch to the login screen.

/var/log/messages:
Jun  8 07:56:29 t500 kdm[1802]: X server for display :0 terminated unexpectedly

Reproducible: Always
Comment 1 Johann-Nikolaus Andreae 2010-06-08 06:26:16 UTC
The Graphic card is Inter GM45
Comment 2 Stefan Dirsch 2010-06-08 06:33:38 UTC
Would it be possible to provide the required information according
to our HOWTO

  http://en.opensuse.org/Bugs:X

for reporting X11 related bugs? Please set the Status back to
ASSIGNED after providing all the required information. Thanks.
Comment 3 Johann-Nikolaus Andreae 2010-06-08 08:08:05 UTC
Created attachment 367683 [details]
xorg.conf
Comment 4 Johann-Nikolaus Andreae 2010-06-08 08:10:21 UTC
Created attachment 367684 [details]
Xorg.0.log old
Comment 5 Johann-Nikolaus Andreae 2010-06-08 08:15:08 UTC
rpm --changelog -q libdrm | head -n3
* Fr Apr 09 2010 sndirsch@suse.de
- libdrm 2.4.20
  * /usr/include/drm/ --> /usr/include/libdrm/

rpm --changelog -q Mesa | head -n3
* Sa Apr 10 2010 sndirsch@suse.de
- removed legal check since affected source files no longer exist
- removed obsolete missing_Makefile.diff

rpm --changelog -q xorg-x11-server | head -n3
* So Mai 09 2010 sndirsch@suse.de
- xorg-detect-psb.patch
  * added "intellegacy" as fallback for "intel" (gets active if

rpm --changelog -q xorg-x11-driver-input | head -n3
* Fr Apr 23 2010 ro@suse.de
- drop 00-evdev.conf (now in xorg-x11-server)

rpm --changelog -q xorg-x11-driver-video | head -n3
* Fr Apr 30 2010 sndirsch@suse.de
- xf86-video-neomagic-commit-4e2afb8.diff
  * s/xf86UDelay/usleep/g (bnc #601119)

hwinfo --gfx
10: PCI 02.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.318]
  Unique ID: _Znp.6uDVd36s_Y3
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Model: "Mobile IntelĀ® GM45 Express Chipset"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x2a42 "Mobile IntelĀ® GM45 Express Chipset"
  SubVendor: pci 0x17aa "Lenovo"
  SubDevice: pci 0x2114 
  Revision: 0x07
  Driver: "i915"
  Driver Modules: "drm"
  Memory Range: 0xf4400000-0xf47fffff (rw,non-prefetchable)
  Memory Range: 0xd0000000-0xdfffffff (ro,non-prefetchable)
  I/O Ports: 0x1800-0x1807 (rw)
  IRQ: 32 (572654 events)
  I/O Ports: 0x3c0-0x3df (rw)
  Module Alias: "pci:v00008086d00002A42sv000017AAsd00002114bc03sc00i00"
  Driver Info #0:
    XFree86 v4 Server Module: intel
  Driver Info #1:
    XFree86 v4 Server Module: intel
    3D Support: yes
  Config Status: cfg=no, avail=yes, need=no, active=unknown

11: PCI 02.1: 0380 Display controller
  [Created at pci.318]
  Unique ID: ruGf.dKb7XvOWGA9
  SysFS ID: /devices/pci0000:00/0000:00:02.1
  SysFS BusID: 0000:00:02.1
  Hardware Class: graphics card
  Model: "Intel Mobile 4 Series Chipset Integrated Graphics Controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x2a43 "Mobile 4 Series Chipset Integrated Graphics Controller"
  SubVendor: pci 0x17aa "Lenovo"
  SubDevice: pci 0x2114 
  Revision: 0x07
  Memory Range: 0xf4200000-0xf42fffff (rw,non-prefetchable)
  Module Alias: "pci:v00008086d00002A43sv000017AAsd00002114bc03sc80i00"
  Config Status: cfg=no, avail=yes, need=no, active=unknown

Primary display adapter: #10

Hope this is all you need.
Comment 6 Stefan Dirsch 2010-06-08 08:29:06 UTC
Hmm. I don't see a crash in Xorg.0.log.old. Either this is not for the Xserver, which crashed or you had a Sig11/assertion in libdrm (dup of Bug #608149?). Could you check  /var/log/kdm.log? Please attach if it isn't that big. I mention this since I just noticed that mine has 1,4 GB. :-)
Comment 7 Johann-Nikolaus Andreae 2010-06-08 09:40:06 UTC
Created attachment 367718 [details]
kdm.log
Comment 8 Stefan Dirsch 2010-06-08 10:12:49 UTC
(In reply to comment #7)
> Created an attachment (id=367718) [details]
> kdm.log

Here we are:

Xorg: intel_bufmgr_gem.c:909: drm_intel_gem_bo_unreference: Assertion `((&bo_gem->refcount)->atomic) > 0' failed.
Comment 9 Stefan Dirsch 2010-06-11 12:35:40 UTC
Might already be fixed. Please retry with current X stack from obs://X11:XOrg.
Comment 10 Johann-Nikolaus Andreae 2010-06-15 09:42:50 UTC
It is not fixed.

The first change works but at the second it crash.

For example i can enable the multi monitor mode but if change now the screen resolution the chrash is happend.

Output in kdm.log is the same as in comment #8
Comment 11 Stefan Dirsch 2010-06-15 10:54:17 UTC
Created attachment 369214 [details]
libdrm-2.4.21-17.1.i586.rpm

libdrm update to release 2.4.21. Please give it a try.
Comment 12 Johann-Nikolaus Andreae 2010-06-15 16:25:20 UTC
With this version it crash at the first change.

Only the line number at kdm.log changed:
Xorg: intel_bufmgr_gem.c:918: drm_intel_gem_bo_unreference: Assertion
`((&bo_gem->refcount)->atomic) > 0' failed.
Comment 13 Stefan Dirsch 2010-06-15 17:07:01 UTC
Oh well.
Comment 14 Stefan Dirsch 2010-06-23 12:32:31 UTC
*** Bug 616684 has been marked as a duplicate of this bug. ***
Comment 15 Will Stephenson 2010-06-23 13:09:52 UTC
Just shout if you want me to test anything.
Comment 16 Stefan Dirsch 2010-06-24 15:07:46 UTC
I've just updated to latest libdrm git master in obs://X11:XOrg/libdrm, which fixes various issues in this area. So it would be good to test that. Package is
still building though or is even not schedules yet. RPM changelog:

Thu Jun 24 16:57:19 CEST 2010 - sndirsch@suse.de
- updated to git master commit #726210f
  * various tiling related fixes for intel
Comment 17 Stefan Dirsch 2010-06-25 15:54:59 UTC
I believe it would be worth a try to update to latest Mesa, libdrm and 
xorg-x11-driver-video packages from obs://X11:XOrg.
Comment 18 Stefan Dirsch 2010-07-21 02:24:28 UTC
Still waiting for a response for more than 3 weeks now. Please reopen once
you can provide the requested feedback. Thanks.
Comment 19 Will Stephenson 2010-07-21 06:47:34 UTC
Sorry, we had a baby on 25.6.  

The updated packages from obs://X11:XOrg only partially help.

I am now able to enable clone mode.

I can't extend the desktop onto the 2nd monitor (right-of etc) - instead I get clone mode.

If I try to disable LVDS1 and enable VGA1 (docking scenario) the X server hangs with last log line:

intel(0): Allocated new frame buffer 1600x1200 stride 8192, tiled

KMS is on, of course.  I tried nomodeset and get only one xrandr display 'default'.
Comment 20 Stefan Dirsch 2010-07-21 08:21:31 UTC
> Sorry, we had a baby on 25.6.  

My congratulations! :-)
Comment 21 Stefan Dirsch 2010-08-15 03:52:54 UTC
(In reply to comment #19)
> The updated packages from obs://X11:XOrg only partially help.
> 
> I am now able to enable clone mode.
> 
> I can't extend the desktop onto the 2nd monitor (right-of etc) - instead I get
> clone mode.

That's  bad.

> If I try to disable LVDS1 and enable VGA1 (docking scenario) the X server hangs
> with last log line:
> 
> intel(0): Allocated new frame buffer 1600x1200 stride 8192, tiled

This is even worse.

> KMS is on, of course.  I tried nomodeset and get only one xrandr display
> 'default'.

With nomodeset X falls back to fbdev/vesa, which doesn't support RANDR 1.2.
As workaround you might want to use the intellegacy driver (optional package
xorg-x11-drive-video-intellegacy). Then you need to use 'nomodeset' and edit
/etc/X11/xorg.conf.d/50-device.conf.
Comment 22 Will Stephenson 2010-08-15 05:35:14 UTC
*** Bug 626674 has been marked as a duplicate of this bug. ***
Comment 23 Will Stephenson 2010-08-15 07:03:28 UTC
I can get xrandr working again with nomodeset and intellegacy, but I am using Kernel:openSUSE-11.3 and X11:XOrg packages too.
Comment 24 Will Stephenson 2010-08-15 07:13:56 UTC
https://bugzilla.novell.com/show_bug.cgi?id=629113 is also intel drm related
Comment 25 Stefan Dirsch 2010-08-30 11:03:33 UTC
Updating to libdrm, Mesa, xorg-x11-server and xorg-x11-driver-video 
of obs://X11:XOrg might be worth a try. Hope this update doesn't 
make your issues worse.
Comment 26 Johann-Nikolaus Andreae 2010-09-01 08:41:49 UTC
At a quik test it seems that the crash is fixed.
In some cases xorg still crash but i can currend not verify that it is not bug 597078.

But there are some other bugs at the screen switching that it leve it unuseable.
- In some cases the resulution of the Leptop LCD is switched to the external resulution (not clone mode)
- xrandr did not detect the highest resulution of the external screen.
- In some cases i have only a half screen visible (LCD or external not both) mouse works on the full screen.
- The KDE desktop moved to the external screen. But this seems to be KDE relatet so i will report it there.

I test this funktion again in the next days to find out more details.
Comment 27 Stefan Dirsch 2010-09-01 08:48:57 UTC
(In reply to comment #26)
> At a quik test it seems that the crash is fixed.

Ok.

> In some cases xorg still crash but i can currend not verify that it is not bug
> 597078.

Bug #597078 is not a crash (ie not a segfault or assertion), but a freeze. So are you really talking about a crash?

> But there are some other bugs at the screen switching that it leve it
> unuseable.
> - In some cases the resulution of the Leptop LCD is switched to the external
> resulution (not clone mode)
> - xrandr did not detect the highest resulution of the external screen.
> - In some cases i have only a half screen visible (LCD or external not both)
> mouse works on the full screen.

IMHO seperate issues should be handled in seperate bugreports. Otherwise bugs can never be closed.

> - The KDE desktop moved to the external screen. But this seems to be KDE
> relatet so i will report it there.

I guess so as well.

Will, can you confirm that the libdrm assertion is fixed now? But make sure
you disable desktop effects. Otherwise it's rather likely that the Xserver crashes immediately during login. :-(
Comment 28 Will Stephenson 2010-09-01 12:02:50 UTC
Yes, i can switch displays without the libdrm assertion.  Effects disable themselves already with 1.9 because they fail the performance test :/.

However, LVDS1 remains on but frozen after switching it over with Fn+F7.  With an atomic xrandr command to switch it off and VGA1 to auto this does not happen.
Comment 29 Stefan Dirsch 2010-09-01 12:05:55 UTC
Ok. So should we close that one and open various other bugreports? :-(
Comment 30 Stefan Dirsch 2010-11-05 19:32:49 UTC
Any improvements with latest updates from obs://X11:XOrg and obs://Kernel:HEAD?

zypper ar -f \
  http://download.opensuse.org/repositories/Kernel:/HEAD/openSUSE_11.3/ \
  Kernel:HEAD
zypper ar -f \
  http://download.opensuse.org/repositories/X11:/XOrg/openSUSE_11.3/ \
  X11:XOrg
zypper mr -p 90 Kernel:HEAD
zypper mr -p 90 X11:XOrg
zypper ref -r Kernel:HEAD
zypper ref -r X11:XOrg
zypper dup -r Kernel:HEAD
zypper dup -r X11:XOrg
zypper in xorg-x11-server-debuginfo xorg-x11-server-debugsource \
          xorg-x11-driver-video-debuginfo xorg-x11-driver-video-debugsource \
          xorg-x11-driver-input-debuginfo xorg-x11-driver-input-debugsource \
          libpixman-1-0-debuginfo libpixman-1-0-debugsource \
          libpciaccess0-debuginfo libpciaccess0-debugsource
Comment 31 Will Stephenson 2010-11-09 10:42:48 UTC
Well, compositing works again.  Otherwise comment 28 is still accurate.
Comment 32 Stefan Dirsch 2010-12-20 21:24:34 UTC
A lot of changes meanwhile in DRM, xf86-video-intel, libdrm, Mesa. So things might have improved. Could you verify whether your issues are still remaining
when updating X11:XOrg and Kernel:HEAD once more?

zypper dup -r Kernel:HEAD
zypper dup -r X11:XOrg
Comment 33 Stefan Dirsch 2011-01-13 02:02:41 UTC
Still waiting for a response for more than 3 weeks now. Please reopen once
you can provide the requested feedback. Thanks.