diff options
author | Ray Strode <rstrode@redhat.com> | 2016-02-02 11:13:34 -0500 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2016-02-02 11:15:43 -0500 |
commit | 7adbb587365a75e283736a36bd009a6360907d62 (patch) | |
tree | 715cac0643d9247a5bfbdd8866e83943f6d45cf8 | |
parent | 0165cb697466ba0843b993416e00d4f768c00d45 (diff) | |
download | mutter-7adbb587365a75e283736a36bd009a6360907d62.tar.gz |
wayland: don't prematurely release EGL buffers
commit 0165cb697466ba0843b993416e00d4f768c00d45 changed
mutter to release committed shm buffers as soon as they were
uploaded to the GPU.
It also inadvertently changed mutter to prematurely
release EGL buffers (which never get copied, but get used
directly).
This commit corrects that mistake.
https://bugzilla.gnome.org/show_bug.cgi?id=761312
-rw-r--r-- | src/wayland/meta-wayland-buffer.c | 3 | ||||
-rw-r--r-- | src/wayland/meta-wayland-buffer.h | 1 | ||||
-rw-r--r-- | src/wayland/meta-wayland-surface.c | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c index bb0e8d234..1d9b0c3b1 100644 --- a/src/wayland/meta-wayland-buffer.c +++ b/src/wayland/meta-wayland-buffer.c @@ -140,6 +140,9 @@ meta_wayland_buffer_ensure_texture (MetaWaylandBuffer *buffer) buffer->texture = texture; + if (shm_buffer) + buffer->copied_data = TRUE; + out: return buffer->texture; } diff --git a/src/wayland/meta-wayland-buffer.h b/src/wayland/meta-wayland-buffer.h index 9f6a5bf83..22cbcc1f4 100644 --- a/src/wayland/meta-wayland-buffer.h +++ b/src/wayland/meta-wayland-buffer.h @@ -41,6 +41,7 @@ struct _MetaWaylandBuffer uint32_t ref_count; uint32_t accessible : 1; + uint32_t copied_data : 1; }; MetaWaylandBuffer * meta_wayland_buffer_from_resource (struct wl_resource *resource); diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 4f8b244f3..cab05df57 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -608,7 +608,7 @@ apply_pending_state (MetaWaylandSurface *surface, if (!cairo_region_is_empty (pending->damage)) surface_process_damage (surface, pending->damage); - if (pending->buffer) + if (pending->buffer && pending->buffer->copied_data) meta_wayland_buffer_release_control (pending->buffer); surface->offset_x += pending->dx; |