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?
master
Simon Ser 5 years ago committed by Drew DeVault
parent 61095f4a12
commit d6cc718472

@ -671,26 +671,6 @@ static bool drm_connector_pageflip_renderer(struct wlr_drm_connector *conn) {
return drm_crtc_page_flip(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, static bool drm_connector_init_renderer(struct wlr_drm_connector *conn,
struct wlr_drm_mode *mode) { struct wlr_drm_mode *mode) {
struct wlr_drm_backend *drm = 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); struct wlr_drm_connector *conn = get_drm_connector_from_output(output);
drm_connector_cleanup(conn); drm_connector_cleanup(conn);
drmModeFreeCrtc(conn->old_crtc); drmModeFreeCrtc(conn->old_crtc);
wl_event_source_remove(conn->retry_pageflip);
wl_list_remove(&conn->link); wl_list_remove(&conn->link);
free(conn); free(conn);
} }
@ -1035,13 +1014,6 @@ bool wlr_output_is_drm(struct wlr_output *output) {
return output->impl == &output_impl; 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[] = { static const int32_t subpixel_map[] = {
[DRM_MODE_SUBPIXEL_UNKNOWN] = WL_OUTPUT_SUBPIXEL_UNKNOWN, [DRM_MODE_SUBPIXEL_UNKNOWN] = WL_OUTPUT_SUBPIXEL_UNKNOWN,
[DRM_MODE_SUBPIXEL_HORIZONTAL_RGB] = WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB, [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, wlr_output_init(&wlr_conn->output, &drm->backend, &output_impl,
drm->display); 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->state = WLR_DRM_CONN_DISCONNECTED;
wlr_conn->id = drm_conn->connector_id; wlr_conn->id = drm_conn->connector_id;

@ -131,7 +131,6 @@ struct wlr_drm_connector {
drmModeCrtc *old_crtc; drmModeCrtc *old_crtc;
struct wl_event_source *retry_pageflip;
struct wl_list link; struct wl_list link;
/* /*

Loading…
Cancel
Save