xserver: Branch 'master' - 2 commits

Tiago Vignatti vignatti at kemper.freedesktop.org
Tue Jul 28 08:30:27 PDT 2009


 hw/xfree86/common/xf86.h                 |    2 
 hw/xfree86/common/xf86Configure.c        |    2 
 hw/xfree86/common/xf86Globals.c          |    3 
 hw/xfree86/common/xf86Helper.c           |   15 --
 hw/xfree86/common/xf86Init.c             |  220 -------------------------------
 hw/xfree86/common/xf86Priv.h             |    2 
 hw/xfree86/common/xf86sbusBus.c          |    5 
 hw/xfree86/doc/man/Xorg.man.pre          |    9 -
 hw/xfree86/os-support/solaris/sun_init.c |    2 
 9 files changed, 6 insertions(+), 254 deletions(-)

New commits:
commit c553161e17ebc577ecb91ec6c81f0bdd0ae85e13
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Fri Jul 24 13:47:31 2009 +0300

    xfree86: delete devices probe code (-probe and -probeonly options)
    
    Inside a windowing system, it's not the place to probe for devices. Goodbye
    -probe and -probeonly.
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 2cf3e04..51c91a2 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -249,7 +249,6 @@ extern _X_EXPORT Bool xf86ServerIsExiting(void);
 extern _X_EXPORT Bool xf86ServerIsResetting(void);
 extern _X_EXPORT Bool xf86ServerIsInitialising(void);
 extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void);
-extern _X_EXPORT Bool xf86ServerIsOnlyProbing(void);
 extern _X_EXPORT Bool xf86CaughtSignal(void);
 extern _X_EXPORT Bool xf86GetVidModeAllowNonLocal(void);
 extern _X_EXPORT Bool xf86GetVidModeEnabled(void);
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 7d738d5..dd9551c 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -99,7 +99,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int
     struct pci_device * pVideo = NULL;
     Bool isPrimary = FALSE;
 
-    if (xf86DoProbe || !xf86DoConfigure || !xf86DoConfigurePass1)
+    if (!xf86DoConfigure || !xf86DoConfigurePass1)
 	return NULL;
 
     /* Check for duplicates */
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 140e380..df0470c 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -150,7 +150,6 @@ confDRIRec xf86ConfigDRI = {0, };
 XF86ConfigPtr xf86configptr = NULL;
 Bool xf86Resetting = FALSE;
 Bool xf86Initialising = FALSE;
-Bool xf86DoProbe = FALSE;
 Bool xf86DoConfigure = FALSE;
 Bool xf86DoShowOptions = FALSE;
 DriverPtr *xf86DriverList = NULL;
@@ -183,7 +182,6 @@ char *xf86LayoutName = NULL;
 char *xf86ScreenName = NULL;
 char *xf86PointerName = NULL;
 char *xf86KeyboardName = NULL;
-Bool xf86ProbeOnly = FALSE;
 int xf86Verbose = DEFAULT_VERBOSE;
 int xf86LogVerbose = DEFAULT_LOG_VERBOSE;
 int xf86FbBpp = -1;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 2d43c79..4f659a1 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1445,8 +1445,6 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
     if (sectlist)
 	*sectlist = NULL;
 
-    if (xf86DoProbe) return 1;
-
     if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
 
     /*
@@ -1592,7 +1590,7 @@ xf86MatchPciInstances(const char *driverName, int vendorID,
      * Do this calculation and memory allocation once now to eliminate the
      * need for realloc calls inside the loop.
      */
-    if ( !xf86DoProbe && !(xf86DoConfigure && xf86DoConfigurePass1) ) {
+    if (!(xf86DoConfigure && xf86DoConfigurePass1)) {
 	unsigned max_entries = numDevs;
 
 	iter = pci_slot_match_iterator_create(NULL);
@@ -2095,14 +2093,7 @@ xf86ServerIsInitialising(void)
 Bool
 xf86ServerIsOnlyDetecting(void)
 {
-    return xf86DoProbe || xf86DoConfigure;
-}
-
-
-Bool
-xf86ServerIsOnlyProbing(void)
-{
-    return xf86ProbeOnly;
+    return xf86DoConfigure;
 }
 
 
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 75fc8bd..44eed4d 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -92,7 +92,6 @@
 /* forward declarations */
 static Bool probe_devices_from_device_sections(DriverPtr drvp);
 static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
-static Bool check_for_matching_devices(DriverPtr drvp);
 
 #ifdef XF86PM
 void (*xf86OSPMClose)(void) = NULL;
@@ -475,32 +474,6 @@ add_matching_devices_to_configure_list(DriverPtr drvp)
     return (numFound != 0);
 }
 
-
-Bool
-check_for_matching_devices(DriverPtr drvp)
-{
-    const struct pci_id_match * const devices = drvp->supported_devices;
-    int j;
-
-
-    for (j = 0; ! END_OF_MATCHES(devices[j]); j++) {
-	struct pci_device_iterator *iter;
-	struct pci_device *dev;
-
-	iter = pci_id_match_iterator_create(& devices[j]);
-	dev = pci_device_next(iter);
-	pci_iterator_destroy(iter);
-
-	if (dev != NULL) {
-	    return TRUE;
-	}
-    }
-
-
-    return FALSE;
-}
-
-
 /**
  * Call the driver's correct probe function.
  *
@@ -522,11 +495,7 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
     Bool     foundScreen = FALSE;
 
     if ( drv->PciProbe != NULL ) {
-	if ( xf86DoProbe ) {
-	    assert( detect_only );
-	    foundScreen = check_for_matching_devices( drv );
-	}
-	else if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
+	if ( xf86DoConfigure && xf86DoConfigurePass1 ) {
 	    assert( detect_only );
 	    foundScreen = add_matching_devices_to_configure_list( drv );
 	}
@@ -546,76 +515,6 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only )
     return foundScreen;
 }
 
-static void
-DoProbe(void)
-{
-    int i;
-    Bool probeResult;
-    Bool ioEnableFailed = FALSE;
-    
-    /* Find the list of video driver modules. */
-    char **list = xf86DriverlistFromCompile();
-    char **l;
-
-    if (list) {
-	ErrorF("List of video driver modules:\n");
-	for (l = list; *l; l++)
-	    ErrorF("\t%s\n", *l);
-    } else {
-	ErrorF("No video driver modules found\n");
-    }
-
-    /* Load all the drivers that were found. */
-    xf86LoadModules(list, NULL);
-
-    /* Disable PCI devices */
-    xf86AccessInit();
-
-    /* Call all of the probe functions, reporting the results. */
-    for (i = 0; i < xf86NumDrivers; i++) {
-	DriverRec * const drv = xf86DriverList[i];
-
-	if (!xorgHWAccess) {
-	    xorgHWFlags flags;
-	    if (!drv->driverFunc
-		|| !drv->driverFunc( NULL, GET_REQUIRED_HW_INTERFACES, &flags )
-		|| NEED_IO_ENABLED(flags)) {
-		if (ioEnableFailed)
-		    continue;
-		if (!xf86EnableIO()) {
-		    ioEnableFailed = TRUE;
-		    continue;
-		}
-		xorgHWAccess = TRUE;
-	    }
-	}
-	    
-
-	xf86MsgVerb(X_INFO, 3, "Probing in driver %s\n",  drv->driverName);
-
-	probeResult = xf86CallDriverProbe( drv, TRUE );
-	if (!probeResult) {
-	    xf86ErrorF("Probe in driver `%s' returns FALSE\n",
-		drv->driverName);
-	} else {
-	    xf86ErrorF("Probe in driver `%s' returns TRUE\n",
-		drv->driverName);
-
-	    /* If we have a result, then call driver's Identify function */
-	    if (drv->Identify != NULL) {
-		const int verbose = xf86SetVerbosity(1);
-		(*drv->Identify)(0);
-		xf86SetVerbosity(verbose);
-	    }
-	}
-    }
-
-    OsCleanup(TRUE);
-    AbortDDX();
-    fflush(stderr);
-    exit(0);
-}
-
 /*
  * InitOutput --
  *	Initialize screenInfo for all actually accessible framebuffers.
@@ -658,7 +557,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	}
 
     /* Read and parse the config file */
-    if (!xf86DoProbe && !xf86DoConfigure && !xf86DoShowOptions) {
+    if (!xf86DoConfigure && !xf86DoShowOptions) {
       switch (xf86HandleConfigFile(FALSE)) {
       case CONFIG_OK:
 	break;
@@ -691,9 +590,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     /* Do a general bus probe.  This will be a PCI probe for x86 platforms */
     xf86BusProbe();
 
-    if (xf86DoProbe)
-	DoProbe();
-
     if (xf86DoConfigure)
 	DoConfigure();
 
@@ -927,15 +823,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
       }
     }
 
-    /* XXX Should this be before or after loading dependent modules? */
-    if (xf86ProbeOnly)
-    {
-      OsCleanup(TRUE);
-      AbortDDX();
-      fflush(stderr);
-      exit(0);
-    }
-
     /* Remove (unload) drivers that are not required */
     for (i = 0; i < xf86NumDrivers; i++)
 	if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0)
@@ -951,7 +838,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     /*
      * Collect all pixmap formats and check for conflicts at the display
      * level.  Should we die here?  Or just delete the offending screens?
-     * Also, should this be done for -probeonly?
      */
     screenpix24 = Pix24DontCare;
     for (i = 0; i < xf86NumScreens; i++) {
@@ -1465,11 +1351,6 @@ ddxProcessArgument(int argc, char **argv, int i)
     xf86ConfigFile = argv[i + 1];
     return 2;
   }
-  if (!strcmp(argv[i],"-probeonly"))
-  {
-    xf86ProbeOnly = TRUE;
-    return 1;
-  }
   if (!strcmp(argv[i],"-flipPixels"))
   {
     xf86FlipPixels = TRUE;
@@ -1685,11 +1566,6 @@ ddxProcessArgument(int argc, char **argv, int i)
     return 1;
   }
 #endif
-  if (!strcmp(argv[i], "-probe"))
-  {
-    xf86DoProbe = TRUE;
-    return 1;
-  }
   if (!strcmp(argv[i], "-configure"))
   {
     if (getuid() != 0 && geteuid() == 0) {
@@ -1758,7 +1634,6 @@ ddxUseMsg(void)
   }
   ErrorF("-config file           specify a configuration file, relative to the\n");
   ErrorF("                       "__XCONFIGFILE__" search path, only root can use absolute\n");
-  ErrorF("-probeonly             probe for devices, then exit\n");
   ErrorF("-verbose [n]           verbose startup messages\n");
   ErrorF("-logverbose [n]        verbose log messages\n");
   ErrorF("-quiet                 minimal startup messages\n");
diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h
index dc35c7c..5ce4dbb 100644
--- a/hw/xfree86/common/xf86Priv.h
+++ b/hw/xfree86/common/xf86Priv.h
@@ -91,8 +91,6 @@ extern _X_EXPORT  int xf86NumScreens;
 extern _X_EXPORT  const char *xf86VisualNames[];
 extern _X_EXPORT  int xf86Verbose;                 /* verbosity level */
 extern _X_EXPORT  int xf86LogVerbose;		/* log file verbosity level */
-extern _X_EXPORT  Bool xf86ProbeOnly;
-extern _X_EXPORT  Bool xf86DoProbe;
 extern _X_EXPORT  Bool xorgHWAccess;
 
 extern _X_EXPORT  RootWinPropPtr *xf86RegisteredPropertiesTable;
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index 7044284..7b23233 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -401,11 +401,6 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
 	return 0;
     }
 
-    if (xf86DoProbe) {
-	xfree(instances);
-	return numFound;
-    }
-
     if (sparcPromInit() >= 0)
 	useProm = 1;
 
diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre
index ce61fdd..ac48979 100644
--- a/hw/xfree86/doc/man/Xorg.man.pre
+++ b/hw/xfree86/doc/man/Xorg.man.pre
@@ -352,11 +352,6 @@ section and this option, the first relevant
 .B InputDevice
 section is used for the core pointer.
 .TP 8
-.B \-probeonly
-Causes the server to exit after the device probing stage.  The
-__xconfigfile__(__filemansuffix__) file is still used when this option is
-given, so information that can be auto-detected should be commented out.
-.TP 8
 .B \-quiet
 Suppress most informational messages at startup.  The verbosity level
 is set to zero.
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index 795b0c1..2889f19 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -218,7 +218,7 @@ xf86CloseConsole(void)
 
 #if !defined(__i386__) && !defined(__i386) && !defined(__x86)
 
-    if (!xf86DoProbe && !xf86DoConfigure) {
+    if (!xf86DoConfigure) {
 	int fd;
 
 	/*
commit c09779f95a9772c0556760222dfc570dbaf8a28e
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Fri Jul 24 13:37:31 2009 +0300

    xfree86: delete stupid video driver dump (-modalias option)
    
    Such stupid and ugly way to dump PCI information! Oh boy... Anyway, this
    doesn't belong to the X server at all. Go away!
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>

diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index a17e0b1..2cf3e04 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -56,7 +56,6 @@
 /* General parameters */
 extern _X_EXPORT int xf86DoConfigure;
 extern _X_EXPORT int xf86DoShowOptions;
-extern _X_EXPORT Bool xf86DoModalias;
 extern _X_EXPORT Bool xf86DoConfigurePass1;
 extern _X_EXPORT DevPrivateKey xf86ScreenKey;
 extern _X_EXPORT DevPrivateKey xf86CreateRootWindowKey;
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index 7bcbc94..140e380 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -153,7 +153,6 @@ Bool xf86Initialising = FALSE;
 Bool xf86DoProbe = FALSE;
 Bool xf86DoConfigure = FALSE;
 Bool xf86DoShowOptions = FALSE;
-Bool xf86DoModalias = FALSE;
 DriverPtr *xf86DriverList = NULL;
 int xf86NumDrivers = 0;
 InputDriverPtr *xf86InputDriverList = NULL;
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 965bd5e..2d43c79 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -1445,8 +1445,6 @@ xf86MatchDevice(const char *drivername, GDevPtr **sectlist)
     if (sectlist)
 	*sectlist = NULL;
 
-    if (xf86DoModalias) return 0;
-
     if (xf86DoProbe) return 1;
 
     if (xf86DoConfigure && xf86DoConfigurePass1) return 1;
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index cea17ee..75fc8bd 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -228,84 +228,6 @@ xf86PrintMarkers(void)
   LogPrintMarkers();
 }
 
-static void
-DoModalias(void)
-{
-    int i = -1;
-    char **vlist;
-
-    /* Get all the drivers */
-    vlist = xf86DriverlistFromCompile();
-    if (!vlist) {
-	ErrorF("Missing output drivers.  PCI Access dump failed.\n");
-	goto bail;
-    }
-
-    /* Load all the drivers that were found. */
-    xf86LoadModules(vlist, NULL);
-
-    xfree(vlist);
-
-    /* Iterate through each driver */
-    for (i = 0; i < xf86NumDrivers; i++) {
-        struct pci_id_match *match;
-
-        /* Iterate through each pci id match data, dumping it to the screen */
-        for (match = (struct pci_id_match *) xf86DriverList[i]->supported_devices ;
-                 match && !(!match->vendor_id && !match->device_id) ; match++) {
-             /* Prefix */
-             ErrorF("alias pci:");
-
-             /* Vendor */
-             if (match->vendor_id == ~0)
-                 ErrorF("v*");
-             else
-                 ErrorF("v%08X", match->vendor_id);
-
-             /* Device */
-             if (match->device_id == ~0)
-                 ErrorF("d*");
-             else
-                 ErrorF("d%08X", match->device_id);
-
-             /* Subvendor */
-             if (match->subvendor_id == ~0)
-                 ErrorF("sv*");
-             else
-                 ErrorF("sv%08X", match->subvendor_id);
-
-             /* Subdevice */
-             if (match->subdevice_id == ~0)
-                 ErrorF("sd*");
-             else
-                 ErrorF("sd%08X", match->subdevice_id);
-
-             /* Class */
-             if ((match->device_class_mask >> 16 & 0xFF) == 0xFF)
-                 ErrorF("bc%02X", match->device_class >> 16 & 0xFF);
-             else
-                 ErrorF("bc*");
-             if ((match->device_class_mask >> 8 & 0xFF) == 0xFF)
-                 ErrorF("sc%02X", match->device_class >> 8 & 0xFF);
-             else
-                 ErrorF("sc*");
-             if ((match->device_class_mask & 0xFF) == 0xFF)
-                 ErrorF("i%02X*", match->device_class & 0xFF);
-             else
-                 ErrorF("i*");
-
-             /* Suffix (driver) */
-             ErrorF(" %s\n", xf86DriverList[i]->driverName);
-        }
-    }
-
-bail:
-    OsCleanup(TRUE);
-    AbortDDX();
-    fflush(stderr);
-    exit(0);
-}
-
 static Bool
 xf86CreateRootWindow(WindowPtr pWin)
 {
@@ -724,7 +646,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     else
       xf86ServerName = argv[0];
 
-    if (!xf86DoModalias) {
 	xf86PrintBanner();
 	xf86PrintMarkers();
 	if (xf86LogFile)  {
@@ -735,10 +656,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
 	    xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s",
 			xf86LogFile, ct);
 	}
-    }
 
     /* Read and parse the config file */
-    if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias && !xf86DoShowOptions) {
+    if (!xf86DoProbe && !xf86DoConfigure && !xf86DoShowOptions) {
       switch (xf86HandleConfigFile(FALSE)) {
       case CONFIG_OK:
 	break;
@@ -777,10 +697,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv)
     if (xf86DoConfigure)
 	DoConfigure();
 
-    /* Do the PCI Access dump */
-    if (xf86DoModalias)
-        DoModalias();
-
     if (autoconfig) {
 	if (!xf86AutoConfig()) {
 	    xf86Msg(X_ERROR, "Auto configuration failed\n");
@@ -1784,12 +1700,6 @@ ddxProcessArgument(int argc, char **argv, int i)
     xf86AllowMouseOpenFail = TRUE;
     return 1;
   }
-  if (!strcmp(argv[i], "-modalias"))
-  {
-    xf86DoModalias = TRUE;
-    xf86AllowMouseOpenFail = TRUE;
-    return 1;
-  }
   if (!strcmp(argv[i], "-showopts"))
   {
     if (getuid() != 0 && geteuid() == 0) {
@@ -1846,7 +1756,6 @@ ddxUseMsg(void)
     ErrorF("-configure             probe for devices and write an "__XCONFIGFILE__"\n");
     ErrorF("-showopts              print available options for all installed drivers\n");
   }
-  ErrorF("-modalias              output a modalias-style filter for each driver installed\n");
   ErrorF("-config file           specify a configuration file, relative to the\n");
   ErrorF("                       "__XCONFIGFILE__" search path, only root can use absolute\n");
   ErrorF("-probeonly             probe for devices, then exit\n");
diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre
index e0db086..ce61fdd 100644
--- a/hw/xfree86/doc/man/Xorg.man.pre
+++ b/hw/xfree86/doc/man/Xorg.man.pre
@@ -313,10 +313,6 @@ file verbosity level.  When the
 value is supplied, the log file verbosity level is set to that value.
 The default log file verbosity level is 3.
 .TP 8
-.B \-modalias
-Print a list of device ids each installed driver module claims to support,
-in a format similar to Linux modalias.
-.TP 8
 .BI \-modulepath " searchpath"
 Set the module search path to
 .IR searchpath .


More information about the xorg-commit mailing list