[PATCH weston 1/2] compositor-drm: update connectors with connector config

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Thu Feb 2 14:06:55 UTC 2017


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 at de.adit-jv.com>
---
 libweston/compositor-drm.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 564e324..6d97b49 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -118,6 +118,8 @@ struct drm_backend {
 
 	int32_t cursor_width;
 	int32_t cursor_height;
+
+	uint32_t connector;
 };
 
 struct drm_mode {
@@ -2713,7 +2715,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)
@@ -2724,6 +2726,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))) {
@@ -3207,6 +3214,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;
-- 
1.7.9.5



More information about the wayland-devel mailing list