From aab9091290882749b49131af2ed5636112afbc36bf351bf92b1e9333b6cdef15 Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Fri, 26 Mar 2010 01:39:56 +0000 Subject: [PATCH 1/4] Accepting request 35762 from home:oertel:branches:openSUSE:Factory Copy from home:oertel:branches:openSUSE:Factory/xorg-x11-server via accept of submit request 35762 revision 23. Request was accepted with message: reviewed ok. OBS-URL: https://build.opensuse.org/request/show/35762 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=235 --- xorg-server-walk_drivers.diff | 174 +++++++++++++++++++--------------- xorg-x11-server.spec | 2 +- 2 files changed, 101 insertions(+), 75 deletions(-) diff --git a/xorg-server-walk_drivers.diff b/xorg-server-walk_drivers.diff index ba78d97..dc5fcbe 100644 --- a/xorg-server-walk_drivers.diff +++ b/xorg-server-walk_drivers.diff @@ -1,97 +1,123 @@ ---- hw/xfree86/common/xf86AutoConfig.c -+++ hw/xfree86/common/xf86AutoConfig.c -@@ -539,34 +541,13 @@ - } +commit 4da6cffa8b6169595ea447cc53dfab857c04db04 +Author: h_root +Date: Thu Mar 25 18:32:04 2010 +0100 + + 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* --chooseVideoDriver(void) --{ -- char *chosen_driver = NULL; -- int i; -- 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]; -- -- 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]); -- } -- } -- -- return chosen_driver; --} -- ++ ++/* copy a screen section and enter the desired driver ++ * and insert it at i in the list of screens */ ++static Bool ++copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) ++{ ++ GDevPtr cptr = NULL; ++ ++ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); ++ if(!xf86ConfigLayout.screens[i].screen) ++ return FALSE; ++ memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec)); ++ ++ cptr = xcalloc(1, sizeof(GDevRec)); ++ if (!cptr) ++ return FALSE; ++ memcpy(cptr, odev, sizeof(GDevRec)); ++ ++ cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver); ++ cptr->driver = driver; ++ ++ /* now associate the new driver entry with the new screen entry */ ++ xf86ConfigLayout.screens[i].screen->device = cptr; ++ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; ++ ++ return TRUE; ++} ++ GDevPtr autoConfigDevice(GDevPtr preconf_device) { -- GDevPtr ptr = NULL; -+ GDevPtr ptr = NULL, cptr = NULL; + GDevPtr ptr = NULL; + char *matches[20]; /* If we have more than 20 drivers we're in trouble */ + int num_matches = 0, num_screens = 0, i; + screenLayoutPtr slp; if (!xf86configptr) { return NULL; -@@ -589,14 +571,49 @@ +@@ -573,14 +604,59 @@ autoConfigDevice(GDevPtr preconf_device) ptr->driver = NULL; } if (!ptr->driver) { - ptr->driver = chooseVideoDriver(); -+ listPossibleVideoDrivers(matches, 20); -+ for (; matches[num_matches] ; num_matches++); -+ slp = xf86ConfigLayout.screens; -+ if (slp) { -+ for (; slp[num_screens].screen ; num_screens++); -+ xf86ConfigLayout.screens = xnfcalloc(1,(num_screens+num_matches+1) * sizeof(screenLayoutRec)); -+ xf86ConfigLayout.screens[0] = slp[0]; -+ } -+ for (i=0; idriver = matches[0]; -+ if (slp && !xf86ConfigLayout.screens[0].screen->device) { -+ xf86ConfigLayout.screens[0].screen->device = ptr; -+ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; -+ } -+ } else { -+ if (slp) { -+ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); -+ if(!xf86ConfigLayout.screens[i].screen) -+ return NULL; -+ memcpy(xf86ConfigLayout.screens[i].screen, slp[0].screen, sizeof(confScreenRec)); -+ } -+ cptr = xcalloc(1, sizeof(GDevRec)); -+ if (!cptr) -+ return NULL; -+ memcpy(cptr, ptr, sizeof(GDevRec)); -+ cptr->identifier = xnfcalloc(1,strlen("Autoconfigured Video Device ")+strlen(matches[i])+1); -+ sprintf(cptr->identifier, "Autoconfigured Video Device %s", matches[i]); -+ cptr->driver = matches[i]; -+ if (slp) { -+ xf86ConfigLayout.screens[i].screen->device = cptr; -+ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; -+ } -+ } -+ } -+ for (i=1;idriver = matches[0]; ++ if (!xf86ConfigLayout.screens[0].screen->device) { ++ xf86ConfigLayout.screens[0].screen->device = ptr; ++ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; ++ } ++ ++ /* for each other driver found, copy the first screen, insert it ++ * into the list of screens and set the driver */ ++ i = 0; ++ while (i++ < num_matches) { ++ if (!copyScreen(slp[0].screen, ptr, i, matches[i])) ++ return NULL; ++ } - /* TODO Handle multiple screen sections */ - if (xf86ConfigLayout.screens && !xf86ConfigLayout.screens->screen->device) { - xf86ConfigLayout.screens->screen->device = ptr; - ptr->myScreenSection = xf86ConfigLayout.screens->screen; -- } -+ /* TODO Handle rest of multiple screen sections */ ++ /* shift the rest of the original screen list ++ * to the end of the current screen list ++ * ++ * 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"); return ptr; diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2d5b0ed..976f69a 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -229,7 +229,7 @@ popd %patch132 -p1 %patch143 -p0 %patch145 -p0 -%patch146 -p0 +%patch146 -p1 %patch147 -p1 %patch162 -p1 %if %moblin From fe179e89e10fd56932c1112f35bc4daca494911dbc20819a5c9197ab9e6dfaed Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Fri, 26 Mar 2010 01:46:16 +0000 Subject: [PATCH 2/4] =?UTF-8?q?-=20xorg-server-walk=5Fdrivers.diff:=20=20?= =?UTF-8?q?=20*=20updated=20patch=20working=20more=20cleanly,=20fixed=20co?= =?UTF-8?q?ding=20style,=20added=20=20=20=20=20comments=20(R=C3=BCdiger=20?= =?UTF-8?q?Oerttel)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=236 --- xorg-x11-server.changes | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 126ad89..9eddabe 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +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 From b176db455166467f11c85d6f2ab5cf230269886f1e3ec756ad28e34aac4e4cf7 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 26 Mar 2010 15:22:05 +0000 Subject: [PATCH 3/4] 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 --- xorg-server-walk_drivers.diff | 174 +++++++++++++++------------------- xorg-x11-server.changes | 7 -- xorg-x11-server.spec | 2 +- 3 files changed, 75 insertions(+), 108 deletions(-) diff --git a/xorg-server-walk_drivers.diff b/xorg-server-walk_drivers.diff index dc5fcbe..ba78d97 100644 --- a/xorg-server-walk_drivers.diff +++ b/xorg-server-walk_drivers.diff @@ -1,123 +1,97 @@ -commit 4da6cffa8b6169595ea447cc53dfab857c04db04 -Author: h_root -Date: Thu Mar 25 18:32:04 2010 +0100 - - 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; +--- hw/xfree86/common/xf86AutoConfig.c ++++ hw/xfree86/common/xf86AutoConfig.c +@@ -539,34 +541,13 @@ + } } -+ -+/* copy a screen section and enter the desired driver -+ * and insert it at i in the list of screens */ -+static Bool -+copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) -+{ -+ GDevPtr cptr = NULL; -+ -+ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); -+ if(!xf86ConfigLayout.screens[i].screen) -+ return FALSE; -+ memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec)); -+ -+ cptr = xcalloc(1, sizeof(GDevRec)); -+ if (!cptr) -+ return FALSE; -+ memcpy(cptr, odev, sizeof(GDevRec)); -+ -+ cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver); -+ cptr->driver = driver; -+ -+ /* now associate the new driver entry with the new screen entry */ -+ xf86ConfigLayout.screens[i].screen->device = cptr; -+ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; -+ -+ return TRUE; -+} -+ +-static char* +-chooseVideoDriver(void) +-{ +- char *chosen_driver = NULL; +- int i; +- 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]; +- +- 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]); +- } +- } +- +- return chosen_driver; +-} +- GDevPtr 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 */ + int num_matches = 0, num_screens = 0, i; + screenLayoutPtr slp; if (!xf86configptr) { return NULL; -@@ -573,14 +604,59 @@ autoConfigDevice(GDevPtr preconf_device) +@@ -589,14 +571,49 @@ ptr->driver = NULL; } if (!ptr->driver) { - ptr->driver = chooseVideoDriver(); -- } -+ /* get all possible video drivers and count them */ -+ listPossibleVideoDrivers(matches, 20); -+ for (; matches[num_matches]; num_matches++) { -+ xf86Msg(X_DEFAULT, "Matched %s as autoconfigured driver %d\n", -+ matches[num_matches], num_matches); -+ } -+ -+ slp = xf86ConfigLayout.screens; -+ if (slp) { -+ /* count the number of screens and make space for -+ * a new screen for each additional possible driver -+ * minus one for the already existing first one -+ * plus one for the terminating NULL */ -+ for (; slp[num_screens].screen; num_screens++); -+ xf86ConfigLayout.screens = xnfcalloc(num_screens + num_matches, -+ sizeof(screenLayoutRec)); -+ xf86ConfigLayout.screens[0] = slp[0]; -+ -+ /* do the first match and set that for the original first screen */ -+ ptr->driver = matches[0]; -+ if (!xf86ConfigLayout.screens[0].screen->device) { -+ xf86ConfigLayout.screens[0].screen->device = ptr; -+ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; -+ } -+ -+ /* for each other driver found, copy the first screen, insert it -+ * into the list of screens and set the driver */ -+ i = 0; -+ while (i++ < num_matches) { -+ if (!copyScreen(slp[0].screen, ptr, i, matches[i])) -+ return NULL; -+ } ++ listPossibleVideoDrivers(matches, 20); ++ for (; matches[num_matches] ; num_matches++); ++ slp = xf86ConfigLayout.screens; ++ if (slp) { ++ for (; slp[num_screens].screen ; num_screens++); ++ xf86ConfigLayout.screens = xnfcalloc(1,(num_screens+num_matches+1) * sizeof(screenLayoutRec)); ++ xf86ConfigLayout.screens[0] = slp[0]; ++ } ++ for (i=0; idriver = matches[0]; ++ if (slp && !xf86ConfigLayout.screens[0].screen->device) { ++ xf86ConfigLayout.screens[0].screen->device = ptr; ++ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; ++ } ++ } else { ++ if (slp) { ++ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); ++ if(!xf86ConfigLayout.screens[i].screen) ++ return NULL; ++ memcpy(xf86ConfigLayout.screens[i].screen, slp[0].screen, sizeof(confScreenRec)); ++ } ++ cptr = xcalloc(1, sizeof(GDevRec)); ++ if (!cptr) ++ return NULL; ++ memcpy(cptr, ptr, sizeof(GDevRec)); ++ cptr->identifier = xnfcalloc(1,strlen("Autoconfigured Video Device ")+strlen(matches[i])+1); ++ sprintf(cptr->identifier, "Autoconfigured Video Device %s", matches[i]); ++ cptr->driver = matches[i]; ++ if (slp) { ++ xf86ConfigLayout.screens[i].screen->device = cptr; ++ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; ++ } ++ } ++ } ++ for (i=1;iscreen->device) { - xf86ConfigLayout.screens->screen->device = ptr; - 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 */ -+ 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]); -+ } -+ } -+ } - } -+ +- } ++ /* TODO Handle rest of multiple screen sections */ xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n"); return ptr; diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 9eddabe..126ad89 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -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 diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 976f69a..2d5b0ed 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -229,7 +229,7 @@ popd %patch132 -p1 %patch143 -p0 %patch145 -p0 -%patch146 -p1 +%patch146 -p0 %patch147 -p1 %patch162 -p1 %if %moblin From 9d61579fe26684190ea064997649468896f8331bfb2a4d8fe09ac058d28e1ccd Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Fri, 26 Mar 2010 15:22:08 +0000 Subject: [PATCH 4/4] Updating link to change in openSUSE:Factory/xorg-x11-server revision 159.0 OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=ff0e53802bf053af91ac8295d5f61bce --- xorg-server-walk_drivers.diff | 174 +++++++++++++++++++--------------- xorg-x11-server.changes | 7 ++ xorg-x11-server.spec | 4 +- 3 files changed, 109 insertions(+), 76 deletions(-) diff --git a/xorg-server-walk_drivers.diff b/xorg-server-walk_drivers.diff index ba78d97..dc5fcbe 100644 --- a/xorg-server-walk_drivers.diff +++ b/xorg-server-walk_drivers.diff @@ -1,97 +1,123 @@ ---- hw/xfree86/common/xf86AutoConfig.c -+++ hw/xfree86/common/xf86AutoConfig.c -@@ -539,34 +541,13 @@ - } +commit 4da6cffa8b6169595ea447cc53dfab857c04db04 +Author: h_root +Date: Thu Mar 25 18:32:04 2010 +0100 + + 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* --chooseVideoDriver(void) --{ -- char *chosen_driver = NULL; -- int i; -- 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]; -- -- 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]); -- } -- } -- -- return chosen_driver; --} -- ++ ++/* copy a screen section and enter the desired driver ++ * and insert it at i in the list of screens */ ++static Bool ++copyScreen(confScreenPtr oscreen, GDevPtr odev, int i, char *driver) ++{ ++ GDevPtr cptr = NULL; ++ ++ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); ++ if(!xf86ConfigLayout.screens[i].screen) ++ return FALSE; ++ memcpy(xf86ConfigLayout.screens[i].screen, oscreen, sizeof(confScreenRec)); ++ ++ cptr = xcalloc(1, sizeof(GDevRec)); ++ if (!cptr) ++ return FALSE; ++ memcpy(cptr, odev, sizeof(GDevRec)); ++ ++ cptr->identifier = Xprintf("Autoconfigured Video Device %s", driver); ++ cptr->driver = driver; ++ ++ /* now associate the new driver entry with the new screen entry */ ++ xf86ConfigLayout.screens[i].screen->device = cptr; ++ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; ++ ++ return TRUE; ++} ++ GDevPtr autoConfigDevice(GDevPtr preconf_device) { -- GDevPtr ptr = NULL; -+ GDevPtr ptr = NULL, cptr = NULL; + GDevPtr ptr = NULL; + char *matches[20]; /* If we have more than 20 drivers we're in trouble */ + int num_matches = 0, num_screens = 0, i; + screenLayoutPtr slp; if (!xf86configptr) { return NULL; -@@ -589,14 +571,49 @@ +@@ -573,14 +604,59 @@ autoConfigDevice(GDevPtr preconf_device) ptr->driver = NULL; } if (!ptr->driver) { - ptr->driver = chooseVideoDriver(); -+ listPossibleVideoDrivers(matches, 20); -+ for (; matches[num_matches] ; num_matches++); -+ slp = xf86ConfigLayout.screens; -+ if (slp) { -+ for (; slp[num_screens].screen ; num_screens++); -+ xf86ConfigLayout.screens = xnfcalloc(1,(num_screens+num_matches+1) * sizeof(screenLayoutRec)); -+ xf86ConfigLayout.screens[0] = slp[0]; -+ } -+ for (i=0; idriver = matches[0]; -+ if (slp && !xf86ConfigLayout.screens[0].screen->device) { -+ xf86ConfigLayout.screens[0].screen->device = ptr; -+ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; -+ } -+ } else { -+ if (slp) { -+ xf86ConfigLayout.screens[i].screen = xnfcalloc(1, sizeof(confScreenRec)); -+ if(!xf86ConfigLayout.screens[i].screen) -+ return NULL; -+ memcpy(xf86ConfigLayout.screens[i].screen, slp[0].screen, sizeof(confScreenRec)); -+ } -+ cptr = xcalloc(1, sizeof(GDevRec)); -+ if (!cptr) -+ return NULL; -+ memcpy(cptr, ptr, sizeof(GDevRec)); -+ cptr->identifier = xnfcalloc(1,strlen("Autoconfigured Video Device ")+strlen(matches[i])+1); -+ sprintf(cptr->identifier, "Autoconfigured Video Device %s", matches[i]); -+ cptr->driver = matches[i]; -+ if (slp) { -+ xf86ConfigLayout.screens[i].screen->device = cptr; -+ cptr->myScreenSection = xf86ConfigLayout.screens[i].screen; -+ } -+ } -+ } -+ for (i=1;idriver = matches[0]; ++ if (!xf86ConfigLayout.screens[0].screen->device) { ++ xf86ConfigLayout.screens[0].screen->device = ptr; ++ ptr->myScreenSection = xf86ConfigLayout.screens[0].screen; ++ } ++ ++ /* for each other driver found, copy the first screen, insert it ++ * into the list of screens and set the driver */ ++ i = 0; ++ while (i++ < num_matches) { ++ if (!copyScreen(slp[0].screen, ptr, i, matches[i])) ++ return NULL; ++ } - /* TODO Handle multiple screen sections */ - if (xf86ConfigLayout.screens && !xf86ConfigLayout.screens->screen->device) { - xf86ConfigLayout.screens->screen->device = ptr; - ptr->myScreenSection = xf86ConfigLayout.screens->screen; -- } -+ /* TODO Handle rest of multiple screen sections */ ++ /* shift the rest of the original screen list ++ * to the end of the current screen list ++ * ++ * 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"); return ptr; diff --git a/xorg-x11-server.changes b/xorg-x11-server.changes index 126ad89..52f2f6f 100644 --- a/xorg-x11-server.changes +++ b/xorg-x11-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +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 Oertel) + ------------------------------------------------------------------- Wed Mar 24 17:05:53 CET 2010 - sndirsch@suse.de diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 2d5b0ed..58f3e6d 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -35,7 +35,7 @@ BuildRequires: libjpeg-devel Url: http://xorg.freedesktop.org/ %define EXPERIMENTAL 0 Version: 7.5_%{dirsuffix} -Release: 1 +Release: 2 License: GPLv2+ ; MIT License (or similar) BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: System/X11/Servers/XF86_4 @@ -229,7 +229,7 @@ popd %patch132 -p1 %patch143 -p0 %patch145 -p0 -%patch146 -p0 +%patch146 -p1 %patch147 -p1 %patch162 -p1 %if %moblin