drm-backend: add --continue-without-input command line option to DRM-backend
authorLeandro Ribeiro <leandro.ribeiro@collabora.com>
Wed, 6 May 2020 21:10:19 +0000 (18:10 -0300)
committerPekka Paalanen <pq@iki.fi>
Tue, 2 Jun 2020 13:47:15 +0000 (13:47 +0000)
In the test suite we may want to run a DRM-backend test on a
non-default seat, which may not have a input device associated.
Weston's default behavior is to not open if input devices are
not found, as it may cause troubles. For instance, Weston can
open but if no input device is set than the user can not
interact or leave it.

Add flag --continue-without-input to DRM-backend so we can run
these types of tests with no input. Notice that this won't force
the compositor to skip opening a input device if it finds it on
the non-default seat.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
compositor/main.c
include/libweston/backend-drm.h
libweston/backend-drm/drm.c
man/weston-drm.man

index 1a8bf11551d8ed2a59a3427a5e73415bdfa43d83..65da9dbc439c591ec9379a7721dbb4b2f5b3dee9 100644 (file)
@@ -676,7 +676,8 @@ usage(int error_code)
                "  --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\n");
+               "  --current-mode\tPrefer current KMS mode over EDID preferred mode\n"
+               "  --continue-without-input\tAllow the compositor to start without input devices\n\n");
 #endif
 
 #if defined(BUILD_FBDEV_COMPOSITOR)
@@ -2523,6 +2524,7 @@ load_drm_backend(struct weston_compositor *c,
                { 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 },
+               { WESTON_OPTION_BOOLEAN, "continue-without-input", 0, &config.continue_without_input },
        };
 
        parse_options(options, ARRAY_LENGTH(options), argc, argv);
index f6647e2864e3b1cda46412f9e866e0e3ccf97f32..350eeb0deb5f36590792ddcee9982c24eaef6349 100644 (file)
@@ -223,6 +223,9 @@ struct weston_drm_backend_config {
 
        /** Use shadow buffer if using Pixman-renderer. */
        bool use_pixman_shadow;
+
+       /** Allow compositor to start without input devices. */
+       bool continue_without_input;
 };
 
 #ifdef  __cplusplus
index 2aea82f55444e05e3e97c986bd250ea3f92c2d83..ca0f3a866643e07c477b08bb6be3efdde0a69c51 100644 (file)
@@ -2831,6 +2831,7 @@ drm_backend_create(struct weston_compositor *compositor,
                                                   NULL, NULL, NULL);
 
        compositor->backend = &b->base;
+       compositor->require_input = !config->continue_without_input;
 
        if (parse_gbm_format(config->gbm_format, DRM_FORMAT_XRGB8888, &b->gbm_format) < 0)
                goto err_compositor;
index 28cdf3d1c3c3d5549628aef013b1357a26338e0c..01a336e1d7dde09c3677fcd2a1e28f70653fc3b1 100644 (file)
@@ -205,6 +205,9 @@ instead of the seat defined in the environment variable
 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.
 .
 .\" ***************************************************************
 .SH ENVIRONMENT