~ubuntu-branches/ubuntu/trusty/xorg-server-lts-xenial/trusty-updates

« back to all changes in this revision

Viewing changes to debian/patches/226_fall_back_to_autoconfiguration.patch

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2016-05-03 14:02:21 UTC
  • Revision ID: package-import@ubuntu.com-20160503140221-p5jty1kzz5nzj107
Tags: 2:1.18.3-1ubuntu2.2~trusty1
* Backport for lts-xenial stack.
  - revert configurable maxclients, avoid depending on newer coreproto
  - rules: work around ftbfs on ppc64el

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
3
 
 
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;
 
13
 
 
14
 const char *xf86VisualNames[] = {
 
15
     "StaticGray",
 
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
 
21
             free(optionlist);
 
22
         }
 
23
 
 
24
+ Fallback:
 
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");
 
35
+                return;
 
36
+            }
 
37
+        }
 
38
+        else if ((!configured_device) || (!configured_device->driver)) {
 
39
             if (!autoConfigDevice(configured_device)) {
 
40
                 xf86Msg(X_ERROR, "Automatic driver configuration failed\n");
 
41
                 return;
 
42
             }
 
43
         }
 
44
         if ((modulelist = xf86DriverlistFromConfig())) {
 
45
-            xf86LoadModules(modulelist, NULL);
 
46
-            free(modulelist);
 
47
+            if (!xf86LoadModules(modulelist, NULL) && !xf86AttemptedFallback) {
 
48
+                free(modulelist);
 
49
+                xf86AttemptedFallback = TRUE;
 
50
+                goto Fallback;
 
51
+            }
 
52
+            else {
 
53
+                free(modulelist);
 
54
+            }
 
55
         }
 
56
 
 
57
         /* Load all input driver modules specified in the config file. */
 
58
@@ -545,8 +559,15 @@ InitOutput(ScreenInfo * pScreenInfo, int
 
59
        if (want_hw_access)
 
60
            xorgHWAccess = xf86EnableIO();
 
61
 
 
62
-        if (xf86BusConfig() == FALSE)
 
63
-            return;
 
64
+        if (xf86BusConfig() == FALSE) {
 
65
+            if (!xf86AttemptedFallback) {
 
66
+                xf86AttemptedFallback = TRUE;
 
67
+                goto Fallback;
 
68
+            }
 
69
+            else {
 
70
+                return;
 
71
+            }
 
72
+        }
 
73
 
 
74
         xf86PostProbe();
 
75
 
 
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 */