Accepting request 35764 from X11:XOrg

checked in (request 35764)

OBS-URL: https://build.opensuse.org/request/show/35764
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=237
This commit is contained in:
OBS User autobuild 2010-03-26 15:22:05 +00:00 committed by Git OBS Bridge
parent fe179e89e1
commit b176db4551
3 changed files with 75 additions and 108 deletions

View File

@ -1,123 +1,97 @@
commit 4da6cffa8b6169595ea447cc53dfab857c04db04 --- hw/xfree86/common/xf86AutoConfig.c
Author: h_root <root@hilbert.suse.de> +++ hw/xfree86/common/xf86AutoConfig.c
Date: Thu Mar 25 18:32:04 2010 +0100 @@ -539,34 +541,13 @@
}
when doing driver autoconfiguration with some parts of the config
file present but no driver set (e.g. only input configuration)
fix the case that we may have multiple drivers to try.
create a screen section for each driver and let them be tried
in a row
diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c
index 7f4ada8..56f7deb 100644
--- a/hw/xfree86/common/xf86AutoConfig.c
+++ b/hw/xfree86/common/xf86AutoConfig.c
@@ -546,10 +546,41 @@ chooseVideoDriver(void)
return chosen_driver;
} }
+ -static char*
+/* copy a screen section and enter the desired driver -chooseVideoDriver(void)
+ * and insert it at i in the list of screens */ -{
+static Bool - char *chosen_driver = NULL;
+copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) - int i;
+{ - char *matches[20]; /* If we have more than 20 drivers we're in trouble */
+ GDevPtr cptr = NULL; -
+ - listPossibleVideoDrivers(matches, 20);
+ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); -
+ if(!xf86ConfigLayout.screens[i].screen) - /* TODO Handle multiple drivers claiming to support the same PCI ID */
+ return FALSE; - chosen_driver = matches[0];
+ memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec)); -
+ - xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n",
+ cptr = xcalloc(1, sizeof(GDevRec)); - chosen_driver);
+ if (!cptr) -
+ return FALSE; - for (i = 0; matches[i] ; i++) {
+ memcpy(cptr, odev, sizeof(GDevRec)); - if (matches[i] != chosen_driver) {
+ - xfree(matches[i]);
+ cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver); - }
+ cptr->driver = driver; - }
+ -
+ /* now associate the new driver entry with the new screen entry */ - return chosen_driver;
+ xf86ConfigLayout.screens[i].screen->device = cptr; -}
+ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; -
+
+ return TRUE;
+}
+
GDevPtr GDevPtr
autoConfigDevice(GDevPtr preconf_device) autoConfigDevice(GDevPtr preconf_device)
{ {
GDevPtr ptr = NULL; - GDevPtr ptr = NULL;
+ GDevPtr ptr = NULL, cptr = NULL;
+ char *matches[20]; /* If we have more than 20 drivers we're in trouble */ + char *matches[20]; /* If we have more than 20 drivers we're in trouble */
+ int num_matches = 0, num_screens = 0, i; + int num_matches = 0, num_screens = 0, i;
+ screenLayoutPtr slp; + screenLayoutPtr slp;
if (!xf86configptr) { if (!xf86configptr) {
return NULL; return NULL;
@@ -573,14 +604,59 @@ autoConfigDevice(GDevPtr preconf_device) @@ -589,14 +571,49 @@
ptr->driver = NULL; ptr->driver = NULL;
} }
if (!ptr->driver) { if (!ptr->driver) {
- ptr->driver = chooseVideoDriver(); - ptr->driver = chooseVideoDriver();
- } + listPossibleVideoDrivers(matches, 20);
+ /* get all possible video drivers and count them */ + for (; matches[num_matches] ; num_matches++);
+ listPossibleVideoDrivers(matches, 20); + slp = xf86ConfigLayout.screens;
+ for (; matches[num_matches]; num_matches++) { + if (slp) {
+ xf86Msg(X_DEFAULT, "Matched %s as autoconfigured driver %d\n", + for (; slp[num_screens].screen ; num_screens++);
+ matches[num_matches], num_matches); + xf86ConfigLayout.screens = xnfcalloc(1,(num_screens+num_matches+1) * sizeof(screenLayoutRec));
+ } + xf86ConfigLayout.screens[0] = slp[0];
+ + }
+ slp = xf86ConfigLayout.screens; + for (i=0; i<num_matches;i++) {
+ if (slp) { + if (i==0) {
+ /* count the number of screens and make space for + ptr->driver = matches[0];
+ * a new screen for each additional possible driver + if (slp && !xf86ConfigLayout.screens[0].screen->device) {
+ * minus one for the already existing first one + xf86ConfigLayout.screens[0].screen->device = ptr;
+ * plus one for the terminating NULL */ + ptr->myScreenSection = xf86ConfigLayout.screens[0].screen;
+ for (; slp[num_screens].screen; num_screens++); + }
+ xf86ConfigLayout.screens = xnfcalloc(num_screens + num_matches, + } else {
+ sizeof(screenLayoutRec)); + if (slp) {
+ xf86ConfigLayout.screens[0] = slp[0]; + xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec));
+ + if(!xf86ConfigLayout.screens[i].screen)
+ /* do the first match and set that for the original first screen */ + return NULL;
+ ptr->driver = matches[0]; + memcpy(xf86ConfigLayout.screens[i].screen, slp[0].screen, sizeof(confScreenRec));
+ if (!xf86ConfigLayout.screens[0].screen->device) { + }
+ xf86ConfigLayout.screens[0].screen->device = ptr; + cptr = xcalloc(1, sizeof(GDevRec));
+ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; + if (!cptr)
+ } + return NULL;
+ + memcpy(cptr, ptr, sizeof(GDevRec));
+ /* for each other driver found, copy the first screen, insert it + cptr->identifier = xnfcalloc(1,strlen("Autoconfigured Video Device ")+strlen(matches[i])+1);
+ * into the list of screens and set the driver */ + sprintf(cptr->identifier, "Autoconfigured Video Device %s", matches[i]);
+ i = 0; + cptr->driver = matches[i];
+ while (i++ < num_matches) { + if (slp) {
+ if (!copyScreen(slp[0].screen, ptr, i, matches[i])) + xf86ConfigLayout.screens[i].screen->device = cptr;
+ return NULL; + cptr->myScreenSection = xf86ConfigLayout.screens[i].screen;
+ } + }
+ }
+ }
+ for (i=1;i<num_screens;i++) {
+ xf86ConfigLayout.screens[i+num_matches] = slp[i];
+ }
+ xf86ConfigLayout.screens[num_screens+num_matches].screen = NULL;
+ xfree(slp);
}
- /* TODO Handle multiple screen sections */ - /* TODO Handle multiple screen sections */
- if (xf86ConfigLayout.screens && !xf86ConfigLayout.screens->screen->device) { - if (xf86ConfigLayout.screens && !xf86ConfigLayout.screens->screen->device) {
- xf86ConfigLayout.screens->screen->device = ptr; - xf86ConfigLayout.screens->screen->device = ptr;
- ptr->myScreenSection = xf86ConfigLayout.screens->screen; - ptr->myScreenSection = xf86ConfigLayout.screens->screen;
+ /* shift the rest of the original screen list - }
+ * to the end of the current screen list + /* TODO Handle rest of multiple screen sections */
+ *
+ * TODO Handle rest of multiple screen sections */
+ for (i = 1; i < num_screens; i++) {
+ xf86ConfigLayout.screens[i+num_matches] = slp[i];
+ }
+ xf86ConfigLayout.screens[num_screens+num_matches-1].screen = NULL;
+ xfree(slp);
+ } else {
+ /* layout does not have any screens, not much to do */
+ ptr->driver = matches[0];
+ for (i = 1; matches[i] ; i++) {
+ if (matches[i] != matches[0]) {
+ xfree(matches[i]);
+ }
+ }
+ }
}
+
xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n"); xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n");
return ptr; return ptr;

View File

@ -1,10 +1,3 @@
-------------------------------------------------------------------
Fri Mar 26 02:45:15 CET 2010 - sndirsch@suse.de
- xorg-server-walk_drivers.diff:
* updated patch working more cleanly, fixed coding style, added
comments (Rüdiger Oerttel)
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Mar 24 17:05:53 CET 2010 - sndirsch@suse.de Wed Mar 24 17:05:53 CET 2010 - sndirsch@suse.de

View File

@ -229,7 +229,7 @@ popd
%patch132 -p1 %patch132 -p1
%patch143 -p0 %patch143 -p0
%patch145 -p0 %patch145 -p0
%patch146 -p1 %patch146 -p0
%patch147 -p1 %patch147 -p1
%patch162 -p1 %patch162 -p1
%if %moblin %if %moblin