Bug 64940

Summary: [SNA]mesa xdemo/glxdemo get black window under gnome-shell
Product: xorg Reporter: fangxun <xunx.fang>
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: VERIFIED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: major    
Priority: high    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Invalidate DRI2Buffers upon SetPixmap none

Description fangxun 2013-05-24 06:34:16 UTC
System Environment:
--------------------------
Platform:    Ivybridge
Libdrm:   (master)libdrm-2.4.45-3-g3586337f3703ce4833a375f66b08df064a1cec28
Mesa:    (9.1)cbe0e50247c909a7d34f71d9a1a4852b6c3af472
Xserver:    (master)7e97166c4fc38076b6224e4dbdd632b43444149f
Xf86_video_intel: (master)2.21.6-47-gd6c30d1d4df6bcdfa075bd29da7c8aabee20774c
Kernel: 3.9.3

Bug detailed description:
-------------------------
Start X and compositing window manager(gnome3), glxdemo works good in EXA, but get black window in SNA. It also works fine in SNA without window manager. 
Below cases have the same problem as glxdemo:
demos/projtex
xdemos/xfont
xdemos/xrotfontdemo
tests/readrate
tests/texleak
glsl/convolutions

Reproduce steps:
----------------
1. xinit&
2. gnome-session&
3. run glxdemo
Comment 1 Chris Wilson 2013-05-24 09:39:22 UTC
I have tried this on a few machines (debian sid, ubuntu saucy, fedora 18) with both stock and git master mesa, and it all works.
Comment 2 Chris Wilson 2013-05-24 13:44:01 UTC
Now also checked using master of mesa and Xorg on SNB.
Comment 3 Gordon Jin 2013-05-27 08:58:56 UTC
Chris, what info do you need Xun to provide?
Comment 4 Chris Wilson 2013-05-27 09:05:22 UTC
Verification of the reproduction steps since it works for me on all machines and setups that I've tried.
Comment 5 fangxun 2013-05-28 06:23:08 UTC
I test all our machines, and find it works on kwin, metacity and unity. 
For fedora machines, it fails on fedora16 with gnome-shell(verion 3.2.1), and it works on fedora17 with gnome-shell(3.4.1). I install a new fedora18 machine, and find it also fails with gnome-shell(3.6.2). 

It seems this problem is related to gnome-shell version.

I verified following reproduction steps on fedora 16 or fedora18.
1. enable SNA on xorg.conf
2. xinit&
3. start gnome-shell or gnome-session
4. run glxdemo
Comment 6 Chris Wilson 2013-06-09 09:27:19 UTC
Have you tried with mesa master and this xserver patch: http://patchwork.freedesktop.org/patch/13819/ ?
Comment 7 fangxun 2013-06-18 03:35:35 UTC
It also fails with mesa master and this xserver patch.
Comment 8 Chris Wilson 2013-06-23 10:46:07 UTC
Created attachment 81263 [details] [review]
Invalidate DRI2Buffers upon SetPixmap

Another patch for the xserver to test.
Comment 9 Gordon Jin 2013-07-18 14:05:46 UTC
Xun, please try the patch.
Comment 10 Chris Wilson 2013-07-25 19:15:48 UTC
Were you using SwapbuffersWait disable?

If so you were definitely encountering the race fixed by the attached patch above. However, that race should also be worked around by:

commit 6f5fd772c7ca656b86394a0f036d4e0cf5b33d8e
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Jul 25 08:29:55 2013 +0100

    sna/dri: Discard the strict checking for stale bo before performing a blit
    
    Instead of checking that the DRI2Buffers match up with the current
    DRI2Drawable, clip the area that is being copied to the minimum extents
    of the Drawable, source and destination buffers. This ensures that we
    never read nor write beyond the extents of the allocated or visible
    regions.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67210
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67305
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Comment 11 Chris Wilson 2013-07-27 16:41:02 UTC
My guess is that this is the DRI2Invalidate bug, masked by the current w/a in -intel.git.
Comment 12 Chris Wilson 2013-08-11 11:47:33 UTC
The underlying bug should be masked by recent SNA.
Comment 13 fangxun 2013-08-12 07:28:28 UTC
Apologies for my delay in responding to this bug.

It works with the patch in attachment 81263 [details] [review]. I don't know whether SwapbuffersWait is enable or disable. Would you like to tell me how to check it?Thanks!
Comment 14 Gordon Jin 2014-01-02 01:15:11 UTC
Xun, I guess you can just mark it as VERIFIED if the latest code works.
Comment 15 fangxun 2014-01-21 05:23:36 UTC
Verified it with the latest code.

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.