compositor: finish frame if redraw fails
If we are about to finish a frame, but a redraw is pending and we let the
compositor redraw, we need to check for errors. If the redraw fails and
the backend cannot schedule a page-flip, we need to finish the frame,
anyway.
All backends except DRM use a timer to schedule frames. Hence, they cannot
fail. But for DRM, we need to be able to handle drmModePageFlip() failures
in case access got revoked.
This fixes a bug where logind+drm caused keyboard input to be missed as we
didn't reenable it after a failed page-flip during deactivation.
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 44e92ba..65490db 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -326,7 +326,7 @@
weston_output_finish_frame(output, msec);
}
-static void
+static int
x11_output_repaint_gl(struct weston_output *output_base,
pixman_region32_t *damage)
{
@@ -339,6 +339,7 @@
&ec->primary_plane.damage, damage);
wl_event_source_timer_update(output->finish_frame_timer, 10);
+ return 0;
}
static void
@@ -446,7 +447,7 @@
}
-static void
+static int
x11_output_repaint_shm(struct weston_output *output_base,
pixman_region32_t *damage)
{
@@ -477,6 +478,7 @@
}
wl_event_source_timer_update(output->finish_frame_timer, 10);
+ return 0;
}
static int