From d6cc7184729029a4d8e9dc5e306a17fe9bb7e342 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 18 May 2020 12:25:55 +0200 Subject: [PATCH] backend/drm: nuke retry_pageflip retry_pageflip is now dead code, since drm_connector_start_renderer isn't called anymore. It was previously called when enabling an output. The name "retry_pageflip" was a little confusing because the function retried a modeset and the timer wasn't set up while performing a simple page-flip. Let's just remove this altogether for now. We can discuss whether it's worth it to bring it back. Should we only do it on failed page-flips? Should we only do it on EBUSY? --- backend/drm/drm.c | 32 -------------------------------- include/backend/drm/drm.h | 1 - 2 files changed, 33 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 630a7532..62a94ae0 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -671,26 +671,6 @@ static bool drm_connector_pageflip_renderer(struct wlr_drm_connector *conn) { return drm_crtc_page_flip(conn); } -static void drm_connector_start_renderer(struct wlr_drm_connector *conn) { - struct wlr_drm_crtc *crtc = conn->crtc; - - if (conn->state != WLR_DRM_CONN_CONNECTED) { - return; - } - - wlr_log(WLR_DEBUG, "Starting renderer on output '%s'", conn->output.name); - - struct wlr_drm_mode *mode = (struct wlr_drm_mode *)conn->output.current_mode; - memcpy(&crtc->mode, &mode->drm_mode, sizeof(drmModeModeInfo)); - crtc->active = true; - crtc->pending |= WLR_DRM_CRTC_MODE; - - if (!drm_connector_pageflip_renderer(conn)) { - wl_event_source_timer_update(conn->retry_pageflip, - 1000000.0f / conn->output.current_mode->refresh); - } -} - static bool drm_connector_init_renderer(struct wlr_drm_connector *conn, struct wlr_drm_mode *mode) { struct wlr_drm_backend *drm = @@ -1014,7 +994,6 @@ static void drm_connector_destroy(struct wlr_output *output) { struct wlr_drm_connector *conn = get_drm_connector_from_output(output); drm_connector_cleanup(conn); drmModeFreeCrtc(conn->old_crtc); - wl_event_source_remove(conn->retry_pageflip); wl_list_remove(&conn->link); free(conn); } @@ -1035,13 +1014,6 @@ bool wlr_output_is_drm(struct wlr_output *output) { return output->impl == &output_impl; } -static int retry_pageflip(void *data) { - struct wlr_drm_connector *conn = data; - wlr_log(WLR_INFO, "%s: Retrying pageflip", conn->output.name); - drm_connector_start_renderer(conn); - return 0; -} - static const int32_t subpixel_map[] = { [DRM_MODE_SUBPIXEL_UNKNOWN] = WL_OUTPUT_SUBPIXEL_UNKNOWN, [DRM_MODE_SUBPIXEL_HORIZONTAL_RGB] = WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB, @@ -1294,10 +1266,6 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) { wlr_output_init(&wlr_conn->output, &drm->backend, &output_impl, drm->display); - struct wl_event_loop *ev = wl_display_get_event_loop(drm->display); - wlr_conn->retry_pageflip = wl_event_loop_add_timer(ev, retry_pageflip, - wlr_conn); - wlr_conn->state = WLR_DRM_CONN_DISCONNECTED; wlr_conn->id = drm_conn->connector_id; diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 30bf41a6..dc34c681 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -131,7 +131,6 @@ struct wlr_drm_connector { drmModeCrtc *old_crtc; - struct wl_event_source *retry_pageflip; struct wl_list link; /*