<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:ppaalanen@gmail.com" title="Pekka Paalanen <ppaalanen@gmail.com>"> <span class="fn">Pekka Paalanen</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED --- - Protocol: wl_buffer.release is racy"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75303">bug 75303</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>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>NOTABUG
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED --- - Protocol: wl_buffer.release is racy"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75303#c3">Comment # 3</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED --- - Protocol: wl_buffer.release is racy"
href="https://bugs.freedesktop.org/show_bug.cgi?id=75303">bug 75303</a>
from <span class="vcard"><a class="email" href="mailto:ppaalanen@gmail.com" title="Pekka Paalanen <ppaalanen@gmail.com>"> <span class="fn">Pekka Paalanen</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=75303#c2">comment #2</a>)
<span class="quote">> We do that now. Every attach+commit is followed by a release. If a client
> attaches a buffer to two surfaces, it needs to receive two release events
> before it can use the buffer again without causing artifacts.</span >
No, I do not think the code in Weston works like that at all.
We have exactly one struct weston_buffer per each wl_buffer protocol object,
right? Struct weston_buffer has one reference counter. When that reference
counter hits zero, wl_buffer.release event is sent.
Struct weston_surface and others use struct weston_buffer_reference to hold
several references to various wl_buffers (weston_buffers). We do not have
per-surface reference counters, and weston_buffer_reference() function makes no
difference between different struct weston_surfaces.
The function weston_buffer_from_resource() does not create a new struct
weston_buffer *every* time it is called; it checks if the destroy listener on
the wl_buffer already exists, and if it does, it returns the existing
weston_buffer. So to me it looks like we never have more than one weston_buffer
(and a reference counter) per wl_buffer.
Therefore I cannot see how attaching the same wl_buffer to two wl_surfaces
could generate more than one wl_buffer.release, unless the compositor releases
before processing the second attach+commit, which would imply at least a
compositor repaint in between.
The Presentation extension will add another case. A client may queue the same
wl_buffer multiple times to the same wl_surface. That is not merged yet, but
it's a use case that should to be kept in mind.
At the very least, if you can show that Weston actually follows the every
attach+commit is eventually replied with a wl_buffer.release scheme, then we
still need to fix the protocol specification in wayland.xml to explicitly
require this. The current protocol specification does not require clients to
count the commits and releases but implies that the server handles all that.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>