drm: always check the repaint_status in update_complete
authorMichael Olbrich <m.olbrich@pengutronix.de>
Thu, 6 Aug 2020 07:57:54 +0000 (09:57 +0200)
committerMichael Olbrich <m.olbrich@pengutronix.de>
Wed, 19 Aug 2020 05:35:14 +0000 (07:35 +0200)
Initially finish_frame() was never called in drm_output_update_complete() for
'dpms_off_pending = true'. This is wrong for repaint_status ==
REPAINT_AWAITING_COMPLETION and that was fixed in
68d49d772cfba6c53033cb009b0f490fd38f24ad ("compositor-drm: run finish_frame when
dpms is turned off in update_complete").
However finish_frame() may now be called for repaint_status !=
REPAINT_AWAITING_COMPLETION, which is not allowed and results in a failed
assertion.

Fix this by checking dpms and repaint_status unconditionally.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
libweston/backend-drm/drm.c

index 1cf61a33c6236e7ca9590aa886c48d7d684b95a2..2780f3bd797f71f71e5d8c75fac2d93fb5dcc8f7 100644 (file)
@@ -306,8 +306,9 @@ drm_output_update_complete(struct drm_output *output, uint32_t flags,
                output->dpms_off_pending = false;
                drm_output_get_disable_state(pending, output);
                drm_pending_state_apply_sync(pending);
-       } else if (output->state_cur->dpms == WESTON_DPMS_OFF &&
-                  output->base.repaint_status != REPAINT_AWAITING_COMPLETION) {
+       }
+       if (output->state_cur->dpms == WESTON_DPMS_OFF &&
+           output->base.repaint_status != REPAINT_AWAITING_COMPLETION) {
                /* DPMS can happen to us either in the middle of a repaint
                 * cycle (when we have painted fresh content, only to throw it
                 * away for DPMS off), or at any other random point. If the