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@nokia.com>
This commit is contained in:
Tiago Vignatti 2009-07-24 13:47:31 +03:00
parent c09779f95a
commit c553161e17
9 changed files with 6 additions and 155 deletions

View File

@ -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);

View File

@ -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 */

View File

@ -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;

View File

@ -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;
}

View File

@ -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");

View File

@ -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;

View File

@ -401,11 +401,6 @@ xf86MatchSbusInstances(const char *driverName, int sbusDevId,
return 0;
}
if (xf86DoProbe) {
xfree(instances);
return numFound;
}
if (sparcPromInit() >= 0)
useProm = 1;

View File

@ -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.

View File

@ -218,7 +218,7 @@ xf86CloseConsole(void)
#if !defined(__i386__) && !defined(__i386) && !defined(__x86)
if (!xf86DoProbe && !xf86DoConfigure) {
if (!xf86DoConfigure) {
int fd;
/*