1
Description: Fall back to autoconfiguration for graphics drivers in some cases instead of letting X fail when configuration files are available.
2
Author: Alberto Milone <alberto.milone@canonical.com>
4
Index: xorg-server-1.17.2/hw/xfree86/common/xf86Globals.c
5
===================================================================
6
--- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Globals.c
7
+++ xorg-server-1.17.2/hw/xfree86/common/xf86Globals.c
8
@@ -161,6 +161,7 @@ InputDriverPtr *xf86InputDriverList = NU
9
int xf86NumInputDrivers = 0;
10
int xf86NumScreens = 0;
11
int xf86NumGPUScreens = 0;
12
+Bool xf86AttemptedFallback = FALSE;
14
const char *xf86VisualNames[] = {
16
Index: xorg-server-1.17.2/hw/xfree86/common/xf86Init.c
17
===================================================================
18
--- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Init.c
19
+++ xorg-server-1.17.2/hw/xfree86/common/xf86Init.c
20
@@ -469,20 +469,34 @@ InitOutput(ScreenInfo * pScreenInfo, int
25
/* Load all driver modules specified in the config file */
26
/* If there aren't any specified in the config file, autoconfig them */
27
/* FIXME: Does not handle multiple active screen sections, but I'm not
28
* sure if we really want to handle that case*/
29
configured_device = xf86ConfigLayout.screens->screen->device;
30
- if ((!configured_device) || (!configured_device->driver)) {
31
+ if (xf86AttemptedFallback) {
32
+ configured_device->driver = NULL;
33
+ if (!autoConfigDevice(configured_device)) {
34
+ xf86Msg(X_ERROR, "Auto configuration on fallback failed\n");
38
+ else if ((!configured_device) || (!configured_device->driver)) {
39
if (!autoConfigDevice(configured_device)) {
40
xf86Msg(X_ERROR, "Automatic driver configuration failed\n");
44
if ((modulelist = xf86DriverlistFromConfig())) {
45
- xf86LoadModules(modulelist, NULL);
47
+ if (!xf86LoadModules(modulelist, NULL) && !xf86AttemptedFallback) {
49
+ xf86AttemptedFallback = TRUE;
57
/* Load all input driver modules specified in the config file. */
58
@@ -545,8 +559,15 @@ InitOutput(ScreenInfo * pScreenInfo, int
60
xorgHWAccess = xf86EnableIO();
62
- if (xf86BusConfig() == FALSE)
64
+ if (xf86BusConfig() == FALSE) {
65
+ if (!xf86AttemptedFallback) {
66
+ xf86AttemptedFallback = TRUE;
76
Index: xorg-server-1.17.2/hw/xfree86/common/xf86Priv.h
77
===================================================================
78
--- xorg-server-1.17.2.orig/hw/xfree86/common/xf86Priv.h
79
+++ xorg-server-1.17.2/hw/xfree86/common/xf86Priv.h
80
@@ -89,6 +89,7 @@ extern _X_EXPORT int xf86NumDrivers;
81
extern _X_EXPORT Bool xf86Resetting;
82
extern _X_EXPORT Bool xf86Initialising;
83
extern _X_EXPORT int xf86NumScreens;
84
+extern _X_EXPORT Bool xf86AttemptedFallback;
85
extern _X_EXPORT const char *xf86VisualNames[];
86
extern _X_EXPORT int xf86Verbose; /* verbosity level */
87
extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */