<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><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> changed
              <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO --- - [hsw] WAIT_FOR_EVENT hangs (full screen vsync on pipe 1 with BCS)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=69119">bug 69119</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Summary</td>
           <td>GPU hangs during full screen games on multi-monitor setup
           </td>
           <td>[hsw] WAIT_FOR_EVENT hangs (full screen vsync on pipe 1 with BCS)
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO --- - [hsw] WAIT_FOR_EVENT hangs (full screen vsync on pipe 1 with BCS)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=69119#c8">Comment # 8</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO --- - [hsw] WAIT_FOR_EVENT hangs (full screen vsync on pipe 1 with BCS)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=69119">bug 69119</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>And to be extra safe, do the check before incrementing the batch pointer:

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index be02a78..6a5241a 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3392,6 +3392,14 @@ static bool sna_emit_wait_for_scanline_hsw(struct sna
*sna,
        b = kgem_get_batch(&sna->kgem);
        sna->kgem.nbatch += 5;

+       /* Reduce the range slightly to accommodate some latency
+        * in detection: <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO --- - [hsw] WAIT_FOR_EVENT hangs (full screen vsync on pipe 1 with BCS)"
   href="show_bug.cgi?id=69119">https://bugs.freedesktop.org/show_bug.cgi?id=69119</a>
+        */
+       y1 = (y1 + 7) & ~7;
+       y2 = (y2 - 7) & ~7;
+       if (y2 <= y1)
+               return false;
+
        /* The documentation says that the LOAD_SCAN_LINES command
         * always comes in pairs. Don't ask me why. */
        switch (pipe) {</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>
      </ul>
    </body>
</html>