1From cda838e3cc457643c962b9414138076e89e40ffd Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Thu, 3 Nov 2022 11:57:59 +0800
4Subject: [PATCH 04/93] Revert "libweston: Check output placement"
5
6This reverts commit 7e7198bd881859b20f74cbdae46b5700ff1cc5d4.
7
8Allow outputs overlapping.
9
10Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
11---
12 libweston/compositor.c | 56 ------------------------------------------
13 1 file changed, 56 deletions(-)
14
15diff --git a/libweston/compositor.c b/libweston/compositor.c
16index 6cfcba2..7b15769 100644
17--- a/libweston/compositor.c
18+++ b/libweston/compositor.c
19@@ -6616,18 +6616,6 @@ weston_output_set_position(struct weston_output *output, int x, int y)
20 WL_EXPORT void
21 weston_output_move(struct weston_output *output, int x, int y)
22 {
23-	/* XXX: we should probably perform some sanity checking here
24-	 * as we do for weston_output_enable, and allow moves to fail.
25-	 *
26-	 * However, while a front-end is rearranging outputs it may
27-	 * pass through indeterminate states where outputs overlap
28-	 * or are discontinuous, and this may be ok as long as no
29-	 * input processing or rendering occurs at that time.
30-	 *
31-	 * Ultimately, we probably need a way to pass complete output
32-	 * config atomically to libweston.
33-	 */
34-
35 	output->compositor->output_flow_dirty = true;
36 	weston_output_set_position(output, x, y);
37 }
38@@ -7250,45 +7238,6 @@ weston_output_create_heads_string(struct weston_output *output)
39 	return str;
40 }
41
42-static bool
43-weston_outputs_overlap(struct weston_output *a, struct weston_output *b)
44-{
45-	bool overlap;
46-	pixman_region32_t intersection;
47-
48-	pixman_region32_init(&intersection);
49-	pixman_region32_intersect(&intersection, &a->region, &b->region);
50-	overlap = pixman_region32_not_empty(&intersection);
51-	pixman_region32_fini(&intersection);
52-
53-	return overlap;
54-}
55-
56-/* This only works if the output region is current!
57- *
58- * That means we shouldn't expect it to return usable results unless
59- * the output is at least undergoing enabling.
60- */
61-static bool
62-weston_output_placement_ok(struct weston_output *output)
63-{
64-	struct weston_compositor *c = output->compositor;
65-	struct weston_output *iter;
66-
67-	wl_list_for_each(iter, &c->output_list, link) {
68-		if (!iter->enabled)
69-			continue;
70-
71-		if (weston_outputs_overlap(iter, output)) {
72-			weston_log("Error: output '%s' overlaps enabled output '%s'.\n",
73-				   output->name, iter->name);
74-			return false;
75-		}
76-	}
77-
78-	return true;
79-}
80-
81 /** Constructs a weston_output object that can be used by the compositor.
82  *
83  * \param output The weston_output object that needs to be enabled. Must not
84@@ -7368,11 +7317,6 @@ weston_output_enable(struct weston_output *output)
85 	weston_output_transform_scale_init(output, output->transform, output->scale);
86
87 	weston_output_init_geometry(output, output->x, output->y);
88-
89-	/* At this point we have a valid region so we can check placement. */
90-	if (!weston_output_placement_ok(output))
91-		return -1;
92-
93 	weston_output_damage(output);
94
95 	wl_list_init(&output->animation_list);
96--
972.20.1
98
99