summaryrefslogtreecommitdiff
path: root/extra/xorg-server/autoconfig-nvidia.patch
blob: c56586d5453d7db72031bca4298dd0617237482e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
From a685b5cf34532cef96fc9b05f735088ac0c0c7ad Mon Sep 17 00:00:00 2001
From: Fedora X Ninjas <x@fedoraproject.org>
Date: Tue, 16 Feb 2010 11:38:17 +1000
Subject: [PATCH 08/17] autoconfig: select nouveau by default for NVIDIA GPUs

Also, don't treat DRI setup failure as an error for nouveau.

Modified by Archlinux:
Append nvidia driver to the list of prefered drivers
---
 glx/glxdri.c                       |    7 +++++--
 glx/glxdri2.c                      |    7 +++++--
 hw/xfree86/common/xf86AutoConfig.c |   19 ++++++++++++++++++-
 3 files changed, 28 insertions(+), 5 deletions(-)

--- a/glx/glxdri.c
+++ b/glx/glxdri.c
@@ -978,6 +978,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     const __DRIconfig **driConfigs;
     const __DRIextension **extensions;
     int i;
+    int from = X_ERROR;
 
     if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
 	!DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
@@ -1057,7 +1058,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
     if (screen->driver == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
+	if (!strcmp(driverName, "nouveau"))
+	    from = X_INFO;
+	LogMessage(from, "AIGLX error: dlopen of %s failed (%s)\n",
 		   filename, dlerror());
         goto handle_error;
     }
@@ -1193,7 +1196,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     free(screen);
 
-    LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
+    LogMessage(from, "AIGLX: reverting to software rendering\n");
 
     return NULL;
 }
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -708,6 +708,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
     const __DRIextension **extensions;
     const __DRIconfig **driConfigs;
     int i;
+    int from = X_ERROR;
 
     screen = calloc(1, sizeof *screen);
     if (screen == NULL)
@@ -734,7 +735,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
     if (screen->driver == NULL) {
-	LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
+	if (!strcmp(driverName, "nouveau"))
+	    from = X_INFO;
+	LogMessage(from, "AIGLX error: dlopen of %s failed (%s)\n",
 		   filename, dlerror());
         goto handle_error;
     }
@@ -826,7 +829,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
 
     free(screen);
 
-    LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
+    LogMessage(from, "AIGLX: reverting to software rendering\n");
 
     return NULL;
 }
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -1123,7 +1123,25 @@ videoPtrToDriverList(struct pci_device *
 	    break;
 	case 0x102b:		    driverList[0] = "mga";	break;
 	case 0x10c8:		    driverList[0] = "neomagic"; break;
-	case 0x10de: case 0x12d2:   driverList[0] = "nv";	break;
+	case 0x10de: case 0x12d2:
+	    switch (dev->device_id) {
+	    /* NV1 */
+	    case 0x0008:
+	    case 0x0009:
+		driverList[0] = "vesa";
+		break;
+	    /* NV3 */
+	    case 0x0018:
+	    case 0x0019:
+		driverList[0] = "nv";
+		break;
+	    default:
+		driverList[0] = "nouveau";
+		driverList[1] = "nv";
+		driverList[2] = "nvidia";
+		break;
+	    }
+	    break;
 	case 0x1106:		    driverList[0] = "openchrome"; break;
         case 0x1b36:		    driverList[0] = "qxl"; break;
 	case 0x1163:		    driverList[0] = "rendition"; break;