From d21b8596b9bf197105746fa106f33c2269b77851ff7d0f234abf7771605f6e5e Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Tue, 23 Mar 2010 03:47:27 +0000 Subject: [PATCH] Accepting request 35510 from home:oertel:branches:openSUSE:Factory Copy from home:oertel:branches:openSUSE:Factory/xorg-x11-server via accept of submit request 35510 revision 16. Request was accepted with message: reviewed ok. OBS-URL: https://build.opensuse.org/request/show/35510 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=230 --- xorg-server-walk_drivers.diff | 136 ++++++++++++++++++++++++++++++++++ xorg-x11-server.changes | 17 +++++ xorg-x11-server.spec | 4 + xserver-1.6.1-nouveau.patch | 67 +++++++++++++++++ 4 files changed, 224 insertions(+) create mode 100644 xorg-server-walk_drivers.diff create mode 100644 xserver-1.6.1-nouveau.patch diff --git a/xorg-server-walk_drivers.diff b/xorg-server-walk_drivers.diff new file mode 100644 index 0000000..e602a6a --- /dev/null +++ b/xorg-server-walk_drivers.diff @@ -0,0 +1,136 @@ +--- hw/xfree86/common/xf86AutoConfig.c ++++ hw/xfree86/common/xf86AutoConfig.c +@@ -541,22 +541,32 @@ + static char* + chooseVideoDriver(void) + { +- char *chosen_driver = NULL; +- int i; ++ char *chosen_driver = NULL, *match_driver; ++ int i, len = 0; + char *matches[20]; /* If we have more than 20 drivers we're in trouble */ + + listPossibleVideoDrivers(matches, 20); + +- /* TODO Handle multiple drivers claiming to support the same PCI ID */ +- chosen_driver = matches[0]; ++ for (i = 0; matches[i] ; i++) { ++ len += strlen(matches[i])+1; ++ } ++ ++ chosen_driver = (char*)xalloc(len); ++ match_driver = chosen_driver; ++ for (i = 0; matches[i] ; i++) { ++ strcpy(match_driver, matches[i]); ++ match_driver += strlen(matches[i]); ++ if (matches[i+1]) { ++ strcat(chosen_driver, ","); ++ match_driver++; ++ } ++ } + + xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n", + chosen_driver); + + for (i = 0; matches[i] ; i++) { +- if (matches[i] != chosen_driver) { +- xfree(matches[i]); +- } ++ xfree(matches[i]); + } + + return chosen_driver; +--- hw/xfree86/common/xf86Config.c ++++ hw/xfree86/common/xf86Config.c +@@ -381,6 +381,7 @@ + int count = 0; + int j; + char **modulearray; ++ char *screendriver, *screendriver_next; + screenLayoutPtr slp; + + /* +@@ -400,8 +401,14 @@ + */ + if (xf86ConfigLayout.screens) { + slp = xf86ConfigLayout.screens; +- while ((slp++)->screen) { ++ while (slp->screen) { ++ screendriver = slp->screen->device->driver; ++ while ((screendriver = strchr(screendriver,',')) != NULL) { ++ screendriver++; ++ count++; ++ } + count++; ++ slp++; + } + } + +@@ -422,7 +429,16 @@ + count = 0; + slp = xf86ConfigLayout.screens; + while (slp->screen) { +- modulearray[count] = slp->screen->device->driver; ++ screendriver = slp->screen->device->driver; ++ while ((screendriver_next = strchr(screendriver,',')) != NULL) { ++ int entry_len = screendriver_next - screendriver; ++ modulearray[count] = xnfalloc((entry_len+1)*sizeof(char)); ++ strncpy(modulearray[count],screendriver,entry_len); ++ *(modulearray[count] + entry_len) = '\0'; ++ screendriver = screendriver_next+1; ++ count++; ++ } ++ modulearray[count] = screendriver; + count++; + slp++; + } +--- hw/xfree86/common/xf86Helper.c ++++ hw/xfree86/common/xf86Helper.c +@@ -1459,6 +1459,7 @@ + { + GDevPtr gdp, *pgdp = NULL; + confScreenPtr screensecptr; ++ char *screendriver, *screendriver_next; + int i,j; + + if (sectlist) +@@ -1489,15 +1490,31 @@ + */ + for (j=0; xf86ConfigLayout.screens[j].screen != NULL; j++) { + screensecptr = xf86ConfigLayout.screens[j].screen; +- if ((screensecptr->device->driver != NULL) +- && (xf86NameCmp( screensecptr->device->driver,drivername) == 0) +- && (! screensecptr->device->claimed)) { +- /* +- * we have a matching driver that wasn't claimed, yet +- */ +- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); +- pgdp[i++] = screensecptr->device; ++ screendriver = screensecptr->device->driver; ++ while(screendriver && (screendriver_next = strchr(screendriver,',')) != NULL) { ++ *screendriver_next = '\0'; ++ if ((xf86NameCmp( screensecptr->device->driver,drivername) == 0) ++ && (! screensecptr->device->claimed)) { ++ /* ++ * we have a matching driver that wasn't claimed, yet ++ */ ++ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); ++ pgdp[i++] = screensecptr->device; ++ } ++ *screendriver_next = ','; ++ screendriver = screendriver_next+1; + } ++ ++ if (screendriver ++ && (xf86NameCmp(screendriver,drivername) == 0) ++ && (! screensecptr->device->claimed)) { ++ /* ++ * we have a matching driver that wasn't claimed, yet ++ */ ++ pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); ++ pgdp[i++] = screensecptr->device; ++ } ++ + } + + /* Then handle the inactive devices */ diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 5237202..e4c1a89 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Tue Mar 23 00:07:28 CET 2010 - ro@suse.de + +- xserver-1.6.1-nouveau.patch (from fedora) + Also, don't treat DRI setup failure as an error for nouveau. + +------------------------------------------------------------------- +Mon Mar 22 17:48:04 CET 2010 - ro@suse.de + +- rework xorg-server-walk_drivers.diff + +------------------------------------------------------------------- +Mon Mar 22 00:23:22 CET 2010 - ro@suse.de + +- re-implement walking list of possible drivers to find a working + one + ------------------------------------------------------------------- Thu Mar 18 02:29:25 CET 2010 - ro@suse.de diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 0831e53..2e8c8b4 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -104,6 +104,8 @@ Patch129: bug474071-fix1.diff Patch132: fixed-SYNC-extension-trigger-BlockHandler-test.diff Patch143: autoconfig_fallback_fbdev_first.diff Patch145: driver-autoconfig.diff +Patch146: xorg-server-walk_drivers.diff +Patch147: xserver-1.6.1-nouveau.patch # Moblin Patch162: cache-xkbcomp-output-for-fast-start-up.patch %if %moblin @@ -225,6 +227,8 @@ popd %patch132 -p1 %patch143 -p0 %patch145 -p0 +%patch146 -p0 +%patch147 -p1 %patch162 -p1 %if %moblin %patch163 -p1 diff --git a/xserver-1.6.1-nouveau.patch b/xserver-1.6.1-nouveau.patch new file mode 100644 index 0000000..a1191b1 --- /dev/null +++ b/xserver-1.6.1-nouveau.patch @@ -0,0 +1,67 @@ +Also, don't treat DRI setup failure as an error for nouveau. +--- + +diff --git a/glx/glxdri.c b/glx/glxdri.c +index 21e44d1..30b820c 100644 +--- a/glx/glxdri.c ++++ b/glx/glxdri.c +@@ -968,6 +968,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) + const __DRIconfig **driConfigs; + const __DRIextension **extensions; + int i; ++ int from = X_ERROR; + + if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") || + !DRIQueryDirectRenderingCapable(pScreen, &isCapable) || +@@ -1047,7 +1048,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; + } +@@ -1184,7 +1187,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) + + xfree(screen); + +- LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n"); ++ LogMessage(from, "AIGLX: reverting to software rendering\n"); + + return NULL; + } +diff --git a/glx/glxdri2.c b/glx/glxdri2.c +index 0f998de..a244809 100644 +--- a/glx/glxdri2.c ++++ b/glx/glxdri2.c +@@ -676,6 +676,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) + const __DRIextension **extensions; + const __DRIconfig **driConfigs; + int i; ++ int from = X_ERROR; + + screen = xcalloc(1, sizeof *screen); + if (screen == NULL) +@@ -702,7 +703,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; + } +@@ -793,7 +796,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) + + xfree(screen); + +- LogMessage(X_ERROR, "AIGLX: reverting to software rendering\n"); ++ LogMessage(from, "AIGLX: reverting to software rendering\n"); + + return NULL; + }