diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2013-11-15 14:18:15 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-11-15 16:17:51 -0800 |
commit | ba44c6bf2e266e197818f3dbeabde0e6bc11fd81 (patch) | |
tree | d66ec4a2b6fb459c9c6d8251e833c7e9f2ec161a | |
parent | cdb4d290969937d57826a6c14eda1a01978cb805 (diff) |
Add [core] backend option
This allows specifying a particular backend to load in a manner similar to
modules.
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
-rw-r--r-- | man/weston.ini.man | 17 | ||||
-rw-r--r-- | src/compositor.c | 24 |
2 files changed, 32 insertions, 9 deletions
diff --git a/man/weston.ini.man b/man/weston.ini.man index ecb7ebb2..4ff313d2 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 4c37eb6b..af471caf 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -3772,6 +3772,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; @@ -3783,7 +3784,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 }, @@ -3829,6 +3830,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"; @@ -3838,14 +3852,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"); |