Bug 26064

Summary: [945GM] openarena hangs with new DRI2 bits
Product: xorg Reporter: zhao jian <jian.j.zhao>
Component: Driver/intelAssignee: Carl Worth <cworth>
Status: VERIFIED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: critical    
Priority: high CC: jbarnes, xunx.fang
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg.0.log
none
dmesg file
none
gpu dump after openarena hangs X
none
gen3 display flip cmd none

Description zhao jian 2010-01-15 06:19:58 UTC
Created attachment 32659 [details]
xorg.0.log

System Environment:
--------------------------
Libdrm:		(master)d920fa9d0b54873d53f03a006d0fe3df11136b74
Mesa:		(master)aeb34b248903f98559209db4f095d1096ecb580a
Xserver:		(master)032f97808c65771a07bac748212cf6457a5d1660
Xf86_video_intel:	(master)4902f546be19e3d5bb47f6c75e2199dc4856c0f4


Bug detailed description:
-------------------------
run the 3D game openarena will crash on 945GM with some error message: 
(EE) intel(0): [DRI2] DRI2SwapBuffers: driver failed to schedule swap
X Error of failed request:  BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request:  135 (DRI2)
  Minor opcode of failed request:  8 ()
  Resource id in failed request:  0x600013
  Serial number of failed request:  41
  Current serial number in output stream:  41
And on G45 there is a 10% regression. I bisected it and find it was caused by a new commit in 2D driver. 

commit 51c75906329a4727e37c8d1f64f257ea9602caa2
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Fri May 1 14:52:26 2009 -0700

    DRI2: support new DRI2 APIs

    The new interfaces allow for improved buffer swap, and support for the
    SGI_swap_control, SGI_video_sync and OML_sync_control GLX extensions.

    The Intel implementation allows page flipping to occur for swaps that
    are full screen and not rotated.

    Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Reproduce steps:
--------------------
1. xinit& 
2. openarena exec stress_bases3
Comment 1 Gordon Jin 2010-01-18 00:18:03 UTC

*** This bug has been marked as a duplicate of bug 26053 ***
Comment 2 Gordon Jin 2010-02-07 22:11:36 UTC
The error has been fixed (as bug#26053), but the performance issue remains on G45 now.
Comment 3 zhao jian 2010-02-08 00:50:52 UTC
With the newest code, the game of openarena and ut2004 still hangs on 945GM instead of crashing.
Comment 4 Jesse Barnes 2010-02-08 16:34:58 UTC
Updating summary.  Are you including this patch in your kernel as well?  http://patchwork.kernel.org/patch/77272/

That's needed to prevent kernel hangs.
Comment 5 Gordon Jin 2010-02-08 16:58:11 UTC
(In reply to comment #4)
> Updating summary.  Are you including this patch in your kernel as well? 
> http://patchwork.kernel.org/patch/77272/

We don't include it if it's not in drm-intel-next.
Isn't it for Ironlake?
Comment 6 Jesse Barnes 2010-02-08 16:59:42 UTC
No, this one was a bug fix.  It's been out of tree for awhile because it needed some detailed review.  It's on its way into drm-intel-next now though, since krh and ickle have acked it.
Comment 7 zhao jian 2010-02-08 21:32:05 UTC
(In reply to comment #4)
> Updating summary.  Are you including this patch in your kernel as well? 
> http://patchwork.kernel.org/patch/77272/
> That's needed to prevent kernel hangs.

Is that patch will work for 945GM and other platforms other than Ironlake? I have patched it to drm-intel-next, but the openarena still hangs. 
Comment 8 Jesse Barnes 2010-02-10 09:09:18 UTC
Just tested on my 945GM machine (AspireOne), works fine under both Moblin and plain X with just an xterm running.  My bits:

  libdrm: fdcde592c2c48e143251672cf2e82debb07606bd
  mesa: dbc13401915b345df584a621b1b2aaa9030bfac5
  xserver: db687f718f760ba254ab51994769db101dc9ca3a
  xf86-video-intel: 41784e15d39c29af5a87fe8d0982bd1b0be3562d

trying with a current drm-intel-next kernel now.
Comment 9 Jesse Barnes 2010-02-10 09:14:45 UTC
Also works with drm-intel-next, current head:

commit 0d0e2fee9d6f03a481fa213c3db5171c66e7f7cc
Author: Matthew Garrett <mjg59@srcf.ucam.org>
Date:   Tue Feb 2 18:30:47 2010 +0000

    drm/i915: add dynamic performance control support for Ironlake
    drm/i915: Deobfuscate the render p-state obfuscation

What else could be different between our configs?
Comment 10 fangxun 2010-02-22 00:42:42 UTC
Created attachment 33485 [details]
dmesg file

With current code, openarena still hangs on i915 platform(AspireOne,945GM,965GM). It works well on i965 platform(G45,Piketon,calpella).

while the game hangs, pkill X and some error message as below:

gnome-screensaver: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
X: intel_bufmgr_gem.c:837: drm_intel_gem_bo_unreference: Assertion `((&bo_gem->refcount)->atomic) > 0' failed.
Comment 11 fangxun 2010-02-22 03:32:54 UTC
(In reply to comment #10)
> Created an attachment (id=33485) [details]
> dmesg file
> With current code, openarena still hangs on i915
> platform(AspireOne,945GM,965GM). It works well on i965
> platform(G45,Piketon,calpella).
> while the game hangs, pkill X and some error message as below:
> gnome-screensaver: Fatal IO error 11 (Resource temporarily unavailable) on X
> server :0.0.
> X: intel_bufmgr_gem.c:837: drm_intel_gem_bo_unreference: Assertion
> `((&bo_gem->refcount)->atomic) > 0' failed.

Sorry for my mistake. Openarena and ut2004 hangs on 965gm. Ut2004 hangs on calpella(openarena works fine). So that I think it works well on i965platform is wrong. It seems that only G45 and piketon is good. 
Comment 12 zhao jian 2010-02-25 00:03:04 UTC
Created attachment 33555 [details]
gpu dump after openarena hangs X
Comment 13 Wang Zhenyu 2010-03-09 00:26:47 UTC
Reassign to default owner...i915 stuff looks strange to me now, as buried under ironlake/snb stuff for quite long time. It looks I only have found maybe a little problem as showed in following patch, but it may not be the cause of this. Definitely need dri2 expert on this one. 
Comment 14 Wang Zhenyu 2010-03-09 00:27:55 UTC
Created attachment 33875 [details] [review]
gen3 display flip cmd

Looks like mi display flip cmd for Gen3 has different format, but surely doesn't fix this bug anyway.
Comment 15 Wang Zhenyu 2010-03-09 00:29:15 UTC
*** Bug 26162 has been marked as a duplicate of this bug. ***
Comment 16 Gordon Jin 2010-03-11 00:08:39 UTC
This problem has gone with the latest code since March 6th.

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.