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>
dev
Lubomir Rintel 11 years ago committed by Kristian Høgsberg
parent cdb4d29096
commit ba44c6bf2e
  1. 17
      man/weston.ini.man
  2. 24
      src/compositor.c

@ -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,

@ -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");

Loading…
Cancel
Save