1From 3514354a47d3e60c0ea2c71947cc56fc796c2567 Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Mon, 3 Dec 2018 10:40:16 +0800 4Subject: [PATCH 11/79] compositor: Support freezing display 5 6Freeze display when the specified file(from env "WESTON_FREEZE_DISPLAY") 7exists. 8 9For example: 10export WESTON_FREEZE_DISPLAY=/tmp/.freeze 11touch $WESTON_FREEZE_DISPLAY 12weston --tty=2 -Bdrm-backend.so& 13 14Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 15--- 16 libweston/compositor.c | 6 ++++++ 17 1 file changed, 6 insertions(+) 18 19diff --git a/libweston/compositor.c b/libweston/compositor.c 20index 9579493..f36ec9b 100644 21--- a/libweston/compositor.c 22+++ b/libweston/compositor.c 23@@ -3076,6 +3076,11 @@ output_repaint_timer_handler(void *data) 24 void *repaint_data = NULL; 25 int ret = 0; 26 27+ if (!access(getenv("WESTON_FREEZE_DISPLAY") ? : "", F_OK)) { 28+ usleep(DEFAULT_REPAINT_WINDOW * 1000); 29+ goto out; 30+ } 31+ 32 weston_compositor_read_presentation_clock(compositor, &now); 33 compositor->last_repaint_start = now; 34 35@@ -3108,6 +3113,7 @@ output_repaint_timer_handler(void *data) 36 wl_list_for_each(output, &compositor->output_list, link) 37 output->repainted = false; 38 39+out: 40 output_repaint_timer_arm(compositor); 41 42 return 0; 43-- 442.20.1 45 46