105 lines
3.3 KiB
Diff
105 lines
3.3 KiB
Diff
|
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(-)
|
||
|
|
||
|
--- glx/glxdri.c
|
||
|
+++ 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;
|
||
|
}
|
||
|
--- glx/glxdri2.c
|
||
|
+++ 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;
|
||
|
}
|
||
|
--- hw/xfree86/common/xf86pciBus.c
|
||
|
+++ 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;
|