Bug 39487 - [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0)' failed.
Summary: [i965] brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium critical
Assignee: Kenneth Graunke
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-23 00:24 UTC by Vinson Lee
Modified: 2011-07-28 14:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Vinson Lee 2011-07-23 00:24:16 UTC
System environment:
-- chipset: 965GM
-- system architecture: i686
-- xf86-video-intel: 2:2.15.0-3ubuntu2
-- xserver: 2:1.10.2.902-1ubuntu3
-- mesa: 3e5d36267d8c9536490c902f785137a7fa0637fc (master)
-- libdrm: 2.4.26-1ubuntu1
-- kernel: 3.0-3-generic
-- Linux distribution: Ubuntu 11.10 i386


Saw this assert while running VMware Workstation.

brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0)' failed.

(gdb) bt
[...]
#15 0x007097e8 in __assert_fail (assertion=0x30f1438 "brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0)", 
    file=0x30f1380 "brw_wm_surface_state.c", line=495, function=0x30f1500 "brw_update_renderbuffer_surface") at assert.c:81
        buf = 0xa6befa68 "brw_wm_surface_state.c:495: brw_update_renderbuffer_surface: Assertion `brw->has_surface_tile_offset 
 (tile_x == 0 && tile_y == 0)' failed.\n"
#16 0x02eb329d in brw_update_renderbuffer_surface (brw=0xa179d040) at brw_wm_surface_state.c:495
        ctx = 0xa179d040
        irb = 0x6
        region = 0xa6b6e048
        surf = 0xa17ba5ec
        tile_y = 6
        intel = 0xa179d040
        tile_x = 0
        format = <value optimized out>
#17 upload_wm_surfaces (brw=0xa179d040) at brw_wm_surface_state.c:592
        ctx = 0xa179d040
        i = <value optimized out>
#18 0x02e9b7a4 in brw_upload_state (brw=0xa179d040) at brw_state_upload.c:553
        atom = <value optimized out>
        state = 0xa17bba14
        atoms = 0xa17bc89c
        num_atoms = 19
        i = <value optimized out>
        dirty_count = 0
        __PRETTY_FUNCTION__ = "brw_upload_state"
#19 0x02e8456f in brw_try_draw_prims (ctx=0xa179d040, arrays=0xaf4c8c4c, prim=0x54c1a78, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', 
    min_index=0, max_index=3) at brw_draw.c:370
        hw_prim = 6
        estimated_max_prim_size = 4096
        retval = <value optimized out>
        warn = 0 '\000'
        i = <value optimized out>
#20 brw_draw_prims (ctx=0xa179d040, arrays=0xaf4c8c4c, prim=0x54c1a78, nr_prims=1, ib=0x0, index_bounds_valid=1 '\001', min_index=0, 
    max_index=3) at brw_draw.c:431
        retval = 0 '\000'
#21 0x02f90c98 in vbo_draw_arrays (ctx=0xa179d040, mode=6, start=0, count=4, numInstances=1) at vbo/vbo_exec_array.c:640
        vbo = 0xaf4c67c8
        exec = 0xaf4c7118
        prim = {{mode = 6, indexed = 0, begin = 1, end = 1, weak = 0, no_current_update = 0, pad = 0, start = 0, count = 4, basevertex = 0, 
            num_instances = 1}, {mode = 0, indexed = 0, begin = 0, end = 0, weak = 0, no_current_update = 0, pad = 0, start = 0, count = 0, 
            basevertex = 0, num_instances = 0}}
[...]
(gdb) frame 16
#16 0x02eb329d in brw_update_renderbuffer_surface (brw=0xa179d040) at brw_wm_surface_state.c:495
495	   assert(brw->has_surface_tile_offset || (tile_x == 0 && tile_y == 0));
(gdb) print brw->has_surface_tile_offset
$1 = 0 '\000'
(gdb) print tile_x
$2 = 0
(gdb) print tile_y
$3 = 6
Comment 1 Kenneth Graunke 2011-07-27 15:54:37 UTC
Ian just told me about this bug.  I believe I've fixed it; doing final testing now and will (re)send out the patch soon.
Comment 2 Kenneth Graunke 2011-07-28 14:06:15 UTC
Should be fixed in Mesa master by the following commit:

commit 15c0bc5eefc89bec537e412c02965f201fb1c011
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Mon Jul 25 17:06:13 2011 -0700

    i965: Check actual tile offsets in Gen4 miptree workaround.
    
    The purpose of the (irb->draw_offset & 4095) != 0 check was to ensure
    that we don't have XYy offsets into a tile, since Gen4 hardware doesn't
    support that.  However, it's insufficient: there are cases where
    draw_offset & 4095 is 0 but we still have a Y-offset.  This leads to an
    assertion failure in brw_update_renderbuffer_surface with tile_y != 0.
    
    Instead, simply call intel_renderbuffer_tile_offsets to compute the
    actual X/Y offsets and check if either are non-zero.  This makes both
    the workaround and the assertion check the same things.
    
    Fixes piglit test fbo-generatemipmap-formats, and should also fix
    bugs #34009 and #39487.
    
    NOTE: This is a candidate for stable release branches.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34009
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=39487
    Reviewed-by: Eric Anholt <eric@anholt.net>
    Reviewed-by: Chad Versace <chad@chad-versace.us>
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>


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.