<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [snb] TearFree now triggers stuck semaphores (due to Eliminate the synchronous wait from inside TearFree)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=70764#c18">Comment # 18</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [snb] TearFree now triggers stuck semaphores (due to Eliminate the synchronous wait from inside TearFree)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=70764">bug 70764</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>Ok, try this simpler one instead:

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 7fcade6..5c04d78 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4299,7 +4299,7 @@ static bool wait_for_shadow(struct sna *sna, struct
sna_pixmap *priv, unsigned f
        damage = sna->mode.shadow_damage;
        sna->mode.shadow_damage = NULL;

-       while (sna->mode.shadow_flip && sna_mode_has_pending_events(sna))
+       while (sna->mode.shadow_flip && sna_mode_wait_for_event(sna))
                sna_mode_wakeup(sna);

        if (sna->mode.shadow_flip) {</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>