<html>
    <head>
      <base href="https://bugzilla.gnome.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - wayland: drawing artifacts as a result of incorrect use of shm_surface busy state"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=761733">761733</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wayland: drawing artifacts as a result of incorrect use of shm_surface busy state
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Platform
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>gtk+
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: Wayland
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>gtk-bugs@gtk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>reveman@chromium.org
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>gtk-bugs@gtk.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>rob@robster.org.uk, wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>GNOME version</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Gdk's wayland backend attempts to use the "busy" state of the shm_surface to
determine if a blit is needed or if the buffer can be updated directly. This is
broken as by committing a buffer that is currently busy you lose track of when
the buffer is actually released.

Example:

1. gdk creates buffer [gdk-state:not-busy][actual-state:not-busy]
2. gdk updates buffer WITHOUT blit
3. gdk commits and marks buffer as busy [gdk-state:busy][actual-state:busy]
4. compositor is done with buffer and sends a release event to gdk
[gdk-state:busy][actual-state:not-busy]
5. gdk updates buffer WITH blit as it's still seen as busy before the release
event as been processed
6. gdk commits and marks buffer as busy [gdk-state:busy][actual-state:busy]
7. gdk receives/processes the release event from the previous commit
[gdk-state:not-busy][actual-state:busy] (BAD)
8. gdk updates buffer WITHOUT blit as from gdk's pov it's not busy (BAD)

This can result in drawing artifacts as the compositor might use the buffer at
the same time as gdk is updating it.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>