diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
commit | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch) | |
tree | c1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/hw/xfree86/common/xf86Init.c | |
parent | dc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff) | |
download | vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2 vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip |
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86Init.c')
-rw-r--r-- | xorg-server/hw/xfree86/common/xf86Init.c | 415 |
1 files changed, 168 insertions, 247 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index fc50cafc7..f029915c6 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -71,12 +71,8 @@ #include "xf86Date.h" #include "xf86Build.h" #include "mipointer.h" -#ifdef XINPUT #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> -#else -#include "inputstr.h" -#endif #include "xf86DDC.h" #include "xf86Xinput.h" #include "xf86InPriv.h" @@ -97,12 +93,6 @@ #include "xf86Bus.h" /* forward declarations */ - -static void xf86PrintBanner(void); -static void xf86PrintMarkers(void); -static void xf86PrintDefaultModulePath(void); -static void xf86PrintDefaultLibraryPath(void); - 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); @@ -142,7 +132,7 @@ static Bool formatsDone = FALSE; #endif static void -xf86PrintBanner() +xf86PrintBanner(void) { #if PRE_RELEASE ErrorF("\n" @@ -249,13 +239,13 @@ xf86PrintBanner() } static void -xf86PrintMarkers() +xf86PrintMarkers(void) { LogPrintMarkers(); } static void -DoModalias() +DoModalias(void) { int i = -1; char **vlist; @@ -379,10 +369,10 @@ xf86CreateRootWindow(WindowPtr pWin) pProp->size, pProp->data, FALSE); } - + /* Look at err */ ret &= (err==Success); - + } else { xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " "non-root window %p (parent %p)\n", @@ -399,7 +389,7 @@ xf86CreateRootWindow(WindowPtr pWin) static void -PostConfigInit(void) +InstallSignalHandlers(void) { /* * Install signal handler for unexpected signals @@ -425,13 +415,6 @@ PostConfigInit(void) signal(SIGXFSZ,xf86SigHandler); #endif } - -#ifdef XF86PM - xf86OSPMClose = xf86OSPMOpen(); -#endif - - /* Do this after XF86Config is read (it's normally in OsInit()) */ - OsInitColors(); } @@ -459,7 +442,7 @@ probe_devices_from_device_sections(DriverPtr drvp) iter = pci_id_match_iterator_create(NULL); while ((pPci = pci_device_next(iter)) != NULL) { if (devList[i]->busID && *devList[i]->busID) { - if (xf86ComparePciBusString(devList[i]->busID, + if (xf86ComparePciBusString(devList[i]->busID, ((pPci->domain << 8) | pPci->bus), pPci->dev, @@ -506,7 +489,7 @@ probe_devices_from_device_sections(DriverPtr drvp) ErrorF("%s: card at %d:%d:%d is claimed by a Device section\n", drvp->driverName, pPci->bus, pPci->dev, pPci->func); #endif - + /* Allocate an entry in the lists to be returned */ entry = xf86ClaimPciSlot(pPci, drvp, device_id, devList[i], devList[i]->active); @@ -526,7 +509,7 @@ probe_devices_from_device_sections(DriverPtr drvp) } } } - + if (entry != -1) { if ((*drvp->PciProbe)(drvp, entry, pPci, devices[j].match_data)) { @@ -539,7 +522,7 @@ probe_devices_from_device_sections(DriverPtr drvp) } } - + return foundScreen; } @@ -565,8 +548,8 @@ add_matching_devices_to_configure_list(DriverPtr drvp) && ((devices[j].device_class_mask & pPci->device_class) == devices[j].device_class) ) { if (xf86CheckPciSlot(pPci)) { - GDevPtr pGDev = - xf86AddDeviceToConfigure(drvp->driverName, pPci, -1); + GDevPtr pGDev = xf86AddBusDeviceToConfigure( + drvp->driverName, BUS_PCI, pPci, -1); if (pGDev != NULL) { /* After configure pass 1, chipID and chipRev are * treated as over-rides, so clobber them here. @@ -600,11 +583,11 @@ check_for_matching_devices(DriverPtr drvp) 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; } @@ -623,9 +606,9 @@ check_for_matching_devices(DriverPtr drvp) * is found, it is called. If \c DriverRec::PciProbe or no devices can be * successfully probed with it (e.g., only non-PCI devices are available), * the driver's \c DriverRec::Probe function is called. - * + * * \param drv Driver to probe - * + * * \return * If a device can be successfully probed by the driver, \c TRUE is * returned. Otherwise, \c FALSE is returned. @@ -653,13 +636,83 @@ xf86CallDriverProbe( DriverPtr drv, Bool detect_only ) if ( ! foundScreen && (drv->Probe != NULL) ) { xf86Msg( X_WARNING, "Falling back to old probe method for %s\n", drv->driverName ); - foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT + foundScreen = (*drv->Probe)( drv, (detect_only) ? PROBE_DETECT : PROBE_DEFAULT ); } 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. @@ -677,7 +730,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; Bool autoconfig = FALSE; - + GDevPtr configured_device; + xf86Initialising = TRUE; if (serverGeneration == 1) { @@ -703,7 +757,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } /* Read and parse the config file */ - if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias) { + if (!xf86DoProbe && !xf86DoConfigure && !xf86DoModalias && !xf86DoShowOptions) { switch (xf86HandleConfigFile(FALSE)) { case CONFIG_OK: break; @@ -716,8 +770,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } } - if (!autoconfig) - PostConfigInit(); + InstallSignalHandlers(); /* Initialise the loader */ LoaderInit(); @@ -729,6 +782,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); } + if (xf86DoShowOptions) + DoShowOptions(); + xf86OpenConsole(); /* Do a general bus probe. This will be a PCI probe for x86 platforms */ @@ -749,9 +805,12 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86Msg(X_ERROR, "Auto configuration failed\n"); return; } - PostConfigInit(); } +#ifdef XF86PM + xf86OSPMClose = xf86OSPMOpen(); +#endif + /* Initialise the resource broker */ xf86ResourceBrokerInit(); @@ -766,7 +825,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) /* If there aren't any specified in the config file, autoconfig them */ /* FIXME: Does not handle multiple active screen sections, but I'm not * sure if we really want to handle that case*/ - GDevPtr configured_device = xf86ConfigLayout.screens->screen->device; + configured_device = xf86ConfigLayout.screens->screen->device; if ((!configured_device) || (!configured_device->driver)) { if (!autoConfigDevice(configured_device)) { xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); @@ -812,14 +871,10 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumDrivers; i++) { xorgHWFlags flags; - /* The Identify function is mandatory, but if it isn't there continue */ + if (xf86DriverList[i]->Identify != NULL) xf86DriverList[i]->Identify(0); - else { - xf86Msg(X_WARNING, "Driver `%s' has no Identify function\n", - xf86DriverList[i]->driverName ? xf86DriverList[i]->driverName - : "noname"); - } + if (!xorgHWAccess && (!xf86DriverList[i]->driverFunc || !xf86DriverList[i]->driverFunc(NULL, @@ -830,19 +885,16 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } /* Enable full I/O access */ - if (xorgHWAccess) { - if(!xf86EnableIO()) - /* oops, we have failed */ - xorgHWAccess = FALSE; - } + if (xorgHWAccess) + xorgHWAccess = xf86EnableIO(); /* * Locate bus slot that had register IO enabled at server startup */ - - xf86AccessInit(); - xf86FindPrimaryDevice(); - + if (xorgHWAccess) { + xf86AccessInit(); + xf86FindPrimaryDevice(); + } /* * Now call each of the Probe functions. Each successful probe will * result in an extra entry added to the xf86Screens[] list for each @@ -856,7 +908,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) || !xf86DriverList[i]->driverFunc(NULL, GET_REQUIRED_HW_INTERFACES, &flags) - || NEED_IO_ENABLED(flags)) + || NEED_IO_ENABLED(flags)) continue; } @@ -892,7 +944,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) layout++) { Bool found = FALSE; for (j = 0; j < xf86Screens[i]->numEntities; j++) { - + GDevPtr dev = xf86GetDevFromEntity(xf86Screens[i]->entityList[j], xf86Screens[i]->entityInstanceList[j]); @@ -950,7 +1002,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) * Call the driver's PreInit()'s to complete initialisation for the first * generation. */ - + for (i = 0; i < xf86NumScreens; i++) { xf86EnableAccess(xf86Screens[i]); if (xf86Screens[i]->PreInit && @@ -960,7 +1012,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) for (i = 0; i < xf86NumScreens; i++) if (!xf86Screens[i]->configured) xf86DeleteScreen(i--, 0); - + /* * If no screens left, return now. */ @@ -971,46 +1023,14 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) return; } - /* This could be moved into a separate function */ - - /* - * Check that all screens have initialised the mandatory function - * entry points. Delete those which have not. - */ - -#define WARN_SCREEN(func) \ - xf86Msg(X_ERROR, "Driver `%s' has no %s function, deleting.\n", \ - xf86Screens[i]->name, (warned++, func)) - for (i = 0; i < xf86NumScreens; i++) { - int warned = 0; if (xf86Screens[i]->name == NULL) { - xf86Screens[i]->name = xnfalloc(strlen("screen") + 1 + 1); - if (i < 10) - sprintf(xf86Screens[i]->name, "screen%c", i + '0'); - else - sprintf(xf86Screens[i]->name, "screen%c", i - 10 + 'A'); + xf86Screens[i]->name = xnfalloc(strlen("screen") + 10 + 1); + sprintf(xf86Screens[i]->name, "screen%d", i); xf86MsgVerb(X_WARNING, 0, "Screen driver %d has no name set, using `%s'.\n", i, xf86Screens[i]->name); } - if (xf86Screens[i]->ScreenInit == NULL) - WARN_SCREEN("ScreenInit"); - if (xf86Screens[i]->EnterVT == NULL) - WARN_SCREEN("EnterVT"); - if (xf86Screens[i]->LeaveVT == NULL) - WARN_SCREEN("LeaveVT"); - if (warned) - xf86DeleteScreen(i--, 0); - } - - /* - * If no screens left, return now. - */ - - if (xf86NumScreens == 0) { - xf86Msg(X_ERROR, "Screen(s) found, but drivers were unusable.\n"); - return; } /* XXX Should this be before or after loading dependent modules? */ @@ -1121,12 +1141,12 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) FatalError("Unable to make VT property - out of memory. Exiting...\n"); } *VT = xf86Info.vtno; - + VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) { ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - VTAtom, XA_INTEGER, 32, + VTAtom, XA_INTEGER, 32, 1, VT ); if (ret != Success) xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, @@ -1143,14 +1163,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } } -#ifdef XKB - xf86InitXkb(); -#endif /* set up the proper access funcs */ xf86PostPreInit(); - AddCallback(&ServerGrabCallback, xf86GrabServerCallback, NULL); - } else { /* * serverGeneration != 1; some OSs have to do things here, too. @@ -1174,34 +1189,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86EnableIO(); } -#if 0 - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal=FALSE; - if (!xf86Info.notrapSignals) - { - signal(SIGSEGV,xf86SigHandler); - signal(SIGILL,xf86SigHandler); -#ifdef SIGEMT - signal(SIGEMT,xf86SigHandler); -#endif - signal(SIGFPE,xf86SigHandler); -#ifdef SIGBUS - signal(SIGBUS,xf86SigHandler); -#endif -#ifdef SIGSYS - signal(SIGSYS,xf86SigHandler); -#endif -#ifdef SIGXCPU - signal(SIGXCPU,xf86SigHandler); -#endif -#ifdef SIGXFSZ - signal(SIGXFSZ,xf86SigHandler); -#endif - } -#endif - /* * Use the previously collected parts to setup pScreenInfo */ @@ -1215,7 +1202,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) pScreenInfo->formats[i] = formats[i]; /* Make sure the server's VT is active */ - + if (serverGeneration != 1) { xf86Resetting = TRUE; /* All screens are in the same state, so just check the first */ @@ -1225,7 +1212,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) #endif xf86AccessEnter(); xf86EnterServerState(SETUP); - } + } } #ifdef SCO325 else { @@ -1242,8 +1229,8 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } #endif /* SCO325 */ - for (i = 0; i < xf86NumScreens; i++) { - xf86EnableAccess(xf86Screens[i]); + for (i = 0; i < xf86NumScreens; i++) { + xf86EnableAccess(xf86Screens[i]); /* * Almost everything uses these defaults, and many of those that * don't, will wrap them. @@ -1251,7 +1238,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; xf86Screens[i]->SetDGAMode = xf86SetDGAMode; xf86Screens[i]->DPMSSet = NULL; - xf86Screens[i]->LoadPalette = NULL; + xf86Screens[i]->LoadPalette = NULL; xf86Screens[i]->SetOverscan = NULL; xf86Screens[i]->DriverFunc = NULL; xf86Screens[i]->pScreen = NULL; @@ -1286,7 +1273,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) #ifdef RENDER if (PictureGetSubpixelOrder (xf86Screens[i]->pScreen) == SubPixelUnknown) { - xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); + xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); PictureSetSubpixelOrder (xf86Screens[i]->pScreen, DDC ? (DDC->features.input_type ? @@ -1320,15 +1307,15 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) void InitInput(argc, argv) - int argc; - char **argv; + int argc; + char **argv; { IDevPtr* pDev; - InputDriverPtr pDrv; - InputInfoPtr pInfo; + DeviceIntPtr dev; xf86Info.vtRequestsPending = FALSE; - xf86Info.inputPending = FALSE; + + mieqInit(); /* Call the PreInit function for each input device instance. */ for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { @@ -1337,51 +1324,18 @@ InitInput(argc, argv) strcpy((*pDev)->driver, "kbd"); } - if ((pDrv = xf86LookupInputDriver((*pDev)->driver)) == NULL) { - xf86Msg(X_ERROR, "No Input driver matching `%s'\n", (*pDev)->driver); - /* XXX For now, just continue. */ - continue; - } - if (!pDrv->PreInit) { - xf86MsgVerb(X_WARNING, 0, - "Input driver `%s' has no PreInit function (ignoring)\n", - pDrv->driverName); - continue; - } - pInfo = pDrv->PreInit(pDrv, *pDev, 0); - if (!pInfo) { - xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", - (*pDev)->identifier); - continue; - } else if (!(pInfo->flags & XI86_CONFIGURED)) { - xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", - (*pDev)->identifier); - xf86DeleteInput(pInfo, 0); - continue; - } - } - - /* Initialise all input devices. */ - pInfo = xf86InputDevs; - while (pInfo) { - xf86Msg(X_INFO, "evaluating device (%s)\n", pInfo->name); - xf86ActivateDevice(pInfo); - pInfo = pInfo->next; + /* If one fails, the others will too */ + if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc) + break; } - - mieqInit(); } -#ifndef SET_STDERR_NONBLOCKING -#define SET_STDERR_NONBLOCKING 1 -#endif - /* * OsVendorInit -- * OS/Vendor-specific initialisations. Called from OsInit(), which * is called by dix before establishing the well known sockets. */ - + void OsVendorInit() { @@ -1390,15 +1344,10 @@ OsVendorInit() #ifdef SIGCHLD signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ #endif - OsDelayInitColors = TRUE; -#ifndef BUILTIN_FONTS - loadableFonts = TRUE; -#endif if (!beenHere) xf86LogInit(); -#if SET_STDERR_NONBLOCKING /* Set stderr to non-blocking. */ #ifndef O_NONBLOCK #if defined(FNDELAY) @@ -1406,7 +1355,6 @@ OsVendorInit() #elif defined(O_NDELAY) #define O_NONBLOCK O_NDELAY #endif -#endif #ifdef O_NONBLOCK if (!beenHere) { @@ -1456,9 +1404,6 @@ ddxGiveUp() xf86Screens[i]->busAccess = NULL; } -#ifdef USE_XF86_SERVERLOCK - xf86UnlockServer(); -#endif #ifdef XFreeXDGA DGAShutdown(); #endif @@ -1507,9 +1452,9 @@ AbortDDX() (xf86Screens[i]->LeaveVT)(i, 0); } } - + xf86AccessLeave(); - + /* * This is needed for an abnormal server exit, since the normal exit stuff * MUST also be performed (i.e. the vt must be left in a defined state) @@ -1553,6 +1498,18 @@ xf86SetLogVerbosity(int verb) return save; } +static void +xf86PrintDefaultModulePath(void) +{ + ErrorF("%s\n", DEFAULT_MODULE_PATH); +} + +static void +xf86PrintDefaultLibraryPath(void) +{ + ErrorF("%s\n", DEFAULT_LIBRARY_PATH); +} + /* * ddxProcessArgument -- * Process device-dependent command line args. Returns 0 if argument is @@ -1561,8 +1518,6 @@ xf86SetLogVerbosity(int verb) * */ - - /* ARGSUSED */ int ddxProcessArgument(int argc, char **argv, int i) @@ -1578,7 +1533,7 @@ ddxProcessArgument(int argc, char **argv, int i) UseMsg(); \ FatalError("Required argument to %s not specified\n", argv[i]); \ } - + /* First the options that are only allowed for root */ if (getuid() == 0 || geteuid() != 0) { @@ -1622,11 +1577,6 @@ ddxProcessArgument(int argc, char **argv, int i) xf86ConfigFile = argv[i + 1]; return 2; } - if (!strcmp(argv[i],"-showunresolved")) - { - xf86ShowUnresolved = TRUE; - return 1; - } if (!strcmp(argv[i],"-probeonly")) { xf86ProbeOnly = TRUE; @@ -1649,28 +1599,11 @@ ddxProcessArgument(int argc, char **argv, int i) return 1; } #endif -#ifdef XF86MISC - if (!strcmp(argv[i],"-disableModInDev")) - { - xf86MiscModInDevDisabled = TRUE; - return 1; - } - if (!strcmp(argv[i],"-allowNonLocalModInDev")) - { - xf86MiscModInDevAllowNonLocal = TRUE; - return 1; - } -#endif if (!strcmp(argv[i],"-allowMouseOpenFail")) { xf86AllowMouseOpenFail = TRUE; return 1; } - if (!strcmp(argv[i],"-bestRefresh")) - { - xf86BestRefresh = TRUE; - return 1; - } if (!strcmp(argv[i],"-ignoreABI")) { LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); @@ -1734,12 +1667,6 @@ ddxProcessArgument(int argc, char **argv, int i) xf86fpFlag = TRUE; return 0; } - /* Notice the -co flag, but allow it to pass to the dix layer */ - if (!strcmp(argv[i], "-co")) - { - xf86coFlag = TRUE; - return 0; - } /* Notice the -bs flag, but allow it to pass to the dix layer */ if (!strcmp(argv[i], "-bs")) { @@ -1815,11 +1742,11 @@ ddxProcessArgument(int argc, char **argv, int i) return 0; } } - if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || + if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma")) { double gamma; - CHECK_FOR_REQUIRED_ARGUMENT(); + CHECK_FOR_REQUIRED_ARGUMENT(); if (sscanf(argv[++i], "%lf", &gamma) == 1) { if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) { ErrorF("gamma out of range, only %.2f <= gamma_value <= %.1f" @@ -1854,7 +1781,7 @@ ddxProcessArgument(int argc, char **argv, int i) } if (!strcmp(argv[i], "-keyboard")) { - CHECK_FOR_REQUIRED_ARGUMENT(); + CHECK_FOR_REQUIRED_ARGUMENT(); xf86KeyboardName = argv[++i]; return 2; } @@ -1891,6 +1818,15 @@ ddxProcessArgument(int argc, char **argv, int i) xf86AllowMouseOpenFail = TRUE; return 1; } + if (!strcmp(argv[i], "-showopts")) + { + if (getuid() != 0 && geteuid() == 0) { + ErrorF("The '-showopts' option can only be used by root.\n"); + exit(1); + } + xf86DoShowOptions = TRUE; + return 1; + } if (!strcmp(argv[i], "-isolateDevice")) { int bus, device, func; @@ -1908,15 +1844,17 @@ ddxProcessArgument(int argc, char **argv, int i) FatalError("Invalid isolated device specification\n"); } } + /* Notice cmdline xkbdir, but pass to dix as well */ + if (!strcmp(argv[i], "-xkbdir")) + { + xf86xkbdirFlag = TRUE; + return 0; + } + /* OS-specific processing */ return xf86ProcessArgument(argc, argv, i); } -/* ddxInitGlobals - called by |InitGlobals| from os/util.c */ -void ddxInitGlobals(void) -{ -} - /* * ddxUseMsg -- * Print out correct use of device dependent commandline options. @@ -1934,6 +1872,7 @@ ddxUseMsg() ErrorF("-modulepath paths specify the module search path\n"); ErrorF("-logfile file specify a log file name\n"); 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"); @@ -1961,13 +1900,7 @@ ddxUseMsg() ErrorF("-disableVidMode disable mode adjustments with xvidtune\n"); ErrorF("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n"); #endif -#ifdef XF86MISC - ErrorF("-disableModInDev disable dynamic modification of input device settings\n"); - ErrorF("-allowNonLocalModInDev allow changes to keyboard and mouse settings\n"); - ErrorF(" from non-local clients\n"); ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n"); -#endif - ErrorF("-bestRefresh choose modes with the best refresh rate\n"); ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); ErrorF("-version show the server version\n"); @@ -1978,21 +1911,10 @@ ddxUseMsg() ErrorF("\n"); } -static void -xf86PrintDefaultModulePath(void) -{ - ErrorF("%s\n", DEFAULT_MODULE_PATH); -} - -static void -xf86PrintDefaultLibraryPath(void) -{ - ErrorF("%s\n", DEFAULT_LIBRARY_PATH); -} /* * xf86LoadModules iterates over a list that is being passed in. - */ + */ Bool xf86LoadModules(char **list, pointer *optlist) { @@ -2063,7 +1985,7 @@ xf86GetPixFormat(ScrnInfoPtr pScrn, int depth) return &format; } } - + for (i = 0; i < numFormats; i++) if (formats[i].depth == depth) break; @@ -2085,11 +2007,10 @@ xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth) { PixmapFormatPtr format; - + format = xf86GetPixFormat(pScrn, depth); if (format) return format->bitsPerPixel; else return 0; } - |