summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Hoosier <matt.hoosier@gmail.com>2017-09-26 08:09:40 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-09-26 11:22:45 -0500
commit3052bc7e6d9e05449908a22105a7b3c5143838e7 (patch)
tree423b96542284a2d6b9f102268092bef77209b082
parent2a0c6c331e79b8f2926d4e3529421f8f5f592a0b (diff)
compositor: fix starvation of wl_buffer::release
This change replaces a queued emission of buffer-release events (which is prone to starvation) with a regular event emission. This means that client programs no longer need to secretly install surface frame listeners just to guarantee that they get correctly notified of buffer lifecycle events. v2: More information about the historical reasons why this change hadn't happened yet, and the consensus to finally move ahead with it can be found at the discussion terminating in this message: https://lists.freedesktop.org/archives/wayland-devel/2017-September/035147.html Signed-off-by: Matt Hoosier <matt.hoosier@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
-rw-r--r--clients/nested.c3
-rw-r--r--libweston/compositor.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/clients/nested.c b/clients/nested.c
index e9070e9b..e2bdf684 100644
--- a/clients/nested.c
+++ b/clients/nested.c
@@ -228,8 +228,7 @@ nested_buffer_reference(struct nested_buffer_reference *ref,
ref->buffer->busy_count--;
if (ref->buffer->busy_count == 0) {
assert(wl_resource_get_client(ref->buffer->resource));
- wl_resource_queue_event(ref->buffer->resource,
- WL_BUFFER_RELEASE);
+ wl_buffer_send_release(ref->buffer->resource);
}
wl_list_remove(&ref->destroy_listener.link);
}
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 813b6634..878cd535 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -1954,8 +1954,7 @@ weston_buffer_reference(struct weston_buffer_reference *ref,
ref->buffer->busy_count--;
if (ref->buffer->busy_count == 0) {
assert(wl_resource_get_client(ref->buffer->resource));
- wl_resource_queue_event(ref->buffer->resource,
- WL_BUFFER_RELEASE);
+ wl_buffer_send_release(ref->buffer->resource);
}
wl_list_remove(&ref->destroy_listener.link);
}