diff options
author | Simon Ser <contact@emersion.fr> | 2022-10-18 17:24:10 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-11-02 14:48:30 +0000 |
commit | fc3d8b228b435ff18a3fe82b126d334395495b5a (patch) | |
tree | 18eca0fa149c0ea099c2258148efa86d8c1d4b1e /backend/drm | |
parent | 92580a2f6727aef9b8a79dbb78e7a0e9abf86394 (diff) |
backend/drm: get possible CRTCs in create_drm_connector()
This stuff is immutable for a given connector.
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 13 |
1 files changed, 6 insertions, 7 deletions
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; |