From ee43ef3c9d783c832a9b93fbcb9c1fb8c092f196 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 2 Nov 2020 12:11:51 +0100 Subject: backend/drm: fix "a page-flip is already pending" errors on modeset When performing a modeset, the DRM backend will request a page-flip event. However frame_pending wasn't set to true, so any subsequent wlr_output_schedule_frame calls would imemdiately trigger a synthetic frame event, asking the compositor to submit a new frame. Committing the new frame fails with "a page-flip is already pending" error in the DRM backend. --- backend/drm/drm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 03cd9318..2644014c 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -373,6 +373,12 @@ static bool drm_crtc_page_flip(struct wlr_drm_connector *conn) { } conn->pageflip_pending = true; + + // wlr_output's API guarantees that submitting a buffer will schedule a + // frame event. However the DRM backend will also schedule a frame event + // when performing a modeset. Set frame_pending to true so that + // wlr_output_schedule_frame doesn't trigger a synthetic frame event. + conn->output.frame_pending = true; return true; } -- cgit v1.2.3