Bug 93792

Summary: [HSW] intel_mipmap_tree.c:1325: intel_miptree_copy_slice: Assertion `src_mt->format == dst_mt->format
Product: Mesa Reporter: Ilia Mirkin <imirkin>
Component: Drivers/DRI/i965Assignee: Ian Romanick <idr>
Status: CLOSED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Ilia Mirkin 2016-01-20 15:56:00 UTC
This is with the upstream dEQP testsuite:

Starting program: /home/ilia/src/deqp/modules/gles2/deqp-gles2 --deqp-visibility=hidden --deqp-case=dEQP-GLES2.functional.texture.completeness.cube.format_mismatch_rgb_rgba_level_0_pos_z
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
dEQP Core git-0c2b7cdc3a0455e0486f88574021d3ccd22f28a8 (0x0c2b7cdc) starting..
  target implementation = 'X11 EGL/GLX'

Test case 'dEQP-GLES2.functional.texture.completeness.cube.format_mismatch_rgb_rgba_level_0_pos_z'..
deqp-gles2: intel_mipmap_tree.c:1325: intel_miptree_copy_slice: Assertion `src_mt->format == dst_mt->format' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff5dbe3b7 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff5dbe3b7 in raise () from /lib64/libc.so.6
#1  0x00007ffff5dbf74a in abort () from /lib64/libc.so.6
#2  0x00007ffff5db73ed in __assert_fail_base () from /lib64/libc.so.6
#3  0x00007ffff5db74a2 in __assert_fail () from /lib64/libc.so.6
#4  0x00007ffff25aa26b in intel_miptree_copy_slice (depth=0, face=4, 
    level=<optimized out>, src_mt=0x1061e30, dst_mt=<optimized out>, 
    brw=0x7ffff7f91040) at intel_mipmap_tree.c:1325
#5  intel_miptree_copy_teximage (brw=brw@entry=0x7ffff7f91040, 
    intelImage=intelImage@entry=0x1061880, dst_mt=<optimized out>, 
    invalidate=invalidate@entry=false) at intel_mipmap_tree.c:1397
#6  0x00007ffff25b0fe2 in intel_finalize_mipmap_tree (
    brw=brw@entry=0x7ffff7f91040, unit=unit@entry=0)
    at intel_tex_validate.c:166
#7  0x00007ffff2576f39 in brw_validate_textures (brw=brw@entry=0x7ffff7f91040)
    at brw_tex.c:53
#8  0x00007ffff2557bf9 in brw_try_draw_prims (indirect=0x0, max_index=3, 
    min_index=0, ib=0x7fffffffd190, nr_prims=1, prims=0x7fffffffd1b0, 
    arrays=0xf89f40, ctx=0x7ffff7f91040) at brw_draw.c:445
#9  brw_draw_prims (ctx=0x7ffff7f91040, prims=0x7fffffffd1b0, nr_prims=1, 
    ib=0x7fffffffd190, index_bounds_valid=<optimized out>, min_index=0, 
    max_index=3, unused_tfb_object=0x0, stream=0, indirect=0x0)
    at brw_draw.c:650
#10 0x00007ffff238db36 in vbo_validated_drawrangeelements (
    ctx=ctx@entry=0x7ffff7f91040, mode=mode@entry=4, 
    index_bounds_valid=index_bounds_valid@entry=0 '\000', 
    start=start@entry=4294967295, end=end@entry=4294967295, 
    count=count@entry=6, type=5123, 
    indices=0xb433b0 <deqp::gls::TextureTestUtil::TextureRenderer::renderQuad(int, float const*, deqp::gls::TextureTestUtil::RenderParams const&)::indices>, 
    basevertex=0, numInstances=1, baseInstance=0) at vbo/vbo_exec_array.c:992
#11 0x00007ffff238e37d in vbo_exec_DrawElements (mode=4, count=6, type=5123, 
    indices=0xb433b0 <deqp::gls::TextureTestUtil::TextureRenderer::renderQuad(int, float const*, deqp::gls::TextureTestUtil::RenderParams const&)::indices>)
    at vbo/vbo_exec_array.c:1128
#12 0x000000000084fa5c in glu::drawFromUserPointers(glu::RenderContext const&, unsigned int, int, glu::VertexArrayBinding const*, glu::PrimitiveList const&, glu::DrawUtilCallback*) ()
#13 0x000000000084fdb0 in glu::draw(glu::RenderContext const&, unsigned int, int, glu::VertexArrayBinding const*, glu::PrimitiveList const&, glu::DrawUtilCallback*) ()
#14 0x00000000009749ed in deqp::gls::TextureTestUtil::TextureRenderer::renderQuad(int, float const*, deqp::gls::TextureTestUtil::RenderParams const&) ()
#15 0x000000000097562f in deqp::gls::TextureTestUtil::TextureRenderer::renderQuad(int, float const*, deqp::gls::TextureTestUtil::TextureType) ()
#16 0x0000000000609231 in deqp::gles2::Functional::TexCubeCompletenessCase::iterate() ()
#17 0x0000000000504a25 in deqp::gles2::TestCaseWrapper::iterate(tcu::TestCase*)
    ()
#18 0x000000000081249f in tcu::TestSessionExecutor::iterate() ()
#19 0x00000000007f5d19 in tcu::App::iterate() ()
#20 0x00000000004fcfd8 in main ()
Comment 1 Mark Janes 2016-01-20 17:08:11 UTC
There more than 100 other dEQP tests that cause assertions on Haswell:

deqp-gles2.functional.shaders.random.conditionals.combined.19
deqp-gles2.functional.shaders.random.conditionals.combined.32
deqp-gles3.functional.fragment_ops.interaction.basic_shader.21

and the rest are in this category:
deqp-gles3.functional.transform_feedback.array_element
Comment 2 Kenneth Graunke 2016-01-21 01:39:15 UTC
(In reply to Mark Janes from comment #1)
> There more than 100 other dEQP tests that cause assertions on Haswell:

Those are most likely unrelated.

In addition to fixing the assertion failure, we should figure out why intel_miptree_copy_slice is being called, and see if we can avoid it.  I think that can happen due to texture relayout ("suddenly, miplevels!").  So it may be unavoidable.  But if we can, we should.
Comment 3 Neil Roberts 2016-01-21 19:03:41 UTC
I think this is just a case of the upper layers of Mesa incorrectly allowing an invalid texture and then the driver gets confused. I've posted a patch for it here:

http://patchwork.freedesktop.org/patch/71334/

And a Piglit test for it here:

http://patchwork.freedesktop.org/patch/71333/
Comment 4 Neil Roberts 2016-01-21 21:47:44 UTC
I've pushed the patch

http://cgit.freedesktop.org/mesa/mesa/commit/?id=666d96d1697fc9a145251928575

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.