From bb075f005d993e43b306059b5ea2d466e10d6b06 Mon Sep 17 00:00:00 2001 From: Jeffy Chen Date: Thu, 3 Nov 2022 11:57:59 +0800 Subject: [PATCH 04/79] Revert "libweston: Check output placement" This reverts commit 7e7198bd881859b20f74cbdae46b5700ff1cc5d4. Allow outputs overlapping. Signed-off-by: Jeffy Chen --- libweston/compositor.c | 56 ------------------------------------------ 1 file changed, 56 deletions(-) diff --git a/libweston/compositor.c b/libweston/compositor.c index 6cfcba25..7b157695 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -6616,18 +6616,6 @@ weston_output_set_position(struct weston_output *output, int x, int y) WL_EXPORT void weston_output_move(struct weston_output *output, int x, int y) { - /* XXX: we should probably perform some sanity checking here - * as we do for weston_output_enable, and allow moves to fail. - * - * However, while a front-end is rearranging outputs it may - * pass through indeterminate states where outputs overlap - * or are discontinuous, and this may be ok as long as no - * input processing or rendering occurs at that time. - * - * Ultimately, we probably need a way to pass complete output - * config atomically to libweston. - */ - output->compositor->output_flow_dirty = true; weston_output_set_position(output, x, y); } @@ -7250,45 +7238,6 @@ weston_output_create_heads_string(struct weston_output *output) return str; } -static bool -weston_outputs_overlap(struct weston_output *a, struct weston_output *b) -{ - bool overlap; - pixman_region32_t intersection; - - pixman_region32_init(&intersection); - pixman_region32_intersect(&intersection, &a->region, &b->region); - overlap = pixman_region32_not_empty(&intersection); - pixman_region32_fini(&intersection); - - return overlap; -} - -/* This only works if the output region is current! - * - * That means we shouldn't expect it to return usable results unless - * the output is at least undergoing enabling. - */ -static bool -weston_output_placement_ok(struct weston_output *output) -{ - struct weston_compositor *c = output->compositor; - struct weston_output *iter; - - wl_list_for_each(iter, &c->output_list, link) { - if (!iter->enabled) - continue; - - if (weston_outputs_overlap(iter, output)) { - weston_log("Error: output '%s' overlaps enabled output '%s'.\n", - output->name, iter->name); - return false; - } - } - - return true; -} - /** Constructs a weston_output object that can be used by the compositor. * * \param output The weston_output object that needs to be enabled. Must not @@ -7368,11 +7317,6 @@ weston_output_enable(struct weston_output *output) weston_output_transform_scale_init(output, output->transform, output->scale); weston_output_init_geometry(output, output->x, output->y); - - /* At this point we have a valid region so we can check placement. */ - if (!weston_output_placement_ok(output)) - return -1; - weston_output_damage(output); wl_list_init(&output->animation_list); -- 2.20.1