updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / xorg-server-catalyst-maximize-fix / autoconfig-nvidia.patch
blobc56586d5453d7db72031bca4298dd0617237482e
1 From a685b5cf34532cef96fc9b05f735088ac0c0c7ad Mon Sep 17 00:00:00 2001
2 From: Fedora X Ninjas <x@fedoraproject.org>
3 Date: Tue, 16 Feb 2010 11:38:17 +1000
4 Subject: [PATCH 08/17] autoconfig: select nouveau by default for NVIDIA GPUs
6 Also, don't treat DRI setup failure as an error for nouveau.
8 Modified by Archlinux:
9 Append nvidia driver to the list of prefered drivers
10 ---
11 glx/glxdri.c | 7 +++++--
12 glx/glxdri2.c | 7 +++++--
13 hw/xfree86/common/xf86AutoConfig.c | 19 ++++++++++++++++++-
14 3 files changed, 28 insertions(+), 5 deletions(-)
16 --- a/glx/glxdri.c
17 +++ b/glx/glxdri.c
18 @@ -978,6 +978,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
19 const __DRIconfig **driConfigs;
20 const __DRIextension **extensions;
21 int i;
22 + int from = X_ERROR;
24 if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") ||
25 !DRIQueryDirectRenderingCapable(pScreen, &isCapable) ||
26 @@ -1057,7 +1058,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
28 screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
29 if (screen->driver == NULL) {
30 - LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
31 + if (!strcmp(driverName, "nouveau"))
32 + from = X_INFO;
33 + LogMessage(from, "AIGLX error: dlopen of %s failed (%s)\n",
34 filename, dlerror());
35 goto handle_error;
37 @@ -1193,7 +1196,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
39 free(screen);
41 - LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
42 + LogMessage(from, "AIGLX: reverting to software rendering\n");
44 return NULL;
46 --- a/glx/glxdri2.c
47 +++ b/glx/glxdri2.c
48 @@ -708,6 +708,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
49 const __DRIextension **extensions;
50 const __DRIconfig **driConfigs;
51 int i;
52 + int from = X_ERROR;
54 screen = calloc(1, sizeof *screen);
55 if (screen == NULL)
56 @@ -734,7 +735,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
58 screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
59 if (screen->driver == NULL) {
60 - LogMessage(X_ERROR, "AIGLX error: dlopen of %s failed (%s)\n",
61 + if (!strcmp(driverName, "nouveau"))
62 + from = X_INFO;
63 + LogMessage(from, "AIGLX error: dlopen of %s failed (%s)\n",
64 filename, dlerror());
65 goto handle_error;
67 @@ -826,7 +829,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
69 free(screen);
71 - LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n");
72 + LogMessage(from, "AIGLX: reverting to software rendering\n");
74 return NULL;
76 --- a/hw/xfree86/common/xf86pciBus.c
77 +++ b/hw/xfree86/common/xf86pciBus.c
78 @@ -1123,7 +1123,25 @@ videoPtrToDriverList(struct pci_device *
79 break;
80 case 0x102b: driverList[0] = "mga"; break;
81 case 0x10c8: driverList[0] = "neomagic"; break;
82 - case 0x10de: case 0x12d2: driverList[0] = "nv"; break;
83 + case 0x10de: case 0x12d2:
84 + switch (dev->device_id) {
85 + /* NV1 */
86 + case 0x0008:
87 + case 0x0009:
88 + driverList[0] = "vesa";
89 + break;
90 + /* NV3 */
91 + case 0x0018:
92 + case 0x0019:
93 + driverList[0] = "nv";
94 + break;
95 + default:
96 + driverList[0] = "nouveau";
97 + driverList[1] = "nv";
98 + driverList[2] = "nvidia";
99 + break;
101 + break;
102 case 0x1106: driverList[0] = "openchrome"; break;
103 case 0x1b36: driverList[0] = "qxl"; break;
104 case 0x1163: driverList[0] = "rendition"; break;