View | Details | Raw Unified | Return to bug 137374
Collapse All | Expand All

(-)xf86.h (+1 lines)
Lines 53-58 Link Here
53
53
54
/* General parameters */
54
/* General parameters */
55
extern int xf86DoConfigure;
55
extern int xf86DoConfigure;
56
extern int xf86DoShowOptions;
56
extern Bool xf86DoConfigurePass1;
57
extern Bool xf86DoConfigurePass1;
57
extern int xf86ScreenIndex;		/* Index into pScreen.devPrivates */
58
extern int xf86ScreenIndex;		/* Index into pScreen.devPrivates */
58
extern int xf86CreateRootWindowIndex;	/* Index into pScreen.devPrivates */
59
extern int xf86CreateRootWindowIndex;	/* Index into pScreen.devPrivates */
(-)xf86Configure.c (+51 lines)
Lines 771-776 Link Here
771
    return ptr;
771
    return ptr;
772
}
772
}
773
773
774
void DoShowOptions (void) {
775
	int  i = 0;
776
	char **vlist  = 0;
777
	char *pSymbol = 0;
778
	XF86ModuleData *initData = 0;
779
	if (! (vlist = xf86DriverlistFromCompile())) {
780
		ErrorF("Missing output drivers\n");
781
		goto bail;
782
	}
783
	xf86LoadModules (vlist,0);
784
	xfree (vlist);
785
	for (i = 0; i < xf86NumDrivers; i++) {
786
		if (xf86DriverList[i]->AvailableOptions) {
787
			OptionInfoPtr pOption = (OptionInfoPtr)(*xf86DriverList[i]->AvailableOptions)(0,0);
788
			if (! pOption) {
789
				ErrorF ("(EE) Couldn't read option table for %s driver\n",
790
					xf86DriverList[i]->driverName
791
				);
792
				continue;                                                       
793
			}
794
			pSymbol = xalloc (
795
				strlen(xf86DriverList[i]->driverName) + strlen("ModuleData") + 1
796
			);
797
			strcpy (pSymbol, xf86DriverList[i]->driverName);
798
			strcat (pSymbol, "ModuleData");
799
			initData = LoaderSymbol (pSymbol);
800
			if (initData) {
801
				XF86ModuleVersionInfo *vers = initData->vers;
802
				ErrorF ("Driver: %d:%s [%s]\n",
803
					i,xf86DriverList[i]->driverName,vers->vendor
804
				);
805
				OptionInfoPtr p;
806
				for (p = pOption; p->name != NULL; p++) {
807
					const char *opttype = optionTypeToSting(p->type);
808
					char *optname = xalloc(strlen(p->name) + 2 + 1);
809
					if (!optname) {
810
						continue;                      
811
					}
812
					sprintf(optname, "\"%s\"", p->name);
813
					ErrorF ("\t%s %s\n", optname,opttype);
814
				}
815
			}
816
		}
817
	}
818
	bail:
819
	OsCleanup (TRUE);                             
820
	AbortDDX ();                                                           
821
	fflush (stderr);                        
822
	exit (0);
823
}
824
774
void
825
void
775
DoConfigure()
826
DoConfigure()
776
{
827
{
(-)xf86Globals.c (+1 lines)
Lines 189-194 Link Here
189
Bool xf86ProbeFailed = FALSE;
189
Bool xf86ProbeFailed = FALSE;
190
Bool xf86DoProbe = FALSE;
190
Bool xf86DoProbe = FALSE;
191
Bool xf86DoConfigure = FALSE;
191
Bool xf86DoConfigure = FALSE;
192
Bool xf86DoShowOptions = FALSE;
192
#ifdef XFree86LOADER
193
#ifdef XFree86LOADER
193
DriverPtr *xf86DriverList = NULL;
194
DriverPtr *xf86DriverList = NULL;
194
int xf86NumDrivers = 0;
195
int xf86NumDrivers = 0;
(-)xf86Init.c (-1 / +14 lines)
Lines 323-329 Link Here
323
    }
323
    }
324
324
325
    /* Read and parse the config file */
325
    /* Read and parse the config file */
326
    if (!xf86DoProbe && !xf86DoConfigure) {
326
    if (!xf86DoProbe && !xf86DoConfigure && !xf86DoShowOptions) {
327
      switch (xf86HandleConfigFile(FALSE)) {
327
      switch (xf86HandleConfigFile(FALSE)) {
328
      case CONFIG_OK:
328
      case CONFIG_OK:
329
	break;
329
	break;
Lines 385-390 Link Here
385
    
385
    
386
#endif
386
#endif
387
387
388
	if (xf86DoShowOptions)        
389
	DoShowOptions();
390
388
    xf86OpenConsole();
391
    xf86OpenConsole();
389
392
390
    /* Do a general bus probe.  This will be a PCI probe for x86 platforms */
393
    /* Do a general bus probe.  This will be a PCI probe for x86 platforms */
Lines 1687-1692 Link Here
1687
    xf86AllowMouseOpenFail = TRUE;
1690
    xf86AllowMouseOpenFail = TRUE;
1688
    return 1;
1691
    return 1;
1689
  }
1692
  }
1693
  if (!strcmp(argv[i], "-showopts"))
1694
  {
1695
    if (getuid() != 0 && geteuid == 0) {
1696
    ErrorF("The '-showopts' option can only be used by root.\n");
1697
    exit(1);
1698
    }
1699
    xf86DoShowOptions = TRUE;
1700
    return 1;
1701
  }
1690
  if (!strcmp(argv[i], "-isolateDevice"))
1702
  if (!strcmp(argv[i], "-isolateDevice"))
1691
  {
1703
  {
1692
    int bus, device, func;
1704
    int bus, device, func;
Lines 1729-1734 Link Here
1729
    ErrorF("-modulepath paths      specify the module search path\n");
1741
    ErrorF("-modulepath paths      specify the module search path\n");
1730
    ErrorF("-logfile file          specify a log file name\n");
1742
    ErrorF("-logfile file          specify a log file name\n");
1731
    ErrorF("-configure             probe for devices and write an "__XCONFIGFILE__"\n");
1743
    ErrorF("-configure             probe for devices and write an "__XCONFIGFILE__"\n");
1744
	ErrorF("-showopts              print available options for all installed drivers\n");
1732
  }
1745
  }
1733
  ErrorF("-config file           specify a configuration file, relative to the\n");
1746
  ErrorF("-config file           specify a configuration file, relative to the\n");
1734
  ErrorF("                       "__XCONFIGFILE__" search path, only root can use absolute\n");
1747
  ErrorF("                       "__XCONFIGFILE__" search path, only root can use absolute\n");
(-)xf86Priv.h (+1 lines)
Lines 174-179 Link Here
174
void DoProbeArgs(int argc, char **argv, int i);
174
void DoProbeArgs(int argc, char **argv, int i);
175
void DoProbe(void);
175
void DoProbe(void);
176
void DoConfigure(void);
176
void DoConfigure(void);
177
void DoShowOptions(void);
177
178
178
/* xf86Events.c */
179
/* xf86Events.c */
179
180

Return to bug 137374