From c5ea495f7adec6137c23e094b498816569b0d20f Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 11 Aug 2020 12:42:35 +0200 Subject: [PATCH] compositor: ignore views on other outputs during compositor_accumulate_damage() compositor_accumulate_damage() is called for each output during repaint. The DRM backend will only set keep_buffer for the surfaces that are visible on the current output. So a buffer_ref is released that may still be needed. When the output that shows the surface is repainted, the buffer_ref is gone and the surface cannot be put on a plane. Ignore all surfaces that are not visible on the current output to avoid this. Signed-off-by: Michael Olbrich --- libweston/compositor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index a864d5a9..57b22030 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -2491,8 +2491,9 @@ view_accumulate_damage(struct weston_view *view, } static void -compositor_accumulate_damage(struct weston_compositor *ec) +output_accumulate_damage(struct weston_output *output) { + struct weston_compositor *ec = output->compositor; struct weston_plane *plane; struct weston_view *ev; pixman_region32_t opaque, clip; @@ -2521,6 +2522,9 @@ compositor_accumulate_damage(struct weston_compositor *ec) ev->surface->touched = false; wl_list_for_each(ev, &ec->view_list, link) { + /* Ignore views not visible on the current output */ + if (!(ev->output_mask & (1u << output->id))) + continue; if (ev->surface->touched) continue; ev->surface->touched = true; @@ -2763,7 +2767,7 @@ weston_output_repaint(struct weston_output *output, void *repaint_data) } } - compositor_accumulate_damage(ec); + output_accumulate_damage(output); pixman_region32_init(&output_damage); pixman_region32_intersect(&output_damage,