From: Michael Olbrich Date: Thu, 6 Aug 2020 07:57:54 +0000 (+0200) Subject: drm: always check the repaint_status in update_complete X-Git-Tag: upstream/9.0.0~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d70e712c2f63c5af7483ea5053e57bfa83d7d7e7;p=platform%2Fupstream%2Fweston.git drm: always check the repaint_status in update_complete 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 --- diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 1cf61a33..2780f3bd 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -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