Bug 16157 - [i965] glean/glsl1 run abort
[i965] glean/glsl1 run abort
Status: VERIFIED FIXED
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965
unspecified
Other Linux (All)
: high major
Assigned To: haihao
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-29 20:01 UTC by Shuang He
Modified: 2008-10-12 19:10 UTC (History)
1 user (show)

See Also:


Attachments
xorg conf (3.57 KB, text/plain)
2008-05-29 20:03 UTC, Shuang He
Details
xorg log (47.42 KB, text/plain)
2008-05-29 20:04 UTC, Shuang He
Details
patch to fix vertex shader texture sample crash (1.35 KB, patch)
2008-07-01 07:53 UTC, Brian Paul
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Shuang He 2008-05-29 20:01:55 UTC
System Environment:
--------------------------

--Platform: Q965


--2D driver:
commit bd137a19dc29dd466eac030e040f729ed0807e3f

--3D driver:
commit 328621509f4690fb945201a90425662e4fd2fc2d

--Xserver:
commit 29586101dc11d498b212510f8dedbfeca7f8c859

--Drm
commit 5b86823fa36513f521412a38c240cb18f02dcc9a

--Kernel:
2.6.25


Bug detailed description:
-------------------------
Unsupport opcode 74 in vertex shader
FAILURE:
  Shader test: 2D Texture lookup with explicit lod (Vertex shader)
  Expected color: 0.25, 0, 0, 0.25
  Observed color: 0, 0, 0, 0
intel_bufmgr_ttm.c:769: Error waiting for fence fence buffers: Device or resource busy.

Program received signal SIGABRT, Aborted.


backtrace:
(gdb) bt
#0  0xb7faa424 in __kernel_vsyscall ()
#1  0x00bfd690 in raise () from /lib/libc.so.6
#2  0x00bfef91 in abort () from /lib/libc.so.6
#3  0xb7ad4144 in dri_ttm_fence_wait (fence=0x85efca8) at intel_bufmgr_ttm.c:770
#4  0xb7acca62 in dri_fence_wait (fence=0x85efca8) at ../common/dri_bufmgr.c:96
#5  0xb7ad62c7 in intelFinish (ctx=0x810aa20) at intel_context.c:374
#6  0xb7ade9ef in intelSpanRenderStart (ctx=0x810aa20) at intel_span.c:313
#7  0xb7bf50b0 in _swrast_ReadPixels (ctx=0x810aa20, x=48, y=48, width=1, height=1, format=6408, type=5126,
    packing=0x8116698, pixels=0xbfda7af4) at swrast/s_readpix.c:562
#8  0xb7c50fae in _mesa_ReadPixels (x=48, y=48, width=1, height=1, format=6408, type=5126, pixels=0xbfda7af4)
    at main/drawpix.c:336
#9  0x080702ba in GLEAN::GLSLTest::testProgram (this=0x80edfc0, p=@0x80c4e6c) at tglsl1.cpp:3320
#10 0x08070463 in GLEAN::GLSLTest::runOne (this=0x80edfc0, r=@0x8134998, w=@0xbfda7ba8) at tglsl1.cpp:3388
#11 0x0805a79f in GLEAN::BaseTest<GLEAN::MultiTestResult>::run (this=0x80edfc0, environment=@0xbfda7c30) at tbase.h:290
#12 0x0805443b in main (argc=6, argv=0xbfda7d74) at main.cpp:128



Current result:
----------------
glean case glsl1 run abort


Expected result:
----------------
glean case glsl1 should pass
Comment 1 Shuang He 2008-05-29 20:03:30 UTC
Created attachment 16818 [details]
xorg conf
Comment 2 Shuang He 2008-05-29 20:04:20 UTC
Created attachment 16819 [details]
xorg log
Comment 3 Shuang He 2008-05-29 23:30:29 UTC
some bisect work shows following 2 commits bring in this issue:

commit 0639998ee8750083b5e4ad90371c475cb2cca88f
Author: Brian Paul <brian.paul@tungstengraphics.com>
Date:   Fri May 16 13:15:03 2008 -0700

    Fix DRI build

commit ade508312c701ce89d3c2cd717994dbbabb4f207
Author: Brian Paul <brian.paul@tungstengraphics.com>
Date:   Wed May 14 16:09:46 2008 -0600

    Updated GLSL uniform/sampler handling from gallium-0.1 branch

    Previously, the shader linker combined the uniforms used by the vertex and
    fragment shaders into a combined set of uniforms.  This made the implementat
    of glUniform*() simple, but was rather inefficient otherwise.  Now each shad
    gets its own set of uniforms (no more modelview matrix showing up in the
    fragment shader uniforms, for example).

    cherry-picked by hand from gallium-0.1 branch
Comment 4 Shuang He 2008-06-02 19:59:18 UTC
Higher priority, as it seems this abortion impact other glean cases
Comment 5 Gordon Jin 2008-06-28 21:55:05 UTC
Brian, any comments?
Comment 6 Brian Paul 2008-06-30 12:01:35 UTC
Sorry, I don't have the time or means to look into this now.

What happens if you disable the "2D Texture lookup with explicit lod" test in glean?

Maybe texture lookups in vertex programs were never working in the driver?
Comment 7 Gordon Jin 2008-06-30 18:50:10 UTC
(In reply to comment #6)
> Maybe texture lookups in vertex programs were never working in the driver?

Right. That's bug#13838. But it shouldn't abort.
Comment 8 Brian Paul 2008-07-01 07:53:53 UTC
Created attachment 17470 [details] [review]
patch to fix vertex shader texture sample crash

Here's a patch to try.  It sets GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB=0 for the i965 driver and adds a test to the GLSL linker that the vertex program doesn't use too many samplers.
Comment 9 Shuang He 2008-07-01 19:48:29 UTC
(In reply to comment #8)
> Created an attachment (id=17470) [details]
> patch to fix vertex shader texture sample crash
> 
> Here's a patch to try.  It sets GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB=0 for the
> i965 driver and adds a test to the GLSL linker that the vertex program doesn't
> use too many samplers.
> 

I have tried this patch, it still crashes X.
Comment 10 Brian Paul 2008-07-02 08:18:49 UTC
Is the problem still with the glean glsl1 test?  Is it caused by the "2D Texture lookup with explicit lod (Vertex shader)" test?  Glean should not be running that test if GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS == 0.

I've commited the above-attached patch.
Comment 11 Shuang He 2008-07-03 22:45:20 UTC
(In reply to comment #10)
> Is the problem still with the glean glsl1 test?  Is it caused by the "2D
> Texture lookup with explicit lod (Vertex shader)" test?  Glean should not be
> running that test if GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS == 0.
> 
> I've commited the above-attached patch.
> 

it's now failing at texture3D(), computed coord, check following info:

Failed to initialize TTM buffer manager.  Falling back to classic.
FAILURE:
  Shader test: 2D Texture lookup with explicit lod (Vertex shader)
  Link error: Vertex program uses too many samplers.
FAILURE:
  Shader test: texture3D(), computed coord
  Expected color: 0, 0, 0.5, 0.5
  Observed color: 0, 0.00784314, 0.847059, 0
intelWaitIrq: drm_i915_irq_wait: -16
Comment 12 haihao 2008-08-10 20:10:13 UTC
It has been fixed. See  a3024caff1c790cf9f24476926aa62198f1e7b53 and c20a1736566d301f38cc1271284b1fde9adb2741
Comment 13 Shuang He 2008-10-12 19:10:29 UTC
verified