Bug 63867

Summary: [SNB Bisected]Piglit spec/ARB_texture_float/fbo-alphatest-formats fail due to Y-tiling change
Product: Mesa Reporter: lu hua <huax.lu>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: high CC: chadversary, idr, topi.pohjolainen, xunx.fang
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 67224    

Description lu hua 2013-04-24 08:55:24 UTC
System Environment:
--------------------------
Arch:           i386
Platform:       Sandybridge
Libdrm:		(master)2.4.44-2-g12464a70ed502d9f401931156005afd717a9992f
Mesa:		(master)723b78397fbad8987e14b7bb2376055529f40856
Xserver:	(master)xorg-server-1.14.0-53-g6ca03b9161d33b1d2b55a3a1a913cf88deb2343f
Xf86_video_intel:(master)2.21.6-20-gb4871f1dac3d3c8d81101ef0f29eb69099ff2dcf
Cairo:		(master)498421bec90f68f3d7219b145860a71fd39f0c64
Libva:		(staging)2b25c3439781f0b7162011627a8ad3bb6288d1bb
Libva_intel_driver:(staging)1fd62ffd336293dce7d091bcea8399a40ccea21e
Kernel:	(drm-intel-nightly) 72865a4b647b3023397d59272555991c3fa4c42a

Bug detailed description:
-------------------------
It fails on sandybridge with mesa master branch.It works well on 9.1 branch.
It has same bisect commit with #Bug 63349, but it only fails on sandybridge, So file a new bug.
Following cases also fail on sandybridge, and have same bisect commit:
spec_ARB_texture_float_fbo-blending-formats
spec_ARB_texture_float_fbo-clear-formats
spec_ARB_texture_float_fbo-colormask-formats
spec_ARB_texture_float_fbo-generatemipmap-formats
spec_EXT_framebuffer_object_getteximage-formats_init-by-rendering
spec_glsl-1.30_execution_isinf-and-isnan_fs_fbo
spec_glsl-1.30_execution_isinf-and-isnan_vs_fbo
spec_OpenGL_1.1_getteximage-formats
spec_OpenGL_3.0_clearbuffer-mixed-format

Bisect shows:55ecc448b9d05e9f1e5ceb88ab35606e80e3adee is the first bad commit.
commit 55ecc448b9d05e9f1e5ceb88ab35606e80e3adee
Author:     Kenneth Graunke <kenneth@whitecape.org>
AuthorDate: Mon Apr 8 19:27:38 2013 -0700
Commit:     Kenneth Graunke <kenneth@whitecape.org>
CommitDate: Mon Apr 8 16:15:07 2013 -0700

    i965: Prefer Y-tiling on Gen6+.

    In the past, we preferred X-tiling for color buffers because our BLT
    code couldn't handle Y-tiling.  However, the BLT paths have been largely
    replaced by BLORP on Gen6+, which can handle any kind of tiling.

    We hadn't measured any performance improvement in the past, but that's
    probably because compressed textures were all untiled anyway.

    Improves performance in GLB27_TRex_C24Z16_FixedTime by 7.69231%.

    v2: Rebase on top of Eric's untiled-for-larger-than-aperture changes.

    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Reviewed-by: Eric Anholt <eric@anholt.net>

output:
Using test set: GL_ARB_texture_float
Testing GL_RGB16F_ARB
PIGLIT:subtest {'GL_RGB16F_ARB' : 'pass'}
Testing GL_RGBA16F_ARB
PIGLIT:subtest {'GL_RGBA16F_ARB' : 'pass'}
Testing GL_LUMINANCE16F_ARB
PIGLIT:subtest {'GL_LUMINANCE16F_ARB' : 'pass'}
Testing GL_LUMINANCE_ALPHA16F_ARB- fbo incomplete (status = GL_FRAMEBUFFER_UNSUPPORTED)
PIGLIT:subtest {'GL_LUMINANCE_ALPHA16F_ARB' : 'skip'}
Testing GL_INTENSITY16F_ARB
PIGLIT:subtest {'GL_INTENSITY16F_ARB' : 'pass'}
Testing GL_RGB32F_ARB- fbo incomplete (status = GL_FRAMEBUFFER_UNSUPPORTED)
PIGLIT:subtest {'GL_RGB32F_ARB' : 'skip'}
Testing GL_RGBA32F_ARB
  FAIL when testing FBO result, 1: 0.2 < 0.25.
  FAIL when testing FBO result, 3: 0.6 > 0.55.
  FAIL when testing FBO result, 4: 0.9 > 0.1.
  FAIL when testing FBO result, 6: 0.4 == 0.4.
PIGLIT:subtest {'GL_RGBA32F_ARB' : 'fail'}
Testing GL_LUMINANCE32F_ARB
PIGLIT:subtest {'GL_LUMINANCE32F_ARB' : 'pass'}
Testing GL_LUMINANCE_ALPHA32F_ARB- fbo incomplete (status = GL_FRAMEBUFFER_UNSUPPORTED)
PIGLIT:subtest {'GL_LUMINANCE_ALPHA32F_ARB' : 'skip'}
Testing GL_INTENSITY32F_ARB
PIGLIT:subtest {'GL_INTENSITY32F_ARB' : 'pass'}
PIGLIT: {'result': 'fail' }

Reproduce steps:
----------------
1. xinit
2. ./bin/fbo-alphatest-formats -auto GL_ARB_texture_float
Comment 1 Gordon Jin 2013-05-24 05:05:07 UTC
Ken, can you reproduce this?
Comment 2 Topi Pohjolainen 2013-07-30 05:43:44 UTC
Forcing tiling to I915_TILING_X instead of I915_TILING_X | I915_TILING_Y in
"i965/intel_mipmap_tree.c::intel_miptree_choose_tiling()" lets me to reproduce this on Sandybridge.
This may well go over my head but I'm looking into it as a learning exercise anyway. At least it gives me a reason to understand the X vs. Y-tiling algorithm in general.
Comment 3 Topi Pohjolainen 2013-07-31 06:35:36 UTC
(In reply to comment #2)
> Forcing tiling to I915_TILING_X instead of I915_TILING_X | I915_TILING_Y in
> "i965/intel_mipmap_tree.c::intel_miptree_choose_tiling()" lets me to
> reproduce this on Sandybridge.
> This may well go over my head but I'm looking into it as a learning exercise
> anyway. At least it gives me a reason to understand the X vs. Y-tiling
> algorithm in general.

Sorry about misleading, I meant to say that I can reproduce it with current mesa-master on Sandybridge and if I switch the tiling to X-only, the test passes.
Comment 4 Topi Pohjolainen 2013-08-01 08:12:27 UTC
I'll assign this for myself for now. I'm now studying the test case itself in order to understand the error better.
Comment 5 lu hua 2013-08-07 09:12:21 UTC
*** Bug 67857 has been marked as a duplicate of this bug. ***
Comment 6 Kenneth Graunke 2013-08-13 22:39:23 UTC
Chad and Paul were talking about format restrictions related to Y-tiling the other day, and happened to stumble across the solution.  I've written a patch:

http://lists.freedesktop.org/archives/mesa-dev/2013-August/043267.html
Comment 7 lu hua 2013-08-14 05:47:28 UTC
(In reply to comment #6)
> Chad and Paul were talking about format restrictions related to Y-tiling the
> other day, and happened to stumble across the solution.  I've written a
> patch:
> 
> http://lists.freedesktop.org/archives/mesa-dev/2013-August/043267.html


Fixed by this patch except case "spec_glsl-1.30_execution_isinf-and-isnan_fs_fbo"
run: ./bin/isinf-and-isnan fs_fbo -auto
output:
 expression    expect isinf isnan sign  >0?      value        delta
           1000.0 finite false false    1  true         1000            0 OK
         1000.0+z finite false  true    1  true         1000            0 FAIL
          -1000.0 finite false false   -1 false        -1000            0 OK
        -1000.0+z finite false  true   -1  true        -1000            0 FAIL
            u_inf   +Inf false  true    1  true          inf         -nan FAIL
      exp(1000.0)   +Inf  true false    1  true          inf         -nan OK
    exp(1000.0+z)   +Inf false  true    1  true          inf         -nan FAIL
      u_minus_inf   -Inf false  true   -1  true         -inf         -nan FAIL
     -exp(1000.0)   -Inf  true false   -1 false         -inf         -nan OK
   -exp(1000.0+z)   -Inf false  true   -1  true         -inf         -nan FAIL
            u_nan    NaN false  true    0  true          nan         -nan OK
          0.0/0.0    NaN false  true    0 false         -nan         -nan OK
              z/z    NaN false  true    0  true         -nan         -nan OK
u_inf/u_minus_inf    NaN false  true    0  true         -nan         -nan OK
          z*u_inf    NaN false  true    0  true         -nan         -nan OK
u_inf+u_minus_inf    NaN false  true    0  true         -nan         -nan OK
        log(-1.0)    NaN false  true    0 false          nan         -nan OK
      log(-1.0+z)    NaN false  true    0  true         -nan         -nan OK
       sqrt(-1.0)    NaN false  true    0 false         -nan         -nan OK
     sqrt(-1.0+z)    NaN false  true    0  true         -nan         -nan OK
PIGLIT: {'result': 'fail' }
Comment 8 Kenneth Graunke 2013-08-15 22:44:18 UTC
commit c189840b21e176d87cbb382e64e848061b8c7b06
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Tue Aug 13 15:03:12 2013 -0700

    i965: Force X-tiling for 128 bpp formats on Sandybridge.
    
    128 bpp formats are not allowed to be Y-tiled on any architectures
    except Gen7.
    
    +11 Piglits on Sandybridge (mostly regression fixes since the
    switch to Y-tiling).
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63867
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64261
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
    Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Comment 9 Kenneth Graunke 2013-08-15 22:48:04 UTC
By the way, the isinf-isnan continued failure was due to 68086.  That's fixed now too.
Comment 10 lu hua 2013-08-19 02:51:05 UTC
Verified.Fixed.

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.