Bug 52932

Summary: [Bisected SNB regression]Oglc occlusion_query(advanced.fbo) fails
Product: Mesa Reporter: lu hua <huax.lu>
Component: Drivers/DRI/i965Assignee: Daniel Vetter <daniel>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: high CC: eric, idr, xunx.fang
Version: git   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description lu hua 2012-07-30 02:06:58 UTC
System Environment:
--------------------------
Arch:             i386
Platform:         Sandybridge
Libdrm:	(master)libdrm-2.4.37-20-gebd7904877d08525beb5039e4ea2f5b6c0a7c23f
Mesa:	(master)dcf8754cce1af09547a5976a74ba807bc6f2657c
Xserver:(master)xorg-server-1.12.99.903
Xf86_video_intel:(master)2.20.2-4-g3d45f0affe263985f440e144203ed7cbb3803696
Libva:	(staging)f12f80371fb534e6bbf248586b3c17c298a31f4e
Libva_intel_driver:(staging)82fa52510a37ab645daaa3bb7091ff5096a20d0b
Kernel:	(drm-intel-next-queued) ab3951eb74e7c33a2f5b7b64d72e82f1eea61571

Bug detailed description:
---------------------
It fails on Sandybridge with mesa master branch.It doesn't happen on mesa 8.0 branch.
The last known good commit: 1a06e8454ec714e950bc88882cd985534a18bf1f
The last known bad commit: dcf8754cce1af09547a5976a74ba807bc6f2657c


Visual Report:
ID      |ACCELERA|DB      |REND_T  |SURF_T  |C_BUF_T |BUF_S   |RED_S   |
     141|       1|       1|      gl|  wipbpx|    rgba|      32|       8|

GREEN_S |BLUE_S  |ALPHA_S |DEPTH_S |STENC_S |ACCUM_S |SPL_BUF |SAMPLES |
       8|       8|       8|      24|       8|      64|       0|       0|

SRGB    |TEX_RGB |TEX_RGBA|CAVEAT  |SWAP    |M_PBUF_W|M_PBUF_H|M_PBUF_P
      -1|       0|       0|    slow|   undef|       0|       0|       0

Reproduce steps:
----------------------------
1. xinit&
2. ./oglconform -z -suite all -v 2 -D 141 -test occlusion_query advanced.fbo
Comment 1 lu hua 2012-07-30 06:44:26 UTC
Bisect shows:bce58e155db7202a98642c10e6132dee4e08162b is the first bad commit.
commit bce58e155db7202a98642c10e6132dee4e08162b
Author:     Eric Anholt <eric@anholt.net>
AuthorDate: Wed Jul 4 10:52:32 2012 -0700
Commit:     Chad Versace <chad.versace@linux.intel.com>
CommitDate: Tue Jul 17 08:17:56 2012 -0700

    intel: Convert to using private depth/stencil buffers (v2)

    This means that GLX buffer sharing of these no longer works.  On the
    other hand, just *look* at this code reduction.

    v2:
      - [chad] Fix intelCreateBuffer for gen < 6. When the branch for
        !screen->hw_has_separate_stencil was taken,
        intel_create_private_renderbuffer was incorrectly not used.

      - [chad] Remove all code in intel_process_dri2_buffer for processing
        depth, stencil, and hiz buffers. That code is now dead.

    CC: Eric Anholt <eric@anholt.net>
    Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Comment 2 Eric Anholt 2012-07-31 22:38:39 UTC
Did you change only mesa and not the kernel between the working configs and the failing configs when you started bisecting?  Was the failure 100% reproducible in the bad commits and 100% not reproducible in the good commits?
Comment 3 lu hua 2012-08-01 01:37:13 UTC
It always pass on commit 433ff3e16e8e090fd3a1bf427e61f3e5971a5740.
It always fail on commit bce58e155db7202a98642c10e6132dee4e08162b


OpenGL Report.
    Vendor - 'Intel Open Source Technology Center'
    Renderer - 'Mesa DRI Intel(R) Sandybridge Desktop x86/MMX/SSE2'
    Version - '3.0 Mesa 8.1-devel (git-bce58e1)' (3.0)
    GLSL Version - '1.30'
    Context Flags - None

>> Occlusion Query (occlusion_query)  test:
--> 2.6 - advanced.fbo subcase:
    File - /GFX/build/testsuite/Oglconform_31/oglconform_31/src/OGLconform/occlusion_query.c, line - 560.
        Occluder is less then occludee therefore passingSamples should report
        500. Instead passingSamples = 0
        OcclusionTest test case 0 failed


TEST PURPOSE:
Verify that occlusion queries are possible in FBO.

TEST METHOD:
Test creates FBO and runs scenario from testcase 2.1 in it (3 queries, one passes, two fail).

PASS CRITERIA:
Passing query retuen 500 pixels passed, failing return 0 passed.
--------------------------

--< 2.6 - advanced.fbo subcase failed.
<< Occlusion Query (occlusion_query)  test failed. (1 of 1 subcases)

Intel Conformance failed.
Total Passed : 0
Total Failed : 1
Total Not run: 0
Comment 4 lu hua 2012-08-02 07:36:26 UTC
Run: ./glxgears on Huronriver with mesa master branch, system hangs.

Bisect show:bce58e155db7202a98642c10e6132dee4e08162b is the first bad commit.
Comment 5 Kenneth Graunke 2012-08-05 01:07:00 UTC
This is fixed by Eric's kernel patch titled:
"drm/i915: Don't forget to apply SNB PIPE_CONTROL GTT workaround."

It's available on the mailing list, but isn't merged yet:
http://lists.freedesktop.org/archives/intel-gfx/2012-July/019344.html

Reassigning to Daniel; he can close this after he merges the patch.
Comment 6 Daniel Vetter 2012-08-05 19:47:12 UTC
Should be fixed on -fixes with:

commit e844b990b1df9242bb91b7d490552f3198946838                                                                                      
Author: Eric Anholt <eric@anholt.net>                                                                                                
Date:   Tue Jul 31 15:35:01 2012 -0700                                                                                               
                                                                                                                                     
    drm/i915: Don't forget to apply SNB PIPE_CONTROL GTT workaround.
Comment 7 lu hua 2012-08-08 02:16:20 UTC
Can't find out "drm/i915: Don't forget to apply SNB PIPE_CONTROL GTT
workaround." on  -queued kernel commit:ab3951eb74e7.
Comment 8 lu hua 2012-08-28 05:21:50 UTC
Verified. Fixed on Mesa master a3d9d7ec79d6f7205fab2324e47d8ea185431de0 and
-queued Kernel cd7988eea561a70a4f98e431c1395f913672d626

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.