From f9bd54682b3f5350367a8fb7ae5d2288201231ab Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 15 May 2018 17:09:53 +0100 Subject: [PATCH] compositor-drm: Remove unnecessary picked_scanout variable e2e80136334f fixed the same issue as df573031d0ba in a different way. The latter commit (applied earlier in the upstream tree) adds a variable to assign_planes to keep track of when we successfully assign a view to the scanout plane, and doesn't call prepare_scanout_view if we have. The former commit adds this checking inside prepare_scanout_view: if the pending output state already has a framebuffer assigned to the scanout plane, we drop out of prepare_scanout_view early. The picked_scanout variable inside assign_planes can thus be removed. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen Tested-by: Emre Ucan --- libweston/compositor-drm.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index c5f971d2..2e3cbd93 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -3099,7 +3099,6 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data) struct weston_view *ev; pixman_region32_t surface_overlap, renderer_region; struct weston_plane *primary, *next_plane; - bool picked_scanout = false; assert(!output->state_last); state = drm_output_state_duplicate(output->state_cur, @@ -3147,19 +3146,13 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data) &ev->transform.boundingbox); next_plane = NULL; - if (pixman_region32_not_empty(&surface_overlap) || picked_scanout) + if (pixman_region32_not_empty(&surface_overlap)) next_plane = primary; if (next_plane == NULL) next_plane = drm_output_prepare_cursor_view(state, ev); - /* If a higher-stacked view already got assigned to scanout, it's incorrect to - * assign a subsequent (lower-stacked) view to scanout. - */ - if (next_plane == NULL) { + if (next_plane == NULL) next_plane = drm_output_prepare_scanout_view(state, ev); - if (next_plane) - picked_scanout = true; - } if (next_plane == NULL) next_plane = drm_output_prepare_overlay_view(state, ev);