summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-06-21 19:34:19 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-06-21 19:35:45 +0200
commit6f5fc69b6785ec340f047053c581a1a7ac30a9b0 (patch)
tree6a0d80e0efb2f42f058f932183811c129060c6ff
parentec138901c1c7537dfa4f4575357db05bc5b30d8b (diff)
compositor: Decrement buffers busy_count in post_release
-rw-r--r--compositor/compositor.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/compositor/compositor.c b/compositor/compositor.c
index 21fcfb47..f51973e0 100644
--- a/compositor/compositor.c
+++ b/compositor/compositor.c
@@ -26,6 +26,7 @@
#include <stdint.h>
#include <limits.h>
#include <stdarg.h>
+#include <assert.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
@@ -619,12 +620,10 @@ wlsc_compositor_damage_all(struct wlsc_compositor *compositor)
static inline void
wlsc_buffer_post_release(struct wl_buffer *buffer)
{
- if (buffer->client == NULL) {
- fprintf(stderr, "buffer.release warning: buffer.client: %p\n",
- buffer->client);
+ if (buffer == NULL || --buffer->busy_count > 0)
return;
- }
+ assert(buffer->client != NULL);
wl_client_post_event(buffer->client,
&buffer->resource.object,
WL_BUFFER_RELEASE);
@@ -636,12 +635,8 @@ wlsc_output_finish_frame(struct wlsc_output *output, int msecs)
struct wlsc_compositor *compositor = output->compositor;
struct wlsc_animation *animation, *next;
- if (output->scanout_buffer) {
- if (--output->scanout_buffer->busy_count == 0)
- wlsc_buffer_post_release(output->scanout_buffer);
-
- output->scanout_buffer = NULL;
- }
+ wlsc_buffer_post_release(output->scanout_buffer);
+ output->scanout_buffer = NULL;
output->finished = 1;
@@ -942,10 +937,7 @@ surface_attach(struct wl_client *client,
struct wlsc_surface *es = (struct wlsc_surface *) surface;
buffer->busy_count++;
-
- if (es->buffer && es->buffer->busy_count > 0)
- if (--es->buffer->busy_count == 0)
- wlsc_buffer_post_release(es->buffer);
+ wlsc_buffer_post_release(es->buffer);
es->buffer = buffer;
wl_list_remove(&es->buffer_destroy_listener.link);