diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index a16136d3..073dc194 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -119,6 +119,8 @@ struct drm_backend { int32_t cursor_width; int32_t cursor_height; + + uint32_t connector; }; struct drm_mode { @@ -2725,7 +2727,7 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) /* collect new connects */ for (i = 0; i < resources->count_connectors; i++) { - int connector_id = resources->connectors[i]; + uint32_t connector_id = resources->connectors[i]; connector = drmModeGetConnector(b->drm.fd, connector_id); if (connector == NULL) @@ -2736,6 +2738,11 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) continue; } + if (b->connector && (b->connector != connector_id)) { + drmModeFreeConnector(connector); + continue; + } + connected |= (1 << connector_id); if (!(b->connector_allocator & (1 << connector_id))) { @@ -3219,6 +3226,8 @@ drm_backend_create(struct weston_compositor *compositor, goto err_sprite; } + b->connector = config->connector; + if (create_outputs(b, config->connector, drm_device) < 0) { weston_log("failed to create output for %s\n", path); goto err_udev_input;