From 2c91c7025079ba5384eb37bc0b35863afcfeda8b Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 2 Mar 2022 10:51:15 -0600 Subject: [PATCH] launchers: Remove --tty option This doesn't work with any of the launchers we've kept. Remove the option and all the bits that handle it. Signed-off-by: Derek Foreman --- compositor/main.c | 4 ---- include/libweston/backend-drm.h | 5 +---- include/libweston/backend-fbdev.h | 3 +-- libweston/backend-drm/drm.c | 3 +-- libweston/backend-fbdev/fbdev.c | 3 +-- libweston/launcher-impl.h | 2 +- libweston/launcher-libseat.c | 2 +- libweston/launcher-logind.c | 7 +------ libweston/launcher-util.c | 4 ++-- libweston/launcher-util.h | 2 +- man/weston-drm.man | 5 ----- 11 files changed, 10 insertions(+), 30 deletions(-) diff --git a/compositor/main.c b/compositor/main.c index 87523517..6fda035a 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -689,7 +689,6 @@ usage(int error_code) fprintf(out, "Options for drm-backend.so:\n\n" " --seat=SEAT\t\tThe seat that weston should run on, instead of the seat defined in XDG_SEAT\n" - " --tty=TTY\t\tThe tty to use\n" " --drm-device=CARD\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" @@ -699,7 +698,6 @@ usage(int error_code) #if defined(BUILD_FBDEV_COMPOSITOR) fprintf(out, "Options for fbdev-backend.so:\n\n" - " --tty=TTY\t\tThe tty to use\n" " --device=DEVICE\tThe framebuffer device to use\n" " --seat=SEAT\t\tThe seat that weston should run on, instead of the seat defined in XDG_SEAT\n" "\n"); @@ -2639,7 +2637,6 @@ load_drm_backend(struct weston_compositor *c, const struct weston_option options[] = { { WESTON_OPTION_STRING, "seat", 0, &config.seat_id }, - { WESTON_OPTION_INTEGER, "tty", 0, &config.tty }, { WESTON_OPTION_STRING, "drm-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 }, @@ -2882,7 +2879,6 @@ load_fbdev_backend(struct weston_compositor *c, int ret = 0; const struct weston_option fbdev_options[] = { - { WESTON_OPTION_INTEGER, "tty", 0, &config.tty }, { WESTON_OPTION_STRING, "device", 0, &config.device }, { WESTON_OPTION_STRING, "seat", 0, &config.seat_id }, }; diff --git a/include/libweston/backend-drm.h b/include/libweston/backend-drm.h index af2da4aa..f85aabdb 100644 --- a/include/libweston/backend-drm.h +++ b/include/libweston/backend-drm.h @@ -35,7 +35,7 @@ extern "C" { #endif -#define WESTON_DRM_BACKEND_CONFIG_VERSION 4 +#define WESTON_DRM_BACKEND_CONFIG_VERSION 5 struct libinput_device; @@ -171,9 +171,6 @@ weston_drm_virtual_output_get_api(struct weston_compositor *compositor) struct weston_drm_backend_config { struct weston_backend_config base; - /** The tty to be used. Set to 0 to use the current tty. */ - int tty; - /** Whether to use the pixman renderer instead of the OpenGL ES renderer. */ bool use_pixman; diff --git a/include/libweston/backend-fbdev.h b/include/libweston/backend-fbdev.h index 4dbdce72..3ed6b0a0 100644 --- a/include/libweston/backend-fbdev.h +++ b/include/libweston/backend-fbdev.h @@ -34,14 +34,13 @@ extern "C" { #include -#define WESTON_FBDEV_BACKEND_CONFIG_VERSION 2 +#define WESTON_FBDEV_BACKEND_CONFIG_VERSION 3 struct libinput_device; struct weston_fbdev_backend_config { struct weston_backend_config base; - int tty; char *device; /** Callback used to configure input devices. diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 387184ef..83297cd5 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -3018,8 +3018,7 @@ drm_backend_create(struct weston_compositor *compositor, goto err_compositor; /* Check if we run drm-backend using a compatible launcher */ - compositor->launcher = weston_launcher_connect(compositor, config->tty, - seat_id, true); + compositor->launcher = weston_launcher_connect(compositor, seat_id, true); if (compositor->launcher == NULL) { weston_log("fatal: your system should either provide the " "logind D-Bus API, or use seatd.\n"); diff --git a/libweston/backend-fbdev/fbdev.c b/libweston/backend-fbdev/fbdev.c index 38a9b4c3..0ec5af0c 100644 --- a/libweston/backend-fbdev/fbdev.c +++ b/libweston/backend-fbdev/fbdev.c @@ -924,7 +924,7 @@ fbdev_backend_create(struct weston_compositor *compositor, wl_signal_add(&compositor->session_signal, &backend->session_listener); compositor->launcher = - weston_launcher_connect(compositor, param->tty, seat_id, false); + weston_launcher_connect(compositor, seat_id, false); if (!compositor->launcher) { weston_log("fatal: your system should either provide the " "logind D-Bus API, or use seatd.\n"); @@ -968,7 +968,6 @@ out_compositor: static void config_init_to_defaults(struct weston_fbdev_backend_config *config) { - config->tty = 0; /* default to current tty */ config->device = NULL; config->seat_id = NULL; } diff --git a/libweston/launcher-impl.h b/libweston/launcher-impl.h index 26038998..954dc6de 100644 --- a/libweston/launcher-impl.h +++ b/libweston/launcher-impl.h @@ -32,7 +32,7 @@ struct weston_launcher; struct launcher_interface { char *name; int (* connect) (struct weston_launcher **launcher_out, struct weston_compositor *compositor, - int tty, const char *seat_id, bool sync_drm); + const char *seat_id, bool sync_drm); void (* destroy) (struct weston_launcher *launcher); int (* open) (struct weston_launcher *launcher, const char *path, int flags); void (* close) (struct weston_launcher *launcher, int fd); diff --git a/libweston/launcher-libseat.c b/libweston/launcher-libseat.c index 6aa8ad0f..58e22d39 100644 --- a/libweston/launcher-libseat.c +++ b/libweston/launcher-libseat.c @@ -181,7 +181,7 @@ libseat_event(int fd, uint32_t mask, void *data) static int seat_open(struct weston_launcher **out, struct weston_compositor *compositor, - int tty, const char *seat_id, bool sync_drm) + const char *seat_id, bool sync_drm) { struct launcher_libseat *wl; struct wl_event_loop *event_loop; diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c index 77f43815..7ebf906b 100644 --- a/libweston/launcher-logind.c +++ b/libweston/launcher-logind.c @@ -736,7 +736,7 @@ launcher_logind_get_session(char **session) static int launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *compositor, - int tty, const char *seat_id, bool sync_drm) + const char *seat_id, bool sync_drm) { struct launcher_logind *wl; struct wl_event_loop *loop; @@ -784,11 +784,6 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor * if (r < 0) { weston_log("logind: session not running on a VT\n"); goto err_session; - } else if (tty > 0 && wl->vtnr != (unsigned int )tty) { - weston_log("logind: requested VT --tty=%d differs from real session VT %u\n", - tty, wl->vtnr); - r = -EINVAL; - goto err_session; } } else if (r < 0) { weston_log("logind: could not determine if seat %s has ttys or not", t); diff --git a/libweston/launcher-util.c b/libweston/launcher-util.c index 9f5ce243..b277606d 100644 --- a/libweston/launcher-util.c +++ b/libweston/launcher-util.c @@ -47,7 +47,7 @@ static const struct launcher_interface *ifaces[] = { }; WL_EXPORT struct weston_launcher * -weston_launcher_connect(struct weston_compositor *compositor, int tty, +weston_launcher_connect(struct weston_compositor *compositor, const char *seat_id, bool sync_drm) { const struct launcher_interface **it; @@ -57,7 +57,7 @@ weston_launcher_connect(struct weston_compositor *compositor, int tty, struct weston_launcher *launcher; weston_log("Trying %s launcher...\n", iface->name); - if (iface->connect(&launcher, compositor, tty, seat_id, sync_drm) == 0) + if (iface->connect(&launcher, compositor, seat_id, sync_drm) == 0) return launcher; } diff --git a/libweston/launcher-util.h b/libweston/launcher-util.h index dd7b7702..2ee7ceb5 100644 --- a/libweston/launcher-util.h +++ b/libweston/launcher-util.h @@ -33,7 +33,7 @@ struct weston_launcher; struct weston_launcher * -weston_launcher_connect(struct weston_compositor *compositor, int tty, +weston_launcher_connect(struct weston_compositor *compositor, const char *seat_id, bool sync_drm); void diff --git a/man/weston-drm.man b/man/weston-drm.man index ced4f106..d01860cf 100644 --- a/man/weston-drm.man +++ b/man/weston-drm.man @@ -186,11 +186,6 @@ Use graphics and input devices designated for seat instead of the seat defined in the environment variable .BR XDG_SEAT ". If neither is specified, seat0 will be assumed." .TP -\fB\-\-tty\fR=\fIx\fR -Launch Weston on tty -.I x -instead of using the current tty. -.TP .B \-\-continue\-without\-input Allow Weston to start without input devices. Used for testing purposes. .