meta-digi/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-graphics/wayland/weston/0001-Clone-mode-not-support...

63 lines
2.0 KiB
Diff

From aa4cb0e6576a98dc6212ed11af0e8fd129b21d15 Mon Sep 17 00:00:00 2001
From: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
Date: Mon, 18 Mar 2024 16:43:33 +0100
Subject: [PATCH 1/4] Clone mode not supported
Display controller doesn't support several outputs.
During a head changed, get & close the weston head which is enabled.
Then an output can enabled (only one even if several output have
connected).
Upstream-Status: Pending
Signed-off-by: Yannick Fertre <yannick.fertre@foss.st.com>
---
compositor/main.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/compositor/main.c b/compositor/main.c
index 0e3d375..365dc1c 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -2668,22 +2668,30 @@ drm_heads_changed(struct wl_listener *listener, void *arg)
/* We need to collect all cloned heads into outputs before enabling the
* output.
*/
+ while ((head = weston_compositor_iterate_heads(compositor, head))) {
+ enabled = weston_head_is_enabled(head);
+
+ if (enabled) {
+ drm_head_disable(head);
+ weston_head_reset_device_changed(head);
+ }
+ }
+
while ((head = wet_backend_iterate_heads(wet, wb, head))) {
connected = weston_head_is_connected(head);
enabled = weston_head_is_enabled(head);
- changed = weston_head_is_device_changed(head);
forced = drm_head_should_force_enable(wet, head);
if ((connected || forced) && !enabled) {
+ /*
+ * Prepare & enable only the first head connected.
+ * CRTC doesn't support several output.
+ */
drm_head_prepare_enable(wet, head);
- } else if (!(connected || forced) && enabled) {
- drm_head_disable(head);
- } else if (enabled && changed) {
- weston_log("Detected a monitor change on head '%s', "
- "not bothering to do anything about it.\n",
- weston_head_get_name(head));
+
+ weston_head_reset_device_changed(head);
+ break;
}
- weston_head_reset_device_changed(head);
}
if (drm_process_layoutputs(wet) < 0)
--
2.34.1