<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_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Ksnapshot (KDE) broken when using xf86-video-intel-2.99.916 + DRI3"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90836">bug 90836</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;">Status</td>
           <td>NEEDINFO
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Ksnapshot (KDE) broken when using xf86-video-intel-2.99.916 + DRI3"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90836#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Ksnapshot (KDE) broken when using xf86-video-intel-2.99.916 + DRI3"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=90836">bug 90836</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, there is an interesting quirk in ksnapshot:

000:<:0732: 40: Request(1): CreateWindow depth=0x00 window=0x02e00145
parent=0x000000a4 x=-10000 y=-10000 width=683 height=307 border-width=0
class=CopyFromParent(0x0000) visual=CopyFromParent(0x00000000)
value-list={background-pixel=0x00ffffff border-pixel=0x00000000}
...
000:<:075c:  8: Request(8): MapWindow window=0x02e00145
000:>:075d: Event MapNotify(19) event=0x02e00145 window=0x02e00145
override-redirect=true(0x01)
000:>:075d: Event Expose(12) window=0x02e00145 x=0 y=0 width=683 height=307
count=0x0000
...
000:<:0765: 16: Request(53): CreatePixmap depth=0x18 pid=0x02e00148
drawable=0x0
00000a4 width=1366 height=768
000:<:0766: 20: RENDER-Request(138,4): CreatePicture pid=0x02e00149
drawable=0x0
2e00148 format=0x0000002a values={}
000:<:0767: 16: Request(55): CreateGC cid=0x02e0014a drawable=0x02e00148
values=
{}
000:<:0768: 16: Request(56): ChangeGC gc=0x02e0014a
values={subwindow-mode=Inclu
deInferiors(0x01)}
000:<:0769: 28: Request(62): CopyArea src-drawable=0x000000a4
dst-drawable=0x02e
00148 gc=0x02e0014a src-x=0 src-y=0 dst-x=0 dst-y=0 width=1366 height=768
000:<:076a:  8: Request(60): FreeGC gc=0x02e0014a
000:<:076b:  8: Request(27): UngrabPointer time=0x0094b535
000:<:076c:  8: Request(10): UnmapWindow window=0x02e00145

So ksnapshot does actually copy the screen while it itself is mapped (and
visible). However, at the time of its screengrab, it hasn't rendered so it will
effectively be transparent.

So the problem is that image does somehow contain rendering from the future.

Hmm, 

[  9745.803] sna_pixmap_make_cow: moo! attaching clone to pixmap=6954
(source=966, handle=221)

pixmap=6954 is, if you haven't guess it, ksnapshot's screengrab. So we are
deferring the copy here - but since the source is actually a foriegn DRI3
buffer, kwin renders into it unbeknownst to us.

commit ada30742ec115a44445e24c1775583b2684d94a4
Author: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>>
Date:   Fri Jun 5 16:44:18 2015 +0100

    sna: Add COW source pixmap to flushing list

    In the case of an exported pixmap, e.g. with DRI3, it is possible for
    the client to render into the pixmap whilst we are unaware. To serialise
    the xserver and the client, we flush all operations on exported pixmaps
    before talking to the client. In the case of COW however, we did not
    flush the copy-on-write when transferring control to the client, and
    thereby we could capture the modified contents.

    Bugzilla: <a href="https://bugs.kde.org/show_bug.cgi?id=340202">https://bugs.kde.org/show_bug.cgi?id=340202</a>
    Bugzilla: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Ksnapshot (KDE) broken when using xf86-video-intel-2.99.916 + DRI3"
   href="show_bug.cgi?id=90836">https://bugs.freedesktop.org/show_bug.cgi?id=90836</a>
    Signed-off-by: Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>></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>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>