1 --- a/hw/xfree86/common/xf86Globals.c
2 +++ b/hw/xfree86/common/xf86Globals.c
4 int xf86NumInputDrivers = 0;
5 int xf86NumScreens = 0;
6 int xf86NumGPUScreens = 0;
7 +Bool xf86AttemptedFallback = FALSE;
9 const char *xf86VisualNames[] = {
11 --- a/hw/xfree86/common/xf86Init.c
12 +++ b/hw/xfree86/common/xf86Init.c
18 /* Load all driver modules specified in the config file */
19 /* If there aren't any specified in the config file, autoconfig them */
20 /* FIXME: Does not handle multiple active screen sections, but I'm not
21 * sure if we really want to handle that case*/
22 configured_device = xf86ConfigLayout.screens->screen->device;
23 - if ((!configured_device) || (!configured_device->driver)) {
24 + if (xf86AttemptedFallback) {
25 + configured_device->driver = NULL;
26 + if (!autoConfigDevice(configured_device)) {
27 + xf86Msg(X_ERROR, "Auto configuration on fallback failed\n");
31 + else if ((!configured_device) || (!configured_device->driver)) {
32 if (!autoConfigDevice(configured_device)) {
33 xf86Msg(X_ERROR, "Automatic driver configuration failed\n");
37 if ((modulelist = xf86DriverlistFromConfig())) {
38 - xf86LoadModules(modulelist, NULL);
40 + if (!xf86LoadModules(modulelist, NULL) && !xf86AttemptedFallback) {
42 + xf86AttemptedFallback = TRUE;
50 /* Load all input driver modules specified in the config file. */
53 xf86Info.dontVTSwitch = TRUE;
55 - if (xf86BusConfig() == FALSE)
57 + if (xf86BusConfig() == FALSE) {
58 + if (!xf86AttemptedFallback) {
59 + xf86AttemptedFallback = TRUE;
69 --- a/hw/xfree86/common/xf86Priv.h
70 +++ b/hw/xfree86/common/xf86Priv.h
72 extern _X_EXPORT Bool xf86Resetting;
73 extern _X_EXPORT Bool xf86Initialising;
74 extern _X_EXPORT int xf86NumScreens;
75 +extern _X_EXPORT Bool xf86AttemptedFallback;
76 extern _X_EXPORT const char *xf86VisualNames[];
77 extern _X_EXPORT int xf86Verbose; /* verbosity level */
78 extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */