diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-10-22 16:43:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-22 16:43:51 -0400 |
commit | 86be449a3f04f24a1d0ff3b7b22b12be4a2d3c2c (patch) | |
tree | 85a056f626277e0e00cd5cbb0b99f8cb531934e8 /backend | |
parent | c5fff08f8a63b37ceb42e15641a14384efd163d2 (diff) | |
parent | e1d213fccdae068ecc0f11f4321dfd6528163253 (diff) |
Merge pull request #318 from emersion/drm-null-outputs
Create globals only for enabled outputs in DRM backend
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/drm.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 51a5f636..8f80e65c 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -748,7 +748,6 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) { free(edid); wl_list_insert(&drm->outputs, &wlr_conn->link); - wlr_output_create_global(&wlr_conn->output, drm->display); wlr_log(L_INFO, "Found display '%s'", wlr_conn->output.name); } else { seen[index] = true; @@ -756,7 +755,6 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) { if (wlr_conn->state == WLR_DRM_CONN_DISCONNECTED && drm_conn->connection == DRM_MODE_CONNECTED) { - wlr_log(L_INFO, "'%s' connected", wlr_conn->output.name); wlr_log(L_INFO, "Detected modes:"); @@ -778,14 +776,17 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) { wl_list_insert(&wlr_conn->output.modes, &mode->wlr_mode.link); } + wlr_output_create_global(&wlr_conn->output, drm->display); + wlr_conn->state = WLR_DRM_CONN_NEEDS_MODESET; wlr_log(L_INFO, "Sending modesetting signal for '%s'", wlr_conn->output.name); wl_signal_emit(&drm->backend.events.output_add, &wlr_conn->output); } else if (wlr_conn->state == WLR_DRM_CONN_CONNECTED && drm_conn->connection != DRM_MODE_CONNECTED) { - wlr_log(L_INFO, "'%s' disconnected", wlr_conn->output.name); + + wlr_output_destroy_global(&wlr_conn->output); wlr_drm_connector_cleanup(wlr_conn); } |