This allows specifying a particular backend to load in a manner similar to
modules.

Signed-off-by: Lubomir Rintel <lkund...@v3.sk>
---
 man/weston.ini.man | 17 +++++++++++++++++
 src/compositor.c   | 24 +++++++++++++++---------
 2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/man/weston.ini.man b/man/weston.ini.man
index ecb7ebb..4ff313d 100644
--- a/man/weston.ini.man
+++ b/man/weston.ini.man
@@ -105,6 +105,23 @@ directory are:
 .fi
 .RE
 .TP 7
+.TP 7
+.BI "backend=" headless-backend.so
+overrides defaults backend. Available backend modules in the
+.IR "__weston_modules_dir__"
+directory are:
+.PP
+.RS 10
+.nf
+.BR drm-backend.so
+.BR fbdev-backend.so
+.BR headless-backend.so
+.BR rdp-backend.so
+.BR rpi-backend.so
+.BR wayland-backend.so
+.BR x11-backend.so
+.fi
+.RE
 .BI "gbm-format="format
 sets the GBM format used for the framebuffer for the GBM backend. Can be
 .B xrgb8888,
diff --git a/src/compositor.c b/src/compositor.c
index c6cf682..52fd67e 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3757,6 +3757,7 @@ int main(int argc, char *argv[])
                                 struct weston_config *config);
        int i;
        char *backend = NULL;
+       char *option_backend = NULL;
        char *shell = NULL;
        char *modules, *option_modules = NULL;
        char *log = NULL;
@@ -3768,7 +3769,7 @@ int main(int argc, char *argv[])
        struct weston_config_section *section;
 
        const struct weston_option core_options[] = {
-               { WESTON_OPTION_STRING, "backend", 'B', &backend },
+               { WESTON_OPTION_STRING, "backend", 'B', &option_backend },
                { WESTON_OPTION_STRING, "shell", 0, &shell },
                { WESTON_OPTION_STRING, "socket", 'S', &socket_name },
                { WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time },
@@ -3814,6 +3815,19 @@ int main(int argc, char *argv[])
        signals[3] = wl_event_loop_add_signal(loop, SIGCHLD, sigchld_handler,
                                              NULL);
 
+       config = weston_config_parse("weston.ini");
+       if (config != NULL) {
+               weston_log("Using config file '%s'\n",
+                          weston_config_get_full_path(config));
+       } else {
+               weston_log("Starting with no config file.\n");
+       }
+       section = weston_config_get_section(config, "core", NULL, NULL);
+
+       weston_config_section_get_string(section, "backend", &backend, NULL);
+       if (option_backend) {
+               backend = option_backend;
+       }
        if (!backend) {
                if (getenv("WAYLAND_DISPLAY"))
                        backend = "wayland-backend.so";
@@ -3823,14 +3837,6 @@ int main(int argc, char *argv[])
                        backend = WESTON_NATIVE_BACKEND;
        }
 
-       config = weston_config_parse("weston.ini");
-       if (config != NULL) {
-               weston_log("Using config file '%s'\n",
-                          weston_config_get_full_path(config));
-       } else {
-               weston_log("Starting with no config file.\n");
-       }
-       section = weston_config_get_section(config, "core", NULL, NULL);
        weston_config_section_get_string(section, "modules", &modules, "");
 
        backend_init = weston_load_module(backend, "backend_init");
-- 
1.8.4.2

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to