diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c index 2a6b0d12..780d0070 100644 --- a/libweston/backend-drm/kms.c +++ b/libweston/backend-drm/kms.c @@ -1271,6 +1271,14 @@ drm_pending_state_apply(struct drm_pending_state *pending_state) if (ret != 0) { weston_log("Couldn't apply state for output %s\n", output->base.name); + weston_output_repaint_failed(&output->base); + drm_output_state_free(output->state_cur); + output->state_cur = drm_output_state_alloc(output, NULL); + b->state_invalid = true; + if (!b->use_pixman) { + drm_output_fini_egl(output); + drm_output_init_egl(output, b); + } } } diff --git a/libweston/backend.h b/libweston/backend.h index b9afb2c0..3ae59a6c 100644 --- a/libweston/backend.h +++ b/libweston/backend.h @@ -161,6 +161,10 @@ void weston_output_finish_frame(struct weston_output *output, const struct timespec *stamp, uint32_t presented_flags); + +void +weston_output_repaint_failed(struct weston_output *output); + int weston_output_mode_set_native(struct weston_output *output, struct weston_mode *mode, diff --git a/libweston/compositor.c b/libweston/compositor.c index 3fa1b8d0..26ef54bd 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -3215,6 +3215,15 @@ out: output_repaint_timer_arm(compositor); } + +WL_EXPORT void +weston_output_repaint_failed(struct weston_output *output) +{ + weston_log("Clearing repaint status.\n"); + assert(output->repaint_status == REPAINT_AWAITING_COMPLETION); + output->repaint_status = REPAINT_NOT_SCHEDULED; +} + static void idle_repaint(void *data) {