From db5e9385d4e1492630611265afcffd9b86867489 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Sat, 23 Sep 2017 18:44:39 +1200 Subject: [PATCH] Simplify retry_pageflip --- backend/drm/drm.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 53d08291..712a06b6 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -734,25 +734,9 @@ static struct wlr_output_impl output_impl = { static int retry_pageflip(void *data) { struct wlr_drm_output *output = data; - struct wlr_drm_backend *backend = - wl_container_of(output->renderer, backend, renderer); - - struct wlr_drm_crtc *crtc = output->crtc; - struct wlr_drm_plane *plane = crtc->primary; - struct gbm_bo *bo = plane->front ? plane->front : plane->back; - - struct wlr_drm_output_mode *wlr_mode = - (struct wlr_drm_output_mode *)output->output.current_mode; - drmModeModeInfo *mode = &wlr_mode->mode; - - if (backend->iface->crtc_pageflip(backend, output, crtc, get_fb_for_bo(bo), mode)) { - output->pageflip_pending = true; - } else { - wl_event_source_timer_update(output->retry_pageflip, - output->output.current_mode->refresh); - } - - return 1; + wlr_log(L_INFO, "%s: Retrying pageflip", output->output.name); + wlr_drm_output_start_renderer(output); + return 0; } static int find_id(const void *item, const void *cmp_to) {