aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-22 22:21:23 +0200
committeremersion <contact@emersion.fr>2017-10-22 22:21:23 +0200
commite1d213fccdae068ecc0f11f4321dfd6528163253 (patch)
tree85a056f626277e0e00cd5cbb0b99f8cb531934e8 /backend
parentc5fff08f8a63b37ceb42e15641a14384efd163d2 (diff)
Create globals only for enabled outputs in DRM backend
Diffstat (limited to 'backend')
-rw-r--r--backend/drm/drm.c7
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);
}