<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [SNA/HSW] DRI3 rendering gets stuck waiting for present idle notify event"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=84252">84252</a>
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>intel-gfx-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-gfx-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SNA/HSW] DRI3 rendering gets stuck waiting for present idle notify event
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-gfx-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>liquid.acid@gmx.net
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>XOrg CVS
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>DRM/Intel
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>DRI
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

this is a cleaned up version of (the now closed) <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - [HSW] suspend/resume sometimes leaves DRI crippled"
   href="show_bug.cgi?id=81548">bug #81548</a>.

Software stack:
xorg-server git tip
mesa git tip
libdrm git tip
libxcb git tip
vanilla kernel 3.16.3

Primary GPU is a hsw/gen7.5 (i7-4700HQ), the secondary GPU is a R9 M265X.
DRI3/PRIME is used.

Issue: My test application is the x86 variant of HL2 Ep1. After loading a
specific savegame I can reliably get the game to "hang". Attaching gdb yields
the backtrace given below.

Affected configurations: DRI3 with SNA backend enabled in the DDX.
Switching to the UXA backend removes the issue, which (maybe?) points at
synchronisation issues that are discussed in <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [dri3] Mesa does not support explicit fencing"
   href="show_bug.cgi?id=81551">bug #81551</a>. The patch proposed in
the bugreport is applied, but doesn't cure the issue.

Backtrace:
#0  0xf771cd10 in __kernel_vsyscall ()
(gdb) bt
#0  0xf771cd10 in __kernel_vsyscall ()
#1  0xf7348c8c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#2  0xf75e55cc in pthread_cond_wait () from /lib/libc.so.6
#3  0xf70b751f in ?? () from /usr/lib/libxcb.so.1
#4  0xf70c13a5 in xcb_wait_for_special_event () from /usr/lib/libxcb.so.1
#5  0xf7498b49 in dri3_find_back (c=c@entry=0xa410000,
priv=priv@entry=0x9fe23f0) at dri3_glx.c:1191
#6  0xf749932b in dri3_get_buffer (format=4099,
buffer_type=buffer_type@entry=dri3_buffer_back,
loaderPrivate=loaderPrivate@entry=0x9fe23f0, 
    driDrawable=<optimized out>) at dri3_glx.c:1217
#7  0xf7499fd0 in dri3_get_buffers (driDrawable=0xa455110, format=4099,
stamp=0x9e706e0, loaderPrivate=0x9fe23f0, buffer_mask=<optimized out>, 
    buffers=0xb8ce6bec) at dri3_glx.c:1394
#8  0xf43a4cf3 in dri_image_drawable_get_buffers (statts_count=<optimized out>,
statts=<optimized out>, images=<optimized out>, drawable=<optimized out>)
    at dri2.c:254
#9  dri2_allocate_textures (ctx=0xa455590, drawable=0x9e706e0,
statts=0x9ff2b80, statts_count=2) at dri2.c:377
#10 0xf43a199c in dri_st_framebuffer_validate (stctx=0xa579000,
stfbi=0x9e706e0, statts=0x9ff2b80, count=2, out=0xb8ce6cc0) at
dri_drawable.c:83
#11 0xf42d0378 in st_framebuffer_validate (stfb=stfb@entry=0x9ff2800,
st=st@entry=0xa579000) at ../../src/mesa/state_tracker/st_manager.c:200
#12 0xf42d1bb7 in st_manager_validate_framebuffers (st=st@entry=0xa579000) at
../../src/mesa/state_tracker/st_manager.c:862
#13 0xf4292bf6 in st_validate_state (st=st@entry=0xa579000) at
../../src/mesa/state_tracker/st_atom.c:180
#14 0xf429a6e5 in st_BlitFramebuffer (ctx=0x9ef0000, srcX0=0, srcY0=0,
srcX1=1920, srcY1=1080, dstX0=0, dstY0=1080, dstX1=1920, dstY1=0, mask=16384, 
    filter=9728) at ../../src/mesa/state_tracker/st_cb_blit.c:94
#15 0xf41358c3 in _mesa_BlitFramebuffer (srcX0=0, srcY0=0, srcX1=1920,
srcY1=1080, dstX0=0, dstY0=1080, dstX1=1920, dstY1=0, mask=16384, filter=9728)
    at ../../src/mesa/main/blit.c:509
#16 0xf5831e13 in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life 2/bin/libtogl.so
#17 0xf5832617 in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life 2/bin/libtogl.so
#18 0xf5823c3b in IDirect3DDevice9::Present(_RECT const*, _RECT const*, void*,
RGNDATA const*) ()
   from /mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/libtogl.so
#19 0xecd6646d in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/shaderapidx9.so
#20 0xf14edfde in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/materialsystem.so
#21 0xf14ee31d in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/materialsystem.so
#22 0xf14ce644 in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/materialsystem.so
#23 0xf14d684a in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/materialsystem.so
#24 0xf14d6697 in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/materialsystem.so
#25 0xf5d0b49a in ?? () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life
2/bin/libvstdlib.so
#26 0xf5df29e0 in CThread::ThreadProc(void*) () from
/mnt/extern/superNova/steam-native/SteamApps/common/Half-Life 2/bin/libtier0.so
#27 0xf7344f45 in start_thread () from /lib/libpthread.so.0
#28 0xf75d88ee in clone () from /lib/libc.so.6

With best wishes,
Tobias</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>