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: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
c8890125ad
commit
21e4944178
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user