Bug 52252 - [bisected IVB regression]Piglit glx/glx-visuals-depth aborted with kde mode
Summary: [bisected IVB regression]Piglit glx/glx-visuals-depth aborted with kde mode
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: All Linux (All)
: high major
Assignee: Chad Versace
QA Contact:
URL:
Whiteboard:
Keywords:
: 53495 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-07-19 05:48 UTC by lu hua
Modified: 2012-10-11 09:08 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description lu hua 2012-07-19 05:48:46 UTC
System Environment:
--------------------------
Arch:             x86_64
Platform:         Ivybridge
Libdrm:	(master)libdrm-2.4.37-6-g22574aa887efa879519328acc09cb01d03374bf4
Mesa:	(master)82a1d241754a52934b41bd152d25741b0c9c6294
Xserver:(master)xorg-server-1.12.0-233-gdae317e7265007b38012244722e3b3a06e904ed5
Xf86_video_intel:(master)2.20.0-31-g77520641a332a622c0b5378bd254ed5cb46a5f0a
Libva:	(staging)f12f80371fb534e6bbf248586b3c17c298a31f4e
Libva_intel_driver:(staging)82fa52510a37ab645daaa3bb7091ff5096a20d0b
Kernel:	(drm-intel-next-queued) 1ecdd7feb6cd736c21bdd5459ec6045dcfcc7712

Bug detailed description:
-------------------------
It happens on ivybridge with mesa master branch under kde mode.It passes with X mode , compositor.
It doesn't happen on 8.0 branch.

glx/glx-visuals-stencil also abort.

The last known good commit: 81de0431d6f52084e01874163657e141e6beffdf
The last known bad commit: 82a1d241754a52934b41bd152d25741b0c9c6294

output:
glx-visuals-depth: intel_resolve_map.c:46: intel_resolve_map_set: Assertion `(*tail)->need == need' failed.
Aborted (core dumped)

Reproduce steps:
----------------------------
1. xinit
2. startkde
3. ./bin/glx-visuals-depth -auto
Comment 1 lu hua 2012-07-19 08:09:55 UTC
Bisect shows:bce58e155db7202a98642c10e6132dee4e08162b is the first bad commit.
commit bce58e155db7202a98642c10e6132dee4e08162b
Author:     Eric Anholt <eric@anholt.net>
AuthorDate: Wed Jul 4 10:52:32 2012 -0700
Commit:     Chad Versace <chad.versace@linux.intel.com>
CommitDate: Tue Jul 17 08:17:56 2012 -0700

    intel: Convert to using private depth/stencil buffers (v2)

    This means that GLX buffer sharing of these no longer works.  On the
    other hand, just *look* at this code reduction.

    v2:
      - [chad] Fix intelCreateBuffer for gen < 6. When the branch for
        !screen->hw_has_separate_stencil was taken,
        intel_create_private_renderbuffer was incorrectly not used.

      - [chad] Remove all code in intel_process_dri2_buffer for processing
        depth, stencil, and hiz buffers. That code is now dead.

    CC: Eric Anholt <eric@anholt.net>
    Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Comment 2 Chad Versace 2012-08-06 16:24:00 UTC
Assigning to self (chadv). The assertion failure occurs in HiZ code.
Comment 3 Chad Versace 2012-08-10 22:17:23 UTC
I am unable to reproduce this on Ivybridge with either Mesa master-996ff1c or the bisected commit. In my attempt to reproduce the bug, I used the following ~/.xinitrc.

Lu, can you still reproduce this bug? If so, please provide a backtrace.

--------
# file: ~/.xinitrc
startkde &
for ((x=0;x<1024;++x))
do
    if ! ./glx-visuals-depth -auto
    then
        echo "fail: $x"
        exit 1
     fi
done
--------
Comment 4 Albert Hopkins 2012-08-11 20:54:06 UTC
After googling I found this bz.  I'm also experiencing this issue with mesa-8.1_rc1 (Gentoo Linux)  and Totem on SandyBridge Mobile.  Specifically when I attempt to resize or fullscreen the totem window it happens 100% of the time.

    DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: Invalid argument
    DRM_IOCTL_I915_GEM_CONTEXT_CREATE failed: Invalid argument
    totem: intel_resolve_map.c:46: intel_resolve_map_set: Assertion `(*tail)->need == need' failed.
    Aborted
Comment 5 lu hua 2012-08-13 01:37:55 UTC
Backtrace:
#0  0x00000037d4036415 in raise () from /lib64/libc.so.6
#1  0x00000037d4037d2b in abort () from /lib64/libc.so.6
#2  0x00000037d402ed0d in __assert_fail () from /lib64/libc.so.6
#3  0x00007ffff4ed3055 in intel_resolve_map_set (head=<optimized out>, level=0,
    layer=0, need=GEN6_HIZ_OP_DEPTH_RESOLVE) at intel_resolve_map.c:46
#4  0x00007ffff4ee5f2a in brw_postdraw_set_buffers_need_resolve (brw=0x64b880)
    at brw_draw.c:350
#5  brw_try_draw_prims (max_index=<optimized out>, min_index=<optimized out>, ib=0x0,
    nr_prims=1, prim=0x7fffffffdf80, arrays=0x995b98, ctx=0x64b880) at brw_draw.c:539
#6  brw_draw_prims (ctx=0x64b880, prim=0x7fffffffdf80, nr_prims=1, ib=0x0,
    index_bounds_valid=<optimized out>, min_index=0, max_index=3, tfb_vertcount=0x0)
    at brw_draw.c:583
#7  0x00007ffff4a46709 in vbo_draw_arrays (ctx=0x64b880, mode=7, start=0,
    count=<optimized out>, numInstances=1, baseInstance=<optimized out>)
    at ./../vbo/vbo_exec_array.c:645
#8  0x00007ffff7d4e0bf in piglit_draw_rect (x=0, y=0, w=10, h=20)
    at /GFX/Test/Piglit/piglit/tests/util/piglit-util-gl.c:817
#9  0x0000000000400cd4 in draw (dpy=0x602010, config=0x624cb0)
    at /GFX/Test/Piglit/piglit/tests/glx/glx-visuals-stencil.c:64
#10 0x00007ffff7d4f92a in piglit_iterate_visuals_event_loop (dpy=0x602010,
    draw=0x400bd4 <draw>, config=0x624cb0)
    at /GFX/Test/Piglit/piglit/tests/util/piglit-glx-util.c:224
#11 0x00007ffff7d4fd76 in piglit_glx_iterate_visuals (draw=0x400bd4 <draw>)
    at /GFX/Test/Piglit/piglit/tests/util/piglit-glx-util.c:362
#12 0x0000000000400eca in main (argc=2, argv=0x7fffffffe308)
    at /GFX/Test/Piglit/piglit/tests/glx/glx-visuals-stencil.c:107
Comment 6 Chad Versace 2012-08-14 23:59:04 UTC
Patch is submitted to mesa-dev.

Author: Chad Versace <chad.versace@linux.intel.com>
Date:   Tue Aug 14 11:23:21 2012 -0700

    i965: Move hiz resolve to after renderbuffer resizing
    
    Do all pre-draw hiz resolves *after* the renderbuffers are resized by
    intel_prepare_render. Otherwise, we may resolve buffers that are
    immediately discarded afterwards.
    
    Fixes the assertion failure below when resizing windows in KDE and under
    some unknown circumstance in Chrome OS:
        intel_resolve_map.c:46: intel_resolve_map_set: Assertion
        `(*tail)->need == need' failed.
    
    Also, remove the comment that "resolves must occur [...] before setting up
    any hardware state". That was true when resolves were implemented with
    meta-ops, but no longer with blorp.
    
    CC: Stephane Marchesin <marcheu@chromium.org>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252
    Reported-by: Lu Hua <huax.lu@intel.com>
    Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Comment 7 lu hua 2012-08-17 07:00:08 UTC
Can't find "i965: Move hiz resolve to after renderbuffer resizing" on mesa master commit 1597176f7090eea73f41b3114ae2a02a50ac7a12.
Issue still exists.
Comment 8 Chad Versace 2012-08-17 20:33:43 UTC
(In reply to comment #7)
> Can't find "i965: Move hiz resolve to after renderbuffer resizing" on mesa
> master commit 1597176f7090eea73f41b3114ae2a02a50ac7a12.
> Issue still exists.

The patch has not yet been committed to master; it is still under reviewon the mailing list. In comment #6, I stated that the "Patch is submitted to mesa-dev".
Comment 9 Arun Raghavan 2012-08-20 01:41:32 UTC
*** Bug 53495 has been marked as a duplicate of this bug. ***
Comment 10 Chad Versace 2012-10-01 16:23:16 UTC
Fixed by

commit 88edbdf9f0c79e05593a71929f791fa4efb08ffb
Author: Chad Versace <chad.versace@linux.intel.com>
Date:   Tue Aug 14 11:23:21 2012 -0700

    i965: Move hiz resolve to after renderbuffer resizing (v2)
Comment 11 lu hua 2012-10-11 09:08:56 UTC
Verified.Fixed on master branch commit 87a34131c427b40a561cfef1513b446a0eeabc39.


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.