Commit 21e49441 authored by eucan's avatar eucan Committed by Pekka Paalanen

compositor-drm: update connectors with connector config

weston can be started with --connector option to be initialized
with a particular output. But in the update_outputs this option
is not considered and output is created for all the available
connectors. This patch fixes this issue by considering
the option for connectors in the update_outputs.
Signed-off-by: eucan's avatarEmre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
parent c8890125
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment