hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From c563d79efaf3e6645add6617b0944c41b9775161 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/74] 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