From fc3d8b228b435ff18a3fe82b126d334395495b5a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 18 Oct 2022 17:24:10 +0200 Subject: backend/drm: get possible CRTCs in create_drm_connector() This stuff is immutable for a given connector. --- backend/drm/drm.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'backend/drm') diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 1dac352a..a85373ad 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -844,7 +844,6 @@ static void drm_connector_destroy_output(struct wlr_output *output) { dealloc_crtc(conn); conn->status = DRM_MODE_DISCONNECTED; - conn->possible_crtcs = 0; conn->pending_page_flip_crtc = 0; struct wlr_drm_mode *mode, *mode_tmp; @@ -1160,6 +1159,12 @@ static struct wlr_drm_connector *create_drm_connector(struct wlr_drm_backend *dr snprintf(wlr_conn->name, sizeof(wlr_conn->name), "%s-%"PRIu32, conn_name, drm_conn->connector_type_id); + wlr_conn->possible_crtcs = + drmModeConnectorGetPossibleCrtcs(drm->fd, drm_conn); + if (wlr_conn->possible_crtcs == 0) { + wlr_drm_conn_log(wlr_conn, WLR_ERROR, "No CRTC possible"); + } + wlr_conn->crtc = connector_get_current_crtc(wlr_conn, drm_conn); wl_list_insert(drm->outputs.prev, &wlr_conn->link); @@ -1304,12 +1309,6 @@ static void connect_drm_connector(struct wlr_drm_connector *wlr_conn, free(current_modeinfo); - wlr_conn->possible_crtcs = - drmModeConnectorGetPossibleCrtcs(drm->fd, drm_conn); - if (wlr_conn->possible_crtcs == 0) { - wlr_drm_conn_log(wlr_conn, WLR_ERROR, "No CRTC possible"); - } - wlr_output_update_enabled(&wlr_conn->output, wlr_conn->crtc != NULL); wlr_conn->status = DRM_MODE_CONNECTED; -- cgit v1.2.3