Bug 32370

Summary: [r600g] src/gallium/auxiliary/util/u_blitter.c:742:util_blitter_copy_region: Assertion `util_is_format_compatible(util_format_description(dst->format), util_format_description(src->format))' failed.
Product: Mesa Reporter: Vinson Lee <vlee>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: medium    
Version: git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2010-12-13 19:26:04 UTC
mesa: d88aa6fe3e9e08af332a900c69bf2bf5c4420e90 (master)

chipset: RV620
system architecture: i686
libdrm-dev: 2.14.21-1ubuntu2.1
kernel version: 2.6.35-23-generic
Linux distribution: Ubuntu 10.10 i386

Run piglit tfp test.

$ ./bin/tfp
src/gallium/auxiliary/util/u_blitter.c:742:util_blitter_copy_region: Assertion `util_is_format_compatible(util_format_description(dst->format), util_format_description(src->format))' failed.

(gdb) bt
#0  0x0110ba1b in _debug_assert_fail (
    expr=0x19c443c "util_is_format_compatible(util_format_description(dst->format), util_format_description(src->format))", 
    file=0x19c421c "src/gallium/auxiliary/util/u_blitter.c", line=742, function=0x19c4621 "util_blitter_copy_region")
    at src/gallium/auxiliary/util/u_debug.c:234
#1  0x01109e39 in util_blitter_copy_region (blitter=0x9247e38, dst=0x92d3490, dstlevel=0, dstx=0, dsty=0, dstz=0, src=0x92a2970, srclevel=0, 
    srcbox=0xbfeb8c88, ignore_stencil=1 '\001') at src/gallium/auxiliary/util/u_blitter.c:741
#2  0x010e4590 in r600_hw_copy_region (ctx=0x8f40870, dst=0x92d3490, dst_level=0, dstx=0, dsty=0, dstz=0, src=0x92a2970, src_level=0, 
    src_box=0xbfeb8c88) at src/gallium/drivers/r600/r600_blit.c:172
#3  0x010e466e in r600_resource_copy_region (ctx=0x8f40870, dst=0x92d3490, dst_level=0, dstx=0, dsty=0, dstz=0, src=0x92a2970, src_level=0, 
    src_box=0xbfeb8c88) at src/gallium/drivers/r600/r600_blit.c:192
#4  0x0122e8f9 in st_texture_image_copy (pipe=0x8f40870, dst=0x92d3490, dstLevel=0, src=0x92a2970, srcLevel=0, face=0)
    at src/mesa/state_tracker/st_texture.c:307
#5  0x012d4c36 in copy_image_data_to_texture (st=0x92912d0, stObj=0x92a2698, dstLevel=0, stImage=0x92a2b10)
    at src/mesa/state_tracker/st_cb_texture.c:1792
#6  0x012d511d in st_finalize_texture (ctx=0x9251e58, pipe=0x8f40870, tObj=0x92a2698) at src/mesa/state_tracker/st_cb_texture.c:1919
#7  0x012c1619 in finalize_textures (st=0x92912d0) at src/mesa/state_tracker/st_atom_texture.c:285
#8  0x012bbe88 in st_validate_state (st=0x92912d0) at src/mesa/state_tracker/st_atom.c:172
#9  0x01226f20 in st_draw_vbo (ctx=0x9251e58, arrays=0x9293eb8, prims=0xbfeb932c, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, 
    max_index=3) at src/mesa/state_tracker/st_draw.c:649
#10 0x012abf7d in vbo_draw_arrays (ctx=0x9251e58, mode=6, start=0, count=4, numInstances=1) at src/mesa/vbo/vbo_exec_array.c:588
#11 0x012ac0e4 in vbo_exec_DrawArrays (mode=6, start=0, count=4) at src/mesa/vbo/vbo_exec_array.c:619
#12 0x0804b06d in draw_pixmap ()
#13 0x0804b1a5 in draw ()
#14 0x0804b78f in event_loop ()
#15 0x0804bcc6 in main ()
(gdb) frame 1
#1  0x01109e39 in util_blitter_copy_region (blitter=0x9247e38, dst=0x92d3490, dstlevel=0, dstx=0, dsty=0, dstz=0, src=0x92a2970, srclevel=0, 
    srcbox=0xbfeb8c88, ignore_stencil=1 '\001') at src/gallium/auxiliary/util/u_blitter.c:741
741	      assert(util_is_format_compatible(util_format_description(dst->format),
(gdb) l
736	   /* Sanity checks. */
737	   if (dst == src) {
738	      assert(!is_overlap(srcbox->x, srcbox->x + width, srcbox->y, srcbox->y + height,
739	                         dstx, dstx + width, dsty, dsty + height));
740	   } else {
741	      assert(util_is_format_compatible(util_format_description(dst->format),
742	                                       util_format_description(src->format)));
743	   }
744	   assert(src->target < PIPE_MAX_TEXTURE_TYPES);
745	   /* XXX should handle 3d regions */
(gdb) print dst->format
$1 = PIPE_FORMAT_B8G8R8X8_UNORM
(gdb) print src->format
$2 = PIPE_FORMAT_B8G8R8A8_UNORM



cae2bb76c1147d48f75ddd7a058a48d11e72ba03 is the first bad commit
commit cae2bb76c1147d48f75ddd7a058a48d11e72ba03
Author: Brian Paul <brianp@vmware.com>
Date:   Mon Dec 6 11:01:19 2010 -0700

    st/mesa: fix mipmap generation bug
    
    In st_finalize_texture() we were looking at the st_texture_object::
    lastLevel field instead of the pipe_resource::last_level field to
    determine which resource to store the mipmap in.
    
    Then, in st_generate_mipmap() we need to call st_finalize_texture() to
    make sure the destination resource is properly allocated.
    
    These changes fix the broken piglit fbo-generatemipmap-formats test.

:040000 040000 28838d86ff86d6d4403c83c061b38836d36616a1 39bc80854dbcfc7bc10e72bf81a85e2feececea8 M	src
bisect run success
Comment 1 Jerome Glisse 2010-12-14 10:59:04 UTC
Run properly with lastest master
Comment 2 Vinson Lee 2010-12-14 18:15:00 UTC
mesa: a8ca30bc58b73203a83799149ca9d21bcdce74b5 (master)

The crash still occurs here.
Comment 3 Jerome Glisse 2010-12-15 12:29:52 UTC
Pushed a fix, works now
Comment 4 Vinson Lee 2010-12-15 17:22:04 UTC
mesa: dbb679e51d7e91e98d1d48d0c93be69bfabbba23 (master)

piglit tfp test now passes.

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.