X-Git-Url: https://git.piment-noir.org/?p=deb_xorg-server.git;a=blobdiff_plain;f=debian%2Fpatches%2F226_fall_back_to_autoconfiguration.patch;fp=debian%2Fpatches%2F226_fall_back_to_autoconfiguration.patch;h=70fa7e532c8be34e347a05c35451b69d8444bc9d;hp=0000000000000000000000000000000000000000;hb=7217e0ca50bba73dad94782e67980aeeb24ab693;hpb=a09e091a5c996d46a398abb27b06fe504591673f diff --git a/debian/patches/226_fall_back_to_autoconfiguration.patch b/debian/patches/226_fall_back_to_autoconfiguration.patch new file mode 100644 index 0000000..70fa7e5 --- /dev/null +++ b/debian/patches/226_fall_back_to_autoconfiguration.patch @@ -0,0 +1,78 @@ +--- a/hw/xfree86/common/xf86Globals.c ++++ b/hw/xfree86/common/xf86Globals.c +@@ -161,6 +161,7 @@ + int xf86NumInputDrivers = 0; + int xf86NumScreens = 0; + int xf86NumGPUScreens = 0; ++Bool xf86AttemptedFallback = FALSE; + + const char *xf86VisualNames[] = { + "StaticGray", +--- a/hw/xfree86/common/xf86Init.c ++++ b/hw/xfree86/common/xf86Init.c +@@ -481,20 +481,34 @@ + free(optionlist); + } + ++ Fallback: + /* Load all driver modules specified in the config file */ + /* If there aren't any specified in the config file, autoconfig them */ + /* FIXME: Does not handle multiple active screen sections, but I'm not + * sure if we really want to handle that case*/ + configured_device = xf86ConfigLayout.screens->screen->device; +- if ((!configured_device) || (!configured_device->driver)) { ++ if (xf86AttemptedFallback) { ++ configured_device->driver = NULL; ++ if (!autoConfigDevice(configured_device)) { ++ xf86Msg(X_ERROR, "Auto configuration on fallback failed\n"); ++ return; ++ } ++ } ++ else if ((!configured_device) || (!configured_device->driver)) { + if (!autoConfigDevice(configured_device)) { + xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); + return; + } + } + if ((modulelist = xf86DriverlistFromConfig())) { +- xf86LoadModules(modulelist, NULL); +- free(modulelist); ++ if (!xf86LoadModules(modulelist, NULL) && !xf86AttemptedFallback) { ++ free(modulelist); ++ xf86AttemptedFallback = TRUE; ++ goto Fallback; ++ } ++ else { ++ free(modulelist); ++ } + } + + /* Load all input driver modules specified in the config file. */ +@@ -554,8 +568,15 @@ + else + xf86Info.dontVTSwitch = TRUE; + +- if (xf86BusConfig() == FALSE) +- return; ++ if (xf86BusConfig() == FALSE) { ++ if (!xf86AttemptedFallback) { ++ xf86AttemptedFallback = TRUE; ++ goto Fallback; ++ } ++ else { ++ return; ++ } ++ } + + xf86PostProbe(); + +--- a/hw/xfree86/common/xf86Priv.h ++++ b/hw/xfree86/common/xf86Priv.h +@@ -89,6 +89,7 @@ + extern _X_EXPORT Bool xf86Resetting; + extern _X_EXPORT Bool xf86Initialising; + extern _X_EXPORT int xf86NumScreens; ++extern _X_EXPORT Bool xf86AttemptedFallback; + extern _X_EXPORT const char *xf86VisualNames[]; + extern _X_EXPORT int xf86Verbose; /* verbosity level */ + extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */