new/yocto/meta-rockchip/recipes-graphics/wayland/weston_10.0.2/0011-compositor-Support-freezing-display.patch
2025-05-10 21:58:58 +08:00

46 lines
1.2 KiB
Diff

From 3514354a47d3e60c0ea2c71947cc56fc796c2567 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Mon, 3 Dec 2018 10:40:16 +0800
Subject: [PATCH 11/79] compositor: Support freezing display
Freeze display when the specified file(from env "WESTON_FREEZE_DISPLAY")
exists.
For example:
export WESTON_FREEZE_DISPLAY=/tmp/.freeze
touch $WESTON_FREEZE_DISPLAY
weston --tty=2 -Bdrm-backend.so&
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
libweston/compositor.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 9579493..f36ec9b 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -3076,6 +3076,11 @@ output_repaint_timer_handler(void *data)
void *repaint_data = NULL;
int ret = 0;
+ if (!access(getenv("WESTON_FREEZE_DISPLAY") ? : "", F_OK)) {
+ usleep(DEFAULT_REPAINT_WINDOW * 1000);
+ goto out;
+ }
+
weston_compositor_read_presentation_clock(compositor, &now);
compositor->last_repaint_start = now;
@@ -3108,6 +3113,7 @@ output_repaint_timer_handler(void *data)
wl_list_for_each(output, &compositor->output_list, link)
output->repainted = false;
+out:
output_repaint_timer_arm(compositor);
return 0;
--
2.20.1