1
0

Accepting request 35601 from home:oertel:branches:openSUSE:Factory

Copy from home:oertel:branches:openSUSE:Factory/xorg-x11-server via accept of submit request 35601 revision 20.
Request was accepted with message:
reviewed ok.

OBS-URL: https://build.opensuse.org/request/show/35601
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=232
This commit is contained in:
Stefan Dirsch 2010-03-24 01:56:12 +00:00 committed by Git OBS Bridge
parent cabf4536a5
commit 61bd29bfd3
2 changed files with 90 additions and 122 deletions

View File

@ -1,136 +1,97 @@
--- hw/xfree86/common/xf86AutoConfig.c --- hw/xfree86/common/xf86AutoConfig.c
+++ hw/xfree86/common/xf86AutoConfig.c +++ hw/xfree86/common/xf86AutoConfig.c
@@ -541,22 +541,32 @@ @@ -539,34 +541,13 @@
static char* }
chooseVideoDriver(void) }
{
-static char*
-chooseVideoDriver(void)
-{
- char *chosen_driver = NULL; - char *chosen_driver = NULL;
- int i; - int i;
+ char *chosen_driver = NULL, *match_driver; - char *matches[20]; /* If we have more than 20 drivers we're in trouble */
+ int i, len = 0; -
char *matches[20]; /* If we have more than 20 drivers we're in trouble */ - listPossibleVideoDrivers(matches, 20);
-
listPossibleVideoDrivers(matches, 20);
- /* TODO Handle multiple drivers claiming to support the same PCI ID */ - /* TODO Handle multiple drivers claiming to support the same PCI ID */
- chosen_driver = matches[0]; - chosen_driver = matches[0];
+ for (i = 0; matches[i] ; i++) { -
+ len += strlen(matches[i])+1; - xf86Msg(X_DEFAULT, "Matched %s for the autoconfigured driver\n",
+ } - chosen_driver);
+ -
+ chosen_driver = (char*)xalloc(len); - for (i = 0; matches[i] ; i++) {
+ 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) { - if (matches[i] != chosen_driver) {
- xfree(matches[i]); - xfree(matches[i]);
- } - }
+ xfree(matches[i]); - }
} -
- return chosen_driver;
return chosen_driver; -}
--- hw/xfree86/common/xf86Config.c -
+++ hw/xfree86/common/xf86Config.c GDevPtr
@@ -381,6 +381,7 @@ autoConfigDevice(GDevPtr preconf_device)
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; - GDevPtr ptr = NULL;
confScreenPtr screensecptr; + GDevPtr ptr = NULL, cptr = NULL;
+ char *screendriver, *screendriver_next; + char *matches[20]; /* If we have more than 20 drivers we're in trouble */
int i,j; + int num_matches = 0, num_screens = 0, i;
+ screenLayoutPtr slp;
if (sectlist) if (!xf86configptr) {
@@ -1489,15 +1490,31 @@ return NULL;
*/ @@ -589,14 +571,49 @@
for (j=0; xf86ConfigLayout.screens[j].screen != NULL; j++) { ptr->driver = NULL;
screensecptr = xf86ConfigLayout.screens[j].screen; }
- if ((screensecptr->device->driver != NULL) if (!ptr->driver) {
- && (xf86NameCmp( screensecptr->device->driver,drivername) == 0) - ptr->driver = chooseVideoDriver();
- && (! screensecptr->device->claimed)) { + listPossibleVideoDrivers(matches, 20);
- /* + for (; matches[num_matches] ; num_matches++);
- * we have a matching driver that wasn't claimed, yet + slp = xf86ConfigLayout.screens;
- */ + if (slp) {
- pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); + for (; slp[num_screens].screen ; num_screens++);
- pgdp[i++] = screensecptr->device; + xf86ConfigLayout.screens = xnfcalloc(1,(num_screens+num_matches+1) * sizeof(screenLayoutRec));
+ screendriver = screensecptr->device->driver; + xf86ConfigLayout.screens[0] = slp[0];
+ 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;
+ } + }
+ + for (i=0; i<num_matches;i++) {
+ if (i==0) {
+ ptr->driver = 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;i<num_screens;i++) {
+ xf86ConfigLayout.screens[i+num_matches] = slp[i];
+ }
+ xf86ConfigLayout.screens[num_screens+num_matches].screen = NULL;
+ xfree(slp);
} }
/* Then handle the inactive devices */ - /* 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 */
xf86Msg(X_DEFAULT, "Assigned the driver to the xf86ConfigLayout\n");
return ptr;

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 24 02:37:56 CET 2010 - ro@suse.de
- re-do xorg-server-walk_drivers.diff again, different approach
create screen sections for each possible drivers
now it is really using the first driver as in full autoconfig
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 23 14:10:59 CET 2010 - sndirsch@suse.de Tue Mar 23 14:10:59 CET 2010 - sndirsch@suse.de