Bug 50298

Summary: [ILK IVB bisected]Ogles2conform GL/sin/sin_float_vert_xvary.test regressed
Product: Mesa Reporter: lu hua <huax.lu>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: high CC: xunx.fang
Version: 8.0   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description lu hua 2012-05-23 20:20:43 UTC
System Environment:
--------------------------
Arch:             x86_64
Platform:         Ironlake
Libdrm:           (master)2.4.34-2-g481234f2909c0506962a2f42da862da6a9b13fd8
Mesa:             (8.0)3d657b14b4cab98a2945904823e78cd8950944f4
Xserver:          (server-1.12-branch)xorg-server-1.12.1
Xf86_video_intel: (master)2.19.0-76-g54fde5bf05d43f26e7f1893584af736a138d245f
Libva:            (master)80cbd369116237a948c9184b00ca4754cf72c0ab
Libva_intel_driver:(master)d0dfefde77ebe6093e304a84df796c6e1157f00a
Kernel:          (drm-intel-fixes) 8d09952b94951d6c5f0f7e9892ccc3ac79794d54

Bug detailed description:
-----------------------------
It happens on Ironlake with mesa 8.0 branch.It doesn't happen on mesa master
branch.

bisect shows:8a7cb5d21ca147aaa77e0b1ca5a746bbc6e8966a is the first bad commit
commit 8a7cb5d21ca147aaa77e0b1ca5a746bbc6e8966a
Author:     Mathias Fröhlich <Mathias.Froehlich@gmx.net>
AuthorDate: Wed Jan 25 17:35:01 2012 +0100
Commit:     Ian Romanick <ian.d.romanick@intel.com>
CommitDate: Thu May 17 21:27:59 2012 -0700

    glsl: Avoid excessive loop unrolling.

    Avoid unrollong loops that are either nested loops or
    where the loop body times the unroll count is huge.

    The change is far from being perfect but it extends the
    loop unrolling decision heuristic by some additional
    safeguard. In particular this cuts down compilation of
    a shader precomputing atmospheric scattering integral
    tables containing two nesting levels in a loop from
    something way beyond some minutes (I never waited for
    it to finish) to some fractions of a second.

    This fixes piglit tests glsl-fs-unroll-explosion and
    glsl-vs-unroll-explosion on r600g.

    Reviewed-by: Eric Anholt <eric@anholt.net>
    Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
    (cherry picked from commit 67007080b716c7e51039a381f407ababd68230f7)

Reproduce steps:
----------------------------
1. Start x
2. GTF -width=64 -height=64 \
-run=/GTF_ES/glsl/GTF/GL/sin/sin_float_vert_xvary.test
Comment 1 lu hua 2012-05-23 20:29:51 UTC
Following cases also fail and have same commit:
GL_sin_sin_vec2_vert_xvary.test
GL_sin_sin_vec3_vert_xvary.test
Comment 2 Ian Romanick 2012-05-31 20:08:33 UTC
It seems very weird that this only occurs on ILK.  Ken, can you take a look?
Comment 3 Gordon Jin 2012-05-31 20:21:15 UTC
Hua, can you confirm this doesn't happen on SNB/IVB?
Comment 4 lu hua 2012-06-01 00:06:40 UTC
It doesn't happen on sandybridge.


Following cases fails on Ivybridge and have same bisect commit.
GL_sin_sin_vec2_vert_xvary.test
GL_sin_sin_vec3_vert_xvary.test
Comment 5 Kenneth Graunke 2012-06-01 01:02:45 UTC
I just ran all of the GL/sin cases on Ironlake, Sandybridge, and Ivybridge using Mesa 8009fca501a021cbaf.  They all pass.

I suspect it's something on your end.  Does GTF complain or give any errors?  Or does it just say that the test fails?

Also, if you could paste the output of running 'ldd' on your 'GTF' binary, I'd appreciate that.
Comment 6 Ian Romanick 2012-06-12 21:26:28 UTC
I can verify that this test passes on all 8.0.x versions and master on SNB.

I can verify that this test passes on 8.0.1 and master on IVB.

I can verify that this test fails on 8.0.2 and 8.0.3 on IVB.

My guess is that something isn't being handled correctly for loops on IVB on the 8.0 branch.
Comment 7 Ian Romanick 2012-06-12 21:31:45 UTC
In case it makes any difference, I saw this on 3.4.0-1.fc17.x86_64 kernel (on a fresh F17 install).  The chipset was:

00:02.0 VGA compatible controller: Intel Corporation Device 0166 (rev 09) (prog-if 00 [VGA controller])
	Subsystem: Hewlett-Packard Company Device 18df
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 46
	Region 0: Memory at d0000000 (64-bit, non-prefetchable) [size=4M]
	Region 2: Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Region 4: I/O ports at 2000 [size=64]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: i915
Comment 8 Kenneth Graunke 2012-06-18 15:55:53 UTC
Fixed.

commit 1f4f86e951487345170d352bc0b8d137491379fe
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Sat Jun 16 02:08:13 2012 -0700

    i965: Fix brw_swap_cmod() for LE/GE comparisons.
    
    The idea here is to rewrite comparisons like 2 >= x with x <= 2; we want
    to simply exchange arguments, not negate the condition.  If equality was
    part of the original comparison, it should remain part of the swapped
    version.
    
    This is the true cause of bug #50298.  It didn't manifest itself on
    Sandybridge because we embed the conditional modifier in the IF
    instruction rather than emitting a CMP.  All other platforms use CMP.
    
    It also didn't manifest itself on the master branch because commit
    be5f27a84d ("glsl: Refine the loop instruction counting.") papered over
    the problem.
    
    NOTE: This is a candidate for stable release branches.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50298
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Eric Anholt <eric@anholt.net>
    (cherry picked from commit 5b83bdc154ec8d607a4c4d96171d0128e51abaec)
Comment 9 lu hua 2012-06-20 19:43:30 UTC
Verified.It has been fixed on mesa 8.0 branch commit 1f4f86e951487345170d352bc0b8d137491379fe.

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.