diff options
author | emersion <contact@emersion.fr> | 2018-06-07 18:57:06 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-06-08 00:05:11 +0100 |
commit | 3e83f9d6b89f9b3a7af9761b4adffd173858e637 (patch) | |
tree | 7d16a847aec1054d7723d1329543b8858d9165d0 | |
parent | 32f9699359a4caeb833c4f38c61f065d06d551f6 (diff) |
surface: don't release wl_drm and linux-dmabuf buffers early
-rw-r--r-- | types/wlr_surface.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c index 9c3eb86d..fca4e847 100644 --- a/types/wlr_surface.c +++ b/types/wlr_surface.c @@ -394,6 +394,10 @@ static void surface_apply_damage(struct wlr_surface *surface, } wl_shm_buffer_end_access(buf); + + // We've uploaded the wl_shm_buffer data to the GPU, we won't access the + // wl_buffer anymore + surface_state_release_buffer(surface->current); } else if (invalid_buffer || reupload_buffer) { wlr_texture_destroy(surface->texture); @@ -409,9 +413,10 @@ static void surface_apply_damage(struct wlr_surface *surface, surface->texture = NULL; wlr_log(L_ERROR, "Unknown buffer handle attached"); } - } - surface_state_release_buffer(surface->current); + // Don't release the wl_buffer yet: since the texture is shared with the + // client, we'll access the wl_buffer when rendering + } } static void surface_commit_pending(struct wlr_surface *surface) { |