1 --- a/hw/xfree86/common/xf86Globals.c
2 +++ b/hw/xfree86/common/xf86Globals.c
3 @@ -162,6 +162,7 @@ InputDriverPtr *xf86InputDriverList = NU
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
13 @@ -482,20 +482,34 @@ InitOutput(ScreenInfo * pScreenInfo, int
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. */
51 @@ -557,8 +571,15 @@ InitOutput(ScreenInfo * pScreenInfo, int
53 xorgHWAccess = xf86EnableIO();
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
71 @@ -89,6 +89,7 @@ extern _X_EXPORT int xf86NumDrivers;
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 */