summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Config.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/common/xf86Config.c')
-rw-r--r--hw/xfree86/common/xf86Config.c44
1 files changed, 37 insertions, 7 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 542d5abf6..7eb8b1b37 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -118,7 +118,8 @@ static ModuleDefault ModuleDefaults[] = {
{.name = "fb",.toLoad = TRUE,.load_opt = NULL},
{.name = "shadow",.toLoad = TRUE,.load_opt = NULL},
#endif
- {.name = NULL,.toLoad = FALSE,.load_opt = NULL}
+ {.name = "xwayland",.toLoad = FALSE,.load_opt=NULL},
+ {.name = NULL,.toLoad = FALSE,.load_opt=NULL}
};
/* Forward declarations */
@@ -260,6 +261,17 @@ xf86ModulelistFromConfig(void ***optlist)
return NULL;
}
+ /*
+ * Set the xwayland module to autoload if requested.
+ */
+ if (xorgWayland) {
+ for (i=0 ; ModuleDefaults[i].name != NULL ; i++) {
+ if (strcmp(ModuleDefaults[i].name, "xwayland") == 0) {
+ ModuleDefaults[i].toLoad = TRUE;
+ }
+ }
+ }
+
if (xf86configptr->conf_modules) {
/* Walk the disable list and let people know what we've parsed to
* not be loaded
@@ -507,9 +519,13 @@ xf86InputDriverlistFromConfig(void)
static void
fixup_video_driver_list(const char **drivers)
{
- static const char *fallback[4] = { "fbdev", "vesa", "wsfb", NULL };
+ static const char *fallback_hw[4] = { "fbdev", "vesa", "wsfb", NULL };
const char **end, **drv;
const char *x;
+#ifdef XORG_WAYLAND
+ static const char *fallback_wl[2] = { "wayland", NULL };
+#endif
+ static const char **fallbacks;
int i;
/* walk to the end of the list */
@@ -520,9 +536,15 @@ fixup_video_driver_list(const char **drivers)
* for each of the fallback drivers, if we find it in the list,
* swap it with the last available non-fallback driver.
*/
- for (i = 0; fallback[i]; i++) {
+#ifdef XORG_WAYLAND
+ if (xorgWayland)
+ fallbacks = fallback_wl;
+ else
+#endif
+ fallbacks = fallback_hw;
+ for (i = 0; fallbacks[i]; i++) {
for (drv = drivers; drv != end; drv++) {
- if (strstr(*drv, fallback[i])) {
+ if (strstr(*drv, fallbacks[i])) {
x = *drv;
*drv = *end;
*end = x;
@@ -859,6 +881,13 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
}
xf86Msg(from, "%sutomatically adding GPU devices\n",
xf86Info.autoAddGPU ? "A" : "Not a");
+
+ /* FIXME: Do that at the right place (before xf86Msg). */
+ if (xorgWayland) {
+ xf86Info.autoAddDevices = FALSE;
+ xf86Info.autoEnableDevices = FALSE;
+ }
+
/*
* Set things up based on the config file information. Some of these
* settings may be overridden later when the command line options are
@@ -949,9 +978,10 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
}
#endif
- /* if we're not hotplugging, force some input devices to exist */
- xf86Info.forceInputDevices = !(xf86Info.autoAddDevices &&
- xf86Info.autoEnableDevices);
+ if (xorgWayland) /* Don't force input devices */
+ xf86Info.forceInputDevices = FALSE;
+ else /* if we're not hotplugging, force some input devices to exist */
+ xf86Info.forceInputDevices = !(xf86Info.autoAddDevices && xf86Info.autoEnableDevices);
/* when forcing input devices, we use kbd. otherwise evdev, so use the
* evdev rules set. */