<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED --- - [sna gen4 w/a] corrupt rendering (including wrong rendering of characters and flickering on redraw)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55500#c177">Comment # 177</a>
              on <a class="bz_bug_link 
          bz_status_ASSIGNED "
   title="ASSIGNED --- - [sna gen4 w/a] corrupt rendering (including wrong rendering of characters and flickering on redraw)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55500">bug 55500</a>
              from <span class="vcard"><a class="email" href="mailto:ejsheldrake@gmail.com" title="Edward Sheldrake <ejsheldrake@gmail.com>"> <span class="fn">Edward Sheldrake</span></a>
</span></b>
        <pre>Running with all workarounds disabled, this change doesn't fix anything nor
seem to make any difference, but anyway:
Shouldn't the cache flush bits be in dword 0 for gen4 GEN4_PIPE_CONTROL? Maybe
gen5 also?

diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index 1d164b6..894418b 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -575,8 +575,10 @@ inline static void
 gen4_emit_pipe_flush(struct sna *sna)
 {
 #if 1
-    OUT_BATCH(GEN4_PIPE_CONTROL | (4 - 2));
-    OUT_BATCH(GEN4_PIPE_CONTROL_WC_FLUSH);
+    OUT_BATCH(GEN4_PIPE_CONTROL |
+          GEN4_PIPE_CONTROL_WC_FLUSH |
+          (4 - 2));
+    OUT_BATCH(0);
     OUT_BATCH(0);
     OUT_BATCH(0);
 #else
@@ -601,8 +603,10 @@ inline static void
 gen4_emit_pipe_invalidate(struct sna *sna)
 {
 #if 0
-    OUT_BATCH(GEN4_PIPE_CONTROL | (4 - 2));
-    OUT_BATCH(GEN4_PIPE_CONTROL_WC_FLUSH | GEN4_PIPE_CONTROL_TC_FLUSH);
+    OUT_BATCH(GEN4_PIPE_CONTROL |
+          GEN4_PIPE_CONTROL_WC_FLUSH | GEN4_PIPE_CONTROL_TC_FLUSH |
+          (4 - 2));
+    OUT_BATCH(0);
     OUT_BATCH(0);
     OUT_BATCH(0);
 #else</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>