<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO --- - Transient corruption in some applications (regression)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=79992#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEEDINFO "
   title="NEEDINFO --- - Transient corruption in some applications (regression)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=79992">bug 79992</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>Ah. I see something wrong in that patch indeed, try:

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 13fe6ed..ce04ca0 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -14382,16 +14382,15 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n,
xRectangle *rect)
                        RegionTranslate(&region, dx, dy);
                }

-               if (region_subsumes_drawable(&region, &pixmap->drawable)) {
-                       discard_cpu_damage(sna, priv);
-                       hint |= IGNORE_CPU | REPLACES;
-               } else {
-                       if ((flags & 2) == 0)
-                               hint |= IGNORE_CPU;
-                       if (priv->cpu_damage &&
-                           region_subsumes_damage(&region, priv->cpu_damage))
{
+               if ((flags & 2) == 0) {
+                       hint |= IGNORE_CPU;
+                       if (region_subsumes_drawable(&region,
&pixmap->drawable)) {
                                discard_cpu_damage(sna, priv);
-                               hint |= IGNORE_CPU;
+                               hint |= REPLACES;
+                       } else {
+                               if (priv->cpu_damage &&
+                                   region_subsumes_damage(&region,
priv->cpu_damage))
+                                       discard_cpu_damage(sna, priv);
                        }
                }
                if (priv->cpu_damage == NULL) {</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>