<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - [sna gen4] corrupt rendering (and flickering on redraw)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=55500#c52">Comment # 52</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED --- - [sna gen4] corrupt rendering (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:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>How about: 

diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index cc1778a..0a59681 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1895,6 +1895,9 @@ gen4_render_composite(struct sna *sna,
        tmp->has_component_alpha = false;
        tmp->need_magic_ca_pass = false;

+       if (!mask)
+               mask = sna->render.white_picture;
+
        if (mask) {
                if (mask->componentAlpha && PICT_FORMAT_RGB(mask->format)) {
                        tmp->has_component_alpha = true;</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>