[PATCH weston 2/2] weston: add --device option for DRM-backend

Pekka Paalanen ppaalanen at gmail.com
Tue Mar 28 15:26:16 UTC 2017


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Developers with testing rigs having multiple graphics cards plugged in
often want to test things on a specific card. We have ways to choose a
card through seat assignments, but configuring that run by run is
awkward.

Add a command line option for opening a specific DRM device.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 compositor/main.c  | 2 ++
 man/weston-drm.man | 7 +++++++
 2 files changed, 9 insertions(+)

diff --git a/compositor/main.c b/compositor/main.c
index f8a60e9..fd40737 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -565,6 +565,7 @@ usage(int error_code)
 		"  --connector=ID\tBring up only this connector\n"
 		"  --seat=SEAT\t\tThe seat that weston should run on\n"
 		"  --tty=TTY\t\tThe tty to use\n"
+		"  --device=CARD\t\tThe DRM device to use, e.g. \"card0\".\n"
 		"  --use-pixman\t\tUse the pixman (CPU) renderer\n"
 		"  --current-mode\tPrefer current KMS mode over EDID preferred mode\n\n");
 #endif
@@ -1225,6 +1226,7 @@ load_drm_backend(struct weston_compositor *c,
 		{ WESTON_OPTION_INTEGER, "connector", 0, &config.connector },
 		{ WESTON_OPTION_STRING, "seat", 0, &config.seat_id },
 		{ WESTON_OPTION_INTEGER, "tty", 0, &config.tty },
+		{ WESTON_OPTION_STRING, "device", 0, &config.specific_device },
 		{ WESTON_OPTION_BOOLEAN, "current-mode", 0, &wet->drm_use_current_mode },
 		{ WESTON_OPTION_BOOLEAN, "use-pixman", 0, &config.use_pixman },
 	};
diff --git a/man/weston-drm.man b/man/weston-drm.man
index 35d62ae..9bc792b 100644
--- a/man/weston-drm.man
+++ b/man/weston-drm.man
@@ -96,6 +96,13 @@ as the only initial output.
 By default, use the current video mode of all outputs, instead of
 switching to the monitor preferred mode.
 .TP
+\fB\-\-device\fR=\fIcardN\fR
+Use the DRM device
+.I cardN
+instead of the default heuristics based on seat assignments and boot VGA
+status. For example, use
+.BR card0 .
+.TP
 \fB\-\-seat\fR=\fIseatid\fR
 Use graphics and input devices designated for seat
 .I seatid
-- 
2.10.2



More information about the wayland-devel mailing list