hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
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
45
46
From 00937b65d6a358eb3739206e024daf081e5c87ef Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Thu, 2 Jul 2020 14:58:49 +0800
Subject: [PATCH 06/74] HACK: backend-drm: Avoid random crash when suspending
 
Skip the repaint_status check since the weston_output_finish_frame()
could also be called when turning off dpms.
 
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
 libweston/backend-drm/drm.c | 6 ++++--
 libweston/compositor.c      | 2 --
 2 files changed, 4 insertions(+), 4 deletions(-)
 
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
index e557d41..d6a8588 100644
--- a/libweston/backend-drm/drm.c
+++ b/libweston/backend-drm/drm.c
@@ -280,8 +280,10 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
     wl_list_for_each(ps, &output->state_cur->plane_list, link)
         ps->complete = true;
 
-    drm_output_state_free(output->state_last);
-    output->state_last = NULL;
+    if (output->state_last) {
+        drm_output_state_free(output->state_last);
+        output->state_last = NULL;
+    }
 
     if (output->destroy_pending) {
         output->destroy_pending = false;
diff --git a/libweston/compositor.c b/libweston/compositor.c
index f87eb37..bfb4c0f 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -3156,8 +3156,6 @@ weston_output_finish_frame(struct weston_output *output,
     struct timespec vblank_monotonic;
     int64_t msec_rel;
 
-    assert(output->repaint_status == REPAINT_AWAITING_COMPLETION);
-
     /*
      * If timestamp of latest vblank is given, it must always go forwards.
      * If not given, INVALID flag must be set.
-- 
2.20.1