diff options
author | Ian Romanick <idr@us.ibm.com> | 2007-08-23 18:19:17 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2007-08-23 18:19:17 -0700 |
commit | 8b6b40b7271acd81a9548f502c18f46f3b640640 (patch) | |
tree | 1462cb63501a8bdd8845d7c62e038b6a86b78fd5 /hw/xfree86/common | |
parent | ab7a6d860d4a275a810a64b1ba7b13726ed10575 (diff) | |
parent | 3305d17195e3a0a5555300555bd7703312fa489f (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/xserver into pci-reworkpci-rework
Conflicts:
hw/xfree86/common/xf86.h
hw/xfree86/common/xf86Init.c
hw/xfree86/common/xf86pciBus.c
hw/xfree86/int10/generic.c
hw/xfree86/int10/helper_exec.c
hw/xfree86/loader/xf86sym.c
hw/xfree86/os-support/bus/Pci.c
hw/xfree86/os-support/bus/Pci.h
hw/xfree86/os-support/bus/linuxPci.c
hw/xfree86/os-support/linux/int10/linux.c
Diffstat (limited to 'hw/xfree86/common')
27 files changed, 182 insertions, 482 deletions
diff --git a/hw/xfree86/common/atKeynames.h b/hw/xfree86/common/atKeynames.h index 1415fce20..f31f53377 100644 --- a/hw/xfree86/common/atKeynames.h +++ b/hw/xfree86/common/atKeynames.h @@ -47,8 +47,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* $XConsortium: atKeynames.h /main/11 1996/03/09 11:17:41 kaleb $ */ - #ifndef _ATKEYNAMES_H #define _ATKEYNAMES_H diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index becd3da25..73ca3d0ac 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -47,8 +47,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* $XConsortium: compiler.h /main/16 1996/10/25 15:38:34 kaleb $ */ - #ifndef _COMPILER_H # define _COMPILER_H diff --git a/hw/xfree86/common/modeline2c.pl b/hw/xfree86/common/modeline2c.pl index cc6c6925e..88e380de4 100644 --- a/hw/xfree86/common/modeline2c.pl +++ b/hw/xfree86/common/modeline2c.pl @@ -71,9 +71,6 @@ printf("/* \$$proj\$ */ #include <xorg-config.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif #include \"xf86.h\" #include \"xf86Config.h\" #include \"xf86Priv.h\" diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index d7fd04540..69d619e6f 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -87,14 +87,6 @@ extern Bool xf86inSuspend; #define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \ (((p) == Pix24Use32) ? 32 : 0)) -/* variables for debugging */ -#ifdef BUILDDEBUG -extern char* xf86p8bit[]; -extern CARD32 xf86DummyVar1; -extern CARD32 xf86DummyVar2; -extern CARD32 xf86DummyVar3; -#endif - /* Function Prototypes */ #ifndef _NO_XF86_PROTOTYPES @@ -356,9 +348,6 @@ void xf86DeleteModuleInfo(int idx); /* xf86Debug.c */ #ifdef BUILDDEBUG - void xf86Break1(void); -void xf86Break2(void); -void xf86Break3(void); CARD8 xf86PeekFb8(CARD8 *p); CARD16 xf86PeekFb16(CARD16 *p); CARD32 xf86PeekFb32(CARD32 *p); @@ -371,8 +360,6 @@ CARD32 xf86PeekMmio32(pointer Base, unsigned long Offset); void xf86PokeMmio8(pointer Base, unsigned long Offset, CARD8 v); void xf86PokeMmio16(pointer Base, unsigned long Offset, CARD16 v); void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v); -extern void xf86SPTimestamp(xf86TsPtr* timestamp, char* string); -extern void xf86STimestamp(xf86TsPtr* timestamp); #endif /* xf86Init.c */ diff --git a/hw/xfree86/common/xf86AutoConfig.c b/hw/xfree86/common/xf86AutoConfig.c index d2d1c6fd7..4bdf1ceb8 100644 --- a/hw/xfree86/common/xf86AutoConfig.c +++ b/hw/xfree86/common/xf86AutoConfig.c @@ -48,7 +48,6 @@ "\tLoad\t\"dbe\"\n" \ "\tLoad\t\"glx\"\n" \ "\tLoad\t\"freetype\"\n" \ - "\tLoad\t\"type1\"\n" \ "\tLoad\t\"record\"\n" \ "\tLoad\t\"dri\"\n" \ "EndSection\n\n" diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c index 6369d6dda..71e008069 100644 --- a/hw/xfree86/common/xf86Config.c +++ b/hw/xfree86/common/xf86Config.c @@ -1,5 +1,3 @@ - - /* * Loosely based on code bearing the following copyright: * @@ -53,10 +51,6 @@ #include <grp.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif - #include "xf86.h" #include "xf86Parser.h" #include "xf86tokens.h" @@ -121,6 +115,17 @@ extern DeviceAssocRec mouse_assoc; static char *fontPath = NULL; +static ModuleDefault ModuleDefaults[] = { + {.name = "extmod", .toLoad = TRUE, .load_opt=NULL}, + {.name = "dbe", .toLoad = TRUE, .load_opt=NULL}, + {.name = "glx", .toLoad = TRUE, .load_opt=NULL}, + {.name = "freetype", .toLoad = TRUE, .load_opt=NULL}, + {.name = "record", .toLoad = TRUE, .load_opt=NULL}, + {.name = "dri", .toLoad = TRUE, .load_opt=NULL}, + {.name = NULL, .toLoad = FALSE, .load_opt=NULL} +}; + + /* Forward declarations */ static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, MessageType from); @@ -182,15 +187,8 @@ xf86ValidateFontPath(char *path) while (next != NULL) { path_elem = xf86GetPathElem(&next); if (*path_elem == '/') { -#ifndef __UNIXOS2__ dir_elem = xnfcalloc(1, strlen(path_elem) + 1); if ((p1 = strchr(path_elem, ':')) != 0) -#else - /* OS/2 must prepend X11ROOT */ - path_elem = (char*)__XOS2RedirRoot(path_elem); - dir_elem = xnfcalloc(1, strlen(path_elem) + 1); - if (p1 = strchr(path_elem+2, ':')) -#endif dirlen = p1 - path_elem; else dirlen = strlen(path_elem); @@ -214,9 +212,7 @@ xf86ValidateFontPath(char *path) if (flag == 0) if (!S_ISREG(stat_buf.st_mode)) flag = -1; -#ifndef __UNIXOS2__ xfree(p1); -#endif if (flag != 0) { xf86Msg(X_WARNING, "`fonts.dir' not found (or not valid) in \"%s\".\n", @@ -443,7 +439,7 @@ xf86InputDriverlistFromConfig() { int count = 0; char **modulearray; - IDevPtr idp; + IDevPtr* idp; /* * make sure the config file has been parsed and that we have a @@ -461,7 +457,7 @@ xf86InputDriverlistFromConfig() */ if (xf86ConfigLayout.inputs) { idp = xf86ConfigLayout.inputs; - while (idp->identifier) { + while (*idp) { count++; idp++; } @@ -476,8 +472,8 @@ xf86InputDriverlistFromConfig() modulearray = xnfalloc((count + 1) * sizeof(char*)); count = 0; idp = xf86ConfigLayout.inputs; - while (idp->identifier) { - modulearray[count] = idp->driver; + while (idp && *idp) { + modulearray[count] = (*idp)->driver; count++; idp++; } @@ -793,7 +789,9 @@ typedef enum { FLAG_AIGLX, FLAG_IGNORE_ABI, FLAG_ALLOW_EMPTY_INPUT, - FLAG_USE_DEFAULT_FONT_PATH + FLAG_USE_DEFAULT_FONT_PATH, + FLAG_AUTO_ADD_DEVICES, + FLAG_AUTO_ENABLE_DEVICES, } FlagValues; static OptionInfoRec FlagOptions[] = { @@ -871,6 +869,10 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE }, { FLAG_USE_DEFAULT_FONT_PATH, "UseDefaultFontPath", OPTV_BOOLEAN, {0}, FALSE }, + { FLAG_AUTO_ADD_DEVICES, "AutoAddDevices", OPTV_BOOLEAN, + {0}, TRUE }, + { FLAG_AUTO_ENABLE_DEVICES, "AutoEnableDevices", OPTV_BOOLEAN, + {0}, TRUE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -934,6 +936,30 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Msg(X_CONFIG, "Ignoring ABI Version\n"); } + if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_DEVICES)) { + xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_DEVICES, + &xf86Info.autoAddDevices); + from = X_CONFIG; + } + else { + xf86Info.autoAddDevices = TRUE; + from = X_DEFAULT; + } + xf86Msg(from, "%sutomatically adding devices\n", + xf86Info.autoAddDevices ? "A" : "Not a"); + + if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ENABLE_DEVICES)) { + xf86GetOptValBool(FlagOptions, FLAG_AUTO_ENABLE_DEVICES, + &xf86Info.autoEnableDevices); + from = X_CONFIG; + } + else { + xf86Info.autoEnableDevices = TRUE; + from = X_DEFAULT; + } + xf86Msg(from, "%sutomatically enabling devices\n", + xf86Info.autoEnableDevices ? "A" : "Not a"); + /* * Set things up based on the config file information. Some of these * settings may be overridden later when the command line options are @@ -1004,6 +1030,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) } else if (!xf86NameCmp(s,"sync")) { xf86Msg(X_CONFIG, "Syncing logfile enabled\n"); xf86Info.log = LogSync; + LogSetParameter(XLOG_FLUSH, TRUE); LogSetParameter(XLOG_SYNC, TRUE); } else { xf86Msg(X_WARNING,"Unknown Log option\n"); @@ -1186,7 +1213,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) IDevPtr corePointer = NULL, coreKeyboard = NULL; Bool foundPointer = FALSE, foundKeyboard = FALSE; const char *pointerMsg = NULL, *keyboardMsg = NULL; - IDevPtr indp, i; + IDevPtr *devs, /* iterator */ + indp; IDevRec Pointer, Keyboard; XF86ConfInputPtr confInput; XF86ConfInputRec defPtr, defKbd; @@ -1199,7 +1227,8 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * in the active ServerLayout. If more than one is specified for either, * remove the core attribute from the later ones. */ - for (indp = servlayoutp->inputs; indp->identifier; indp++) { + for (devs = servlayoutp->inputs; devs && *devs; devs++) { + indp = *devs; pointer opt1 = NULL, opt2 = NULL; if (indp->commonOptions && xf86CheckBoolOption(indp->commonOptions, "CorePointer", FALSE)) { @@ -1264,11 +1293,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * removed. */ if (corePointer) { - for (indp = servlayoutp->inputs; indp->identifier; indp++) - if (indp == corePointer) + for (devs = servlayoutp->inputs; devs && *devs; devs++) + if (*devs == corePointer) + { + xfree(*devs); + *devs = (IDevPtr)0x1; /* ensure we dont skip next loop*/ break; - for (; indp->identifier; indp++) - indp[0] = indp[1]; + } + for (; devs && *devs; devs++) + devs[0] = devs[1]; count--; } corePointer = NULL; @@ -1328,13 +1361,14 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) foundPointer = configInput(&Pointer, confInput, from); if (foundPointer) { count++; - indp = xnfrealloc(servlayoutp->inputs, - (count + 1) * sizeof(IDevRec)); - indp[count - 1] = Pointer; - indp[count - 1].extraOptions = + devs = xnfrealloc(servlayoutp->inputs, + (count + 1) * sizeof(IDevPtr)); + devs[count - 1] = xnfalloc(sizeof(IDevRec)); + *devs[count - 1] = Pointer; + devs[count - 1]->extraOptions = xf86addNewOption(NULL, xnfstrdup("CorePointer"), NULL); - indp[count].identifier = NULL; - servlayoutp->inputs = indp; + devs[count] = NULL; + servlayoutp->inputs = devs; } } @@ -1352,9 +1386,9 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * If you're using an evdev keyboard and expect a default mouse * section ... deal. */ - for (i = servlayoutp->inputs; i->identifier && i->driver; i++) { - if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse") || - !strcmp(i->driver, "vmmouse") || !strcmp(i->driver, "evdev")) { + for (devs = servlayoutp->inputs; devs && *devs; devs++) { + if (!strcmp((*devs)->driver, "void") || !strcmp((*devs)->driver, "mouse") || + !strcmp((*devs)->driver, "vmmouse") || !strcmp((*devs)->driver, "evdev")) { found = 1; break; } } @@ -1367,13 +1401,14 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) foundPointer = configInput(&Pointer, confInput, from); if (foundPointer) { count++; - indp = xnfrealloc(servlayoutp->inputs, - (count + 1) * sizeof(IDevRec)); - indp[count - 1] = Pointer; - indp[count - 1].extraOptions = + devs = xnfrealloc(servlayoutp->inputs, + (count + 1) * sizeof(IDevPtr)); + devs[count - 1] = xnfalloc(sizeof(IDevRec)); + *devs[count - 1] = Pointer; + devs[count - 1]->extraOptions = xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL); - indp[count].identifier = NULL; - servlayoutp->inputs = indp; + devs[count] = NULL; + servlayoutp->inputs = devs; } } @@ -1394,11 +1429,15 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) * removed. */ if (coreKeyboard) { - for (indp = servlayoutp->inputs; indp->identifier; indp++) - if (indp == coreKeyboard) + for (devs = servlayoutp->inputs; devs && *devs; devs++) + if (*devs == coreKeyboard) + { + xfree(*devs); + *devs = (IDevPtr)0x1; /* ensure we dont skip next loop */ break; - for (; indp->identifier; indp++) - indp[0] = indp[1]; + } + for (; devs && *devs; devs++) + devs[0] = devs[1]; count--; } coreKeyboard = NULL; @@ -1458,13 +1497,14 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout) foundKeyboard = configInput(&Keyboard, confInput, from); if (foundKeyboard) { count++; - indp = xnfrealloc(servlayoutp->inputs, - (count + 1) * sizeof(IDevRec)); - indp[count - 1] = Keyboard; - indp[count - 1].extraOptions = + devs = xnfrealloc(servlayoutp->inputs, + (count + 1) * sizeof(IDevPtr)); + devs[count - 1] = xnfalloc(sizeof(IDevRec)); + *devs[count - 1] = Keyboard; + devs[count - 1]->extraOptions = xf86addNewOption(NULL, xnfstrdup("CoreKeyboard"), NULL); - indp[count].identifier = NULL; - servlayoutp->inputs = indp; + devs[count] = NULL; + servlayoutp->inputs = devs; } } @@ -1520,7 +1560,7 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, MessageType from; screenLayoutPtr slp; GDevPtr gdp; - IDevPtr indp; + IDevPtr* indp; int i = 0, j; if (!servlayoutp) @@ -1732,16 +1772,19 @@ configLayout(serverLayoutPtr servlayoutp, XF86ConfLayoutPtr conf_layout, ErrorF("Found %d input devices in the layout section %s", count, conf_layout->lay_identifier); #endif - indp = xnfalloc((count + 1) * sizeof(IDevRec)); - indp[count].identifier = NULL; + indp = xnfcalloc((count + 1), sizeof(IDevPtr)); + indp[count] = NULL; irp = conf_layout->lay_input_lst; count = 0; while (irp) { - if (!configInput(&indp[count], irp->iref_inputdev, X_CONFIG)) { - xfree(indp); - return FALSE; + indp[count] = xnfalloc(sizeof(IDevRec)); + if (!configInput(indp[count], irp->iref_inputdev, X_CONFIG)) { + while(count--) + xfree(indp[count]); + xfree(indp); + return FALSE; } - indp[count].extraOptions = irp->iref_option_lst; + indp[count]->extraOptions = irp->iref_option_lst; count++; irp = (XF86ConfInputrefPtr)irp->list.next; } @@ -1765,7 +1808,7 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen) MessageType from; XF86ConfScreenPtr s; screenLayoutPtr slp; - IDevPtr indp; + IDevPtr *indp; if (!servlayoutp) return FALSE; @@ -1807,8 +1850,8 @@ configImpliedLayout(serverLayoutPtr servlayoutp, XF86ConfScreenPtr conf_screen) servlayoutp->inactives = xnfcalloc(1, sizeof(GDevRec)); servlayoutp->options = NULL; /* Set up an empty input device list, then look for some core devices. */ - indp = xnfalloc(sizeof(IDevRec)); - indp->identifier = NULL; + indp = xnfalloc(sizeof(IDevPtr)); + *indp = NULL; servlayoutp->inputs = indp; if (!xf86Info.allowEmptyInput && !checkCoreInputDevices(servlayoutp, TRUE)) return FALSE; @@ -1945,12 +1988,15 @@ configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen, int scrnum, } typedef enum { - MON_REDUCEDBLANKING + MON_REDUCEDBLANKING, + MON_MAX_PIX_CLOCK, } MonitorValues; static OptionInfoRec MonitorOptions[] = { { MON_REDUCEDBLANKING, "ReducedBlanking", OPTV_BOOLEAN, {0}, FALSE }, + { MON_MAX_PIX_CLOCK, "MaxPixClock", OPTV_FREQ, + {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE }, }; @@ -2097,11 +2143,11 @@ configMonitor(MonPtr monitorp, XF86ConfMonitorPtr conf_monitor) return FALSE; } - /* Check wether this Monitor accepts Reduced Blanking modelines */ xf86ProcessOptions(-1, monitorp->options, MonitorOptions); - xf86GetOptValBool(MonitorOptions, MON_REDUCEDBLANKING, &monitorp->reducedblanking); + xf86GetOptValFreq(MonitorOptions, MON_MAX_PIX_CLOCK, OPTUNITS_KHZ, + &monitorp->maxPixClock); return TRUE; } diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h index 7fc161d49..b8b5fd42a 100644 --- a/hw/xfree86/common/xf86Config.h +++ b/hw/xfree86/common/xf86Config.h @@ -54,17 +54,6 @@ typedef struct _ModuleDefault { XF86OptionPtr load_opt; } ModuleDefault; -static ModuleDefault ModuleDefaults[] = { - {.name = "extmod", .toLoad = TRUE, .load_opt=NULL}, - {.name = "dbe", .toLoad = TRUE, .load_opt=NULL}, - {.name = "glx", .toLoad = TRUE, .load_opt=NULL}, - {.name = "freetype", .toLoad = TRUE, .load_opt=NULL}, - {.name = "type1", .toLoad = TRUE, .load_opt=NULL}, - {.name = "record", .toLoad = TRUE, .load_opt=NULL}, - {.name = "dri", .toLoad = TRUE, .load_opt=NULL}, - {.name = NULL, .toLoad = FALSE, .load_opt=NULL} -}; - /* * prototypes */ diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index 536564a7c..4c980a291 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -71,10 +71,7 @@ _X_EXPORT xf86MonPtr ConfiguredMonitor; Bool xf86DoConfigurePass1 = TRUE; static Bool foundMouse = FALSE; -#if defined(__UNIXOS2__) -#define DFLT_MOUSE_DEV "mouse$" -#define DFLT_MOUSE_PROTO "OS2Mouse" -#elif defined(__SCO__) +#if defined(__SCO__) static char *DFLT_MOUSE_PROTO = "OSMouse"; #elif defined(__UNIXWARE__) static char *DFLT_MOUSE_PROTO = "OSMouse"; @@ -274,17 +271,6 @@ configureInputSection (void) /* Crude mechanism to auto-detect mouse (os dependent) */ { int fd; -#if 0 && defined linux - /* Our autodetection code can do a better job */ - int len; - char path[32]; - - if ((len = readlink(DFLT_MOUSE_DEV, path, sizeof(path) - 1)) > 0) { - path[len] = '\0'; - if (strstr(path, "psaux") != NULL) - DFLT_MOUSE_PROTO = "PS/2"; - } -#endif #ifdef WSCONS_SUPPORT fd = open("/dev/wsmouse", 0); if (fd > 0) { @@ -326,29 +312,6 @@ configureInputSection (void) return ptr; } -static XF86ConfDRIPtr -configureDRISection (void) -{ -#ifdef NOTYET - parsePrologue (XF86ConfDRIPtr, XF86ConfDRIRec) - - return ptr; -#else - return NULL; -#endif -} - -static XF86ConfVendorPtr -configureVendorSection (void) -{ - parsePrologue (XF86ConfVendorPtr, XF86ConfVendorRec) - - return NULL; -#if 0 - return ptr; -#endif -} - static XF86ConfScreenPtr configureScreenSection (int screennum) { @@ -570,29 +533,6 @@ configureLayoutSection (void) return ptr; } -static XF86ConfModesPtr -configureModesSection (void) -{ -#ifdef NOTYET - parsePrologue (XF86ConfModesPtr, XF86ConfModesRec) - - return ptr; -#else - return NULL; -#endif -} - -static XF86ConfVideoAdaptorPtr -configureVideoAdaptorSection (void) -{ - parsePrologue (XF86ConfVideoAdaptorPtr, XF86ConfVideoAdaptorRec) - - return NULL; -#if 0 - return ptr; -#endif -} - static XF86ConfFlagsPtr configureFlagsSection (void) { @@ -863,19 +803,16 @@ DoConfigure() xf86config->conf_files = configureFilesSection(); xf86config->conf_modules = configureModuleSection(); xf86config->conf_flags = configureFlagsSection(); - xf86config->conf_videoadaptor_lst = configureVideoAdaptorSection(); - xf86config->conf_modes_lst = configureModesSection(); - xf86config->conf_vendor_lst = configureVendorSection(); - xf86config->conf_dri = configureDRISection(); + xf86config->conf_videoadaptor_lst = NULL; + xf86config->conf_modes_lst = NULL; + xf86config->conf_vendor_lst = NULL; + xf86config->conf_dri = NULL; xf86config->conf_input_lst = configureInputSection(); xf86config->conf_layout_lst = configureLayoutSection(); if (!(home = getenv("HOME"))) home = "/"; { -#ifdef __UNIXOS2__ -#define PATH_MAX 2048 -#endif #if !defined(PATH_MAX) #define PATH_MAX 1024 #endif @@ -1010,13 +947,11 @@ DoConfigure() ErrorF("\n"__XSERVERNAME__" is not able to detect your mouse.\n" "Edit the file and correct the Device.\n"); } else { -#ifndef __UNIXOS2__ /* OS/2 definitely has a mouse */ ErrorF("\n"__XSERVERNAME__" detected your mouse at device %s.\n" "Please check your config if the mouse is still not\n" "operational, as by default "__XSERVERNAME__ " tries to autodetect\n" "the protocol.\n",DFLT_MOUSE_DEV); -#endif } #endif /* !__SCO__ */ diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 46d812804..9e6e62216 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -25,8 +25,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* $XConsortium: xf86Cursor.c /main/10 1996/10/19 17:58:23 kaleb $ */ - #define NEED_EVENTS #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> @@ -408,18 +406,14 @@ xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y) /* * xf86CrossScreen -- * Switch to another screen + * + * Currently nothing special happens, but mi assumes the CrossScreen + * method exists. */ -/* NEED TO CHECK THIS */ -/* ARGSUSED */ static void xf86CrossScreen (ScreenPtr pScreen, Bool entering) { -#if 0 - if (xf86Info.sharedMonitor) - (XF86SCRNINFO(pScreen)->EnterLeaveMonitor)(entering); - (XF86SCRNINFO(pScreen)->EnterLeaveCursor)(entering); -#endif } diff --git a/hw/xfree86/common/xf86Debug.c b/hw/xfree86/common/xf86Debug.c index cb579343a..5b609652b 100644 --- a/hw/xfree86/common/xf86Debug.c +++ b/hw/xfree86/common/xf86Debug.c @@ -30,10 +30,6 @@ #include <xorg-config.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif - #include <sys/time.h> #include <unistd.h> #include <X11/X.h> @@ -43,88 +39,6 @@ #include "xf86_OSlib.h" #include "compiler.h" -_X_EXPORT void xf86Break1(void) -{ -} - -_X_EXPORT void xf86Break2(void) -{ -} - -_X_EXPORT void xf86Break3(void) -{ -} - -_X_EXPORT char *xf86p8bit[] = { "00000000", "00000001", "00000010", "00000011", - "00000100", "00000101", "00000110", "00000111", - "00001000", "00001001", "00001010", "00001011", - "00001100", "00001101", "00001110", "00001111", - "00010000", "00010001", "00010010", "00010011", - "00010100", "00010101", "00010110", "00010111", - "00011000", "00011001", "00011010", "00011011", - "00011100", "00011101", "00011110", "00011111", - "00100000", "00100001", "00100010", "00100011", - "00100100", "00100101", "00100110", "00100111", - "00101000", "00101001", "00101010", "00101011", - "00101100", "00101101", "00101110", "00101111", - "00110000", "00110001", "00110010", "00110011", - "00110100", "00110101", "00110110", "00110111", - "00111000", "00111001", "00111010", "00111011", - "00111100", "00111101", "00111110", "00111111", - "01000000", "01000001", "01000010", "01000011", - "01000100", "01000101", "01000110", "01000111", - "01001000", "01001001", "01001010", "01001011", - "01001100", "01001101", "01001110", "01001111", - "01010000", "01010001", "01010010", "01010011", - "01010100", "01010101", "01010110", "01010111", - "01011000", "01011001", "01011010", "01011011", - "01011100", "01011101", "01011110", "01011111", - "01100000", "01100001", "01100010", "01100011", - "01100100", "01100101", "01100110", "01100111", - "01101000", "01101001", "01101010", "01101011", - "01101100", "01101101", "01101110", "01101111", - "01110000", "01110001", "01110010", "01110011", - "01110100", "01110101", "01110110", "01110111", - "01111000", "01111001", "01111010", "01111011", - "01111100", "01111101", "01111110", "01111111", - "10000000", "10000001", "10000010", "10000011", - "10000100", "10000101", "10000110", "10000111", - "10001000", "10001001", "10001010", "10001011", - "10001100", "10001101", "10001110", "10001111", - "10010000", "10010001", "10010010", "10010011", - "10010100", "10010101", "10010110", "10010111", - "10011000", "10011001", "10011010", "10011011", - "10011100", "10011101", "10011110", "10011111", - "10100000", "10100001", "10100010", "10100011", - "10100100", "10100101", "10100110", "10100111", - "10101000", "10101001", "10101010", "10101011", - "10101100", "10101101", "10101110", "10101111", - "10110000", "10110001", "10110010", "10110011", - "10110100", "10110101", "10110110", "10110111", - "10111000", "10111001", "10111010", "10111011", - "10111100", "10111101", "10111110", "10111111", - "11000000", "11000001", "11000010", "11000011", - "11000100", "11000101", "11000110", "11000111", - "11001000", "11001001", "11001010", "11001011", - "11001100", "11001101", "11001110", "11001111", - "11010000", "11010001", "11010010", "11010011", - "11010100", "11010101", "11010110", "11010111", - "11011000", "11011001", "11011010", "11011011", - "11011100", "11011101", "11011110", "11011111", - "11100000", "11100001", "11100010", "11100011", - "11100100", "11100101", "11100110", "11100111", - "11101000", "11101001", "11101010", "11101011", - "11101100", "11101101", "11101110", "11101111", - "11110000", "11110001", "11110010", "11110011", - "11110100", "11110101", "11110110", "11110111", - "11111000", "11111001", "11111010", "11111011", - "11111100", "11111101", "11111110", "11111111" -}; - -_X_EXPORT CARD32 xf86DummyVar1; -_X_EXPORT CARD32 xf86DummyVar2; -_X_EXPORT CARD32 xf86DummyVar3; - CARD8 xf86PeekFb8(CARD8 *p) { return *p; } CARD16 xf86PeekFb16(CARD16 *p) { return *p; } CARD32 xf86PeekFb32(CARD32 *p) { return *p; } @@ -161,38 +75,3 @@ void xf86PokeMmio32(pointer Base, unsigned long Offset, CARD32 v) { MMIO_OUT32(Base,Offset,v); } - - -#if 0 -_X_EXPORT void -xf86STimestamp(xf86TsPtr* timestamp) -{ - if (*timestamp) { - gettimeofday((struct timeval*)*timestamp,NULL); - } else { - *timestamp = xnfalloc(sizeof(xf86TsRec)); - gettimeofday((struct timeval*)*timestamp,NULL); - } -} - -_X_EXPORT void -xf86SPTimestamp(xf86TsPtr* timestamp, char *str) -{ - if (*timestamp) { - long diff; - struct timeval ts; - ts = **(struct timeval**)timestamp; - gettimeofday((struct timeval*)*timestamp,NULL); - if (ts.tv_usec > (*timestamp)->usec) - diff = ((*timestamp)->sec - ts.tv_sec - 1) * 1000 - + (ts.tv_usec - (*timestamp)->usec) / 1000; - else - diff = ((*timestamp)->sec - ts.tv_sec) * 1000 - +(- ts.tv_usec + (*timestamp)->usec) / 1000; - ErrorF("%s Elapsed: %li\n",str,diff); - } else { - *timestamp = xnfalloc(sizeof(xf86TsRec)); - gettimeofday((struct timeval*)*timestamp,NULL); - } -} -#endif diff --git a/hw/xfree86/common/xf86DefModes.c b/hw/xfree86/common/xf86DefModes.c index a39d0a212..bdb64fe8e 100644 --- a/hw/xfree86/common/xf86DefModes.c +++ b/hw/xfree86/common/xf86DefModes.c @@ -1,5 +1,3 @@ -/* $XFree86$ */ - /* THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT -- LOOK at * modeline2c.pl */ @@ -13,9 +11,6 @@ #include <xorg-config.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif #include "xf86.h" #include "xf86Config.h" #include "xf86Priv.h" diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 4da74e556..dd9c34e5c 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -53,10 +53,6 @@ #include <xorg-config.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif - #include <X11/X.h> #include <X11/Xpoll.h> #include <X11/Xproto.h> @@ -125,9 +121,6 @@ extern Bool noXkbExtension; * This has been generalised to work with Linux and *BSD+syscons (DHD) */ -#ifdef USE_VT_SYSREQ -static Bool VTSysreqToggle = FALSE; -#endif /* !USE_VT_SYSREQ */ _X_EXPORT Bool VTSwitchEnabled = TRUE; /* Allows run-time disabling for *BSD and for avoiding VT switches when using the DRI @@ -323,7 +316,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) CloseDownClient(server); } break; -#if !defined(__SOL8__) && !defined(__UNIXOS2__) && !defined(sgi) && \ +#if !defined(__SOL8__) && !defined(sgi) && \ (!defined(sun) || defined(i386)) && defined(VT_ACTIVATE) case ACTION_SWITCHSCREEN: if (VTSwitchEnabled && !xf86Info.dontVTSwitch && arg) { @@ -443,7 +436,7 @@ xf86CommonSpecialKey(int key, Bool down, int modifiers) void xf86Wakeup(pointer blockData, int err, pointer pReadmask) { -#if !defined(__UNIXOS2__) && !defined(__QNX__) +#if !defined(__QNX__) fd_set* LastSelectMask = (fd_set*)pReadmask; fd_set devicesWithInput; InputInfoPtr pInfo; @@ -470,7 +463,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) } } } -#else /* __UNIXOS2__ and __QNX__ */ +#else /* __QNX__ */ InputInfoPtr pInfo; @@ -490,7 +483,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) pInfo = pInfo->next; } -#endif /* __UNIXOS2__ and __QNX__ */ +#endif /* __QNX__ */ if (err >= 0) { /* we don't want the handlers called if select() */ IHPtr ih; /* returned with an error condition, do we? */ @@ -771,16 +764,6 @@ xf86SigHandler(int signo) FatalError("Caught signal %d. Server aborting\n", signo); } -#ifdef MEMDEBUG -void -xf86SigMemDebug(int signo) -{ - CheckMemory(); - (void) signal(signo, xf86SigMemDebug); - return; -} -#endif - static void xf86ReleaseKeys(DeviceIntPtr pDev) { @@ -877,7 +860,6 @@ xf86VTSwitch() if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); } -#if !defined(__UNIXOS2__) /* * Keep the order: Disable Device > LeaveVT @@ -889,7 +871,6 @@ xf86VTSwitch() DisableDevice(pInfo->dev); pInfo = pInfo->next; } -#endif /* !__UNIXOS2__ */ xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) xf86Screens[i]->LeaveVT(i, 0); @@ -923,7 +904,6 @@ xf86VTSwitch() } SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset); -#if !defined(__UNIXOS2__) pInfo = xf86InputDevs; while (pInfo) { if (pInfo->dev) { @@ -934,7 +914,6 @@ xf86VTSwitch() } /* XXX HACK */ xf86ReleaseKeys(inputInfo.keyboard); -#endif /* !__UNIXOS2__ */ for (ih = InputHandlers; ih; ih = ih->next) xf86EnableInputHandler(ih); @@ -989,7 +968,6 @@ xf86VTSwitch() /* Turn screen saver off when switching back */ SaveScreens(SCREEN_SAVER_FORCER,ScreenSaverReset); -#if !defined(__UNIXOS2__) pInfo = xf86InputDevs; while (pInfo) { if (pInfo->dev) { @@ -1000,7 +978,6 @@ xf86VTSwitch() } /* XXX HACK */ xf86ReleaseKeys(inputInfo.keyboard); -#endif /* !__UNIXOS2__ */ for (ih = InputHandlers; ih; ih = ih->next) xf86EnableInputHandler(ih); diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index e2da752d1..63970dce8 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -484,16 +484,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp, scrp->bitsPerPixelFrom = X_DEFAULT; scrp->depthFrom = X_DEFAULT; -#if BITMAP_SCANLINE_UNIT == 64 - /* - * For platforms with 64-bit scanlines, modify the driver's depth24flags - * to remove preferences for packed 24bpp modes, which are not currently - * supported on these platforms. - */ - depth24flags &= ~(SupportConvert32to24 | SupportConvert32to24 | - PreferConvert24to32 | PreferConvert32to24); -#endif - if (xf86FbBpp > 0) { scrp->bitsPerPixel = xf86FbBpp; scrp->bitsPerPixelFrom = X_CMDLINE; @@ -2444,12 +2434,8 @@ xf86LoadOneModule(char *name, pointer opt) if (!name) return NULL; -#ifndef NORMALISE_MODULE_NAME - Name = xstrdup(name); -#else /* Normalise the module name */ Name = xf86NormalizeName(name); -#endif /* Skip empty names */ if (Name == NULL) diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 0689a5c4b..aa460325b 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1,4 +1,3 @@ - /* * Loosely based on code bearing the following copyright: * @@ -39,15 +38,12 @@ #include <errno.h> #undef HAS_UTSNAME -#if !defined(WIN32) && !defined(__UNIXOS2__) +#if !defined(WIN32) #define HAS_UTSNAME 1 #include <sys/utsname.h> #endif #define NEED_EVENTS -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif #include <X11/X.h> #include <X11/Xmd.h> #include <X11/Xproto.h> @@ -112,10 +108,6 @@ 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 __UNIXOS2__ -extern void os2ServerVideoAccess(); -#endif - #ifdef XF86PM void (*xf86OSPMClose)(void) = NULL; #endif @@ -240,9 +232,6 @@ PostConfigInit(void) #ifdef SIGXFSZ signal(SIGXFSZ,xf86SigHandler); #endif -#ifdef MEMDEBUG - signal(SIGUSR2,xf86SigMemDebug); -#endif } #ifdef XF86PM @@ -496,10 +485,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) Bool pix24Fail = FALSE; Bool autoconfig = FALSE; -#ifdef __UNIXOS2__ - os2ServerVideoAccess(); /* See if we have access to the screen before doing anything */ -#endif - xf86Initialising = TRUE; /* Do this early? */ @@ -557,39 +542,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); } -#ifdef TESTING - { - char **list, **l; - const char *subdirs[] = { - "drivers", - NULL - }; - const char *patlist[] = { - "(.*)_drv\\.so", - "(.*)_drv\\.o", - NULL - }; - ErrorF("Getting module listing...\n"); - list = LoaderListDirs(NULL, NULL); - if (list) - for (l = list; *l; l++) - ErrorF("module: %s\n", *l); - LoaderFreeDirList(list); - ErrorF("Getting video driver listing...\n"); - list = LoaderListDirs(subdirs, NULL); - if (list) - for (l = list; *l; l++) - ErrorF("video driver: %s\n", *l); - LoaderFreeDirList(list); - ErrorF("Getting driver listing...\n"); - list = LoaderListDirs(NULL, patlist); - if (list) - for (l = list; *l; l++) - ErrorF("video driver: %s\n", *l); - LoaderFreeDirList(list); - } -#endif - xf86OpenConsole(); /* Do a general bus probe. This will be a PCI probe for x86 platforms */ @@ -969,7 +921,7 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } *VT = xf86Info.vtno; - VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME), TRUE); + 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, @@ -990,27 +942,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } } -#if BITMAP_SCANLINE_UNIT == 64 - /* - * cfb24 doesn't currently work on architectures with a 64 bit - * BITMAP_SCANLINE_UNIT, so check for 24 bit pixel size for pixmaps - * or framebuffers. - */ - { - Bool usesCfb24 = FALSE; - - if (PIX24TOBPP(pix24) == 24) - usesCfb24 = TRUE; - for (i = 0; i < xf86NumScreens; i++) - if (xf86Screens[i]->bitsPerPixel == 24) - usesCfb24 = TRUE; - if (usesCfb24) { - FatalError("24-bit pixel size is not supported on systems with" - " 64-bit scanlines.\n"); - } - } -#endif - #ifdef XKB xf86InitXkb(); #endif @@ -1167,14 +1098,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86Msg(xf86Info.randRFrom, "RandR %s\n", xf86Info.disableRandR ? "disabled" : "enabled"); #endif -#ifdef NOT_USED - /* - * Here we have to let the driver getting access of the VT. Note that - * this doesn't mean that the graphics board may access automatically - * the monitor. If the monitor is shared this is done in xf86CrossScreen! - */ - if (!xf86Info.sharedMonitor) (xf86Screens[i]->EnterLeaveMonitor)(ENTER); -#endif } xf86PostScreenInit(); @@ -1198,7 +1121,7 @@ InitInput(argc, argv) int argc; char **argv; { - IDevPtr pDev; + IDevPtr* pDev; InputDriverPtr pDrv; InputInfoPtr pInfo; @@ -1207,9 +1130,20 @@ InitInput(argc, argv) if (serverGeneration == 1) { /* Call the PreInit function for each input device instance. */ - for (pDev = xf86ConfigLayout.inputs; pDev && pDev->identifier; pDev++) { - if ((pDrv = xf86LookupInputDriver(pDev->driver)) == NULL) { - xf86Msg(X_ERROR, "No Input driver matching `%s'\n", pDev->driver); + for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { + /* Replace obsolete keyboard driver with kbd */ + if (!xf86NameCmp((*pDev)->driver, "keyboard")) { + xf86MsgVerb(X_WARNING, 0, + "*** WARNING the legacy keyboard driver \"%s\" has been removed\n", + (*pDev)->driver); + xf86MsgVerb(X_WARNING, 0, + "*** Using the new \"kbd\" driver for \"%s\".\n", + (*pDev)->identifier); + 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; } @@ -1219,14 +1153,14 @@ InitInput(argc, argv) pDrv->driverName); continue; } - pInfo = pDrv->PreInit(pDrv, pDev, 0); + pInfo = pDrv->PreInit(pDrv, *pDev, 0); if (!pInfo) { xf86Msg(X_ERROR, "PreInit returned NULL for \"%s\"\n", - pDev->identifier); + (*pDev)->identifier); continue; } else if (!(pInfo->flags & XI86_CONFIGURED)) { xf86Msg(X_ERROR, "PreInit failed for input device \"%s\"\n", - pDev->identifier); + (*pDev)->identifier); xf86DeleteInput(pInfo, 0); continue; } @@ -1265,7 +1199,9 @@ OsVendorInit() signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ #endif OsDelayInitColors = TRUE; +#ifndef BUILTIN_FONTS loadableFonts = TRUE; +#endif if (!beenHere) xf86LogInit(); @@ -1282,9 +1218,7 @@ OsVendorInit() #ifdef O_NONBLOCK if (!beenHere) { -#if !defined(__EMX__) if (geteuid() == 0 && getuid() != geteuid()) -#endif { int status; @@ -1952,7 +1886,7 @@ xf86PrintBanner() t.tm_sec = BUILD_TIME % 100; t.tm_min = (BUILD_TIME / 100) % 100; t.tm_hour = (BUILD_TIME / 10000) % 100; - if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%s%p", &t)) + if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%S%p", &t)) ErrorF("Build Date: %s\n", buf); #else if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) @@ -2055,17 +1989,18 @@ xf86LoadModules(char **list, pointer *optlist) for (i = 0; list[i] != NULL; i++) { -#ifndef NORMALISE_MODULE_NAME - name = xstrdup(list[i]); -#else /* Normalise the module name */ name = xf86NormalizeName(list[i]); -#endif /* Skip empty names */ if (name == NULL || *name == '\0') continue; + /* Replace obsolete keyboard driver with kbd */ + if (!xf86NameCmp(name, "keyboard")) { + strcpy(name, "kbd"); + } + if (optlist) opt = optlist[i]; else diff --git a/hw/xfree86/common/xf86MiscExt.c b/hw/xfree86/common/xf86MiscExt.c index 652428489..655304e8b 100644 --- a/hw/xfree86/common/xf86MiscExt.c +++ b/hw/xfree86/common/xf86MiscExt.c @@ -34,10 +34,6 @@ #include <xorg-config.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif - #include <X11/X.h> #include "os.h" #include "xf86.h" diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index b343788fc..7fcce10b1 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -458,7 +458,6 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, int ModePrivFlags = 0; ModeStatus status = MODE_NOMODE; Bool allowDiv2 = (strategy & LOOKUP_CLKDIV2) != 0; - Bool haveBuiltin; int n; const int types[] = { M_T_BUILTIN | M_T_PREFERRED, @@ -1473,6 +1472,12 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, scrp->monitor->vrefresh[i].lo, scrp->monitor->vrefresh[i].hi); } + if (scrp->monitor->maxPixClock) { + xf86DrvMsg(scrp->scrnIndex, X_INFO, + "%s: Using maximum pixel clock of %.2f MHz\n", + scrp->monitor->id, + (float)scrp->monitor->maxPixClock / 1000.0); + } } /* @@ -2038,6 +2043,7 @@ xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags) } +#if 0 static void add(char **p, char *new) { @@ -2046,7 +2052,6 @@ add(char **p, char *new) strcat(*p, new); } -#if 0 _X_EXPORT void xf86PrintModeline(int scrnIndex,DisplayModePtr mode) { diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index cdf3d1bea..20d8b4413 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -1,4 +1,3 @@ - /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. * @@ -85,7 +84,7 @@ typedef enum { */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 3) #define ABI_VIDEODRV_VERSION SET_ABI_VERSION(2, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(1, 1) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(2, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(0, 3) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 5) @@ -93,11 +92,7 @@ typedef enum { #define MODINFOSTRING2 0x10dc023a #ifndef MODULEVENDORSTRING -#ifndef __OS2ELF__ #define MODULEVENDORSTRING "X.Org Foundation" -#else -#define MODULEVENDORSTRING "X.Org Foundation - OS2" -#endif #endif /* Error return codes for errmaj. New codes must only be added at the end. */ diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c index ac8896879..a6bcc3421 100644 --- a/hw/xfree86/common/xf86PM.c +++ b/hw/xfree86/common/xf86PM.c @@ -74,13 +74,11 @@ suspend (pmEvent event, Bool undo) if (xf86Screens[i]->EnableDisableFBAccess) (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); } -#if !defined(__EMX__) pInfo = xf86InputDevs; while (pInfo) { DisableDevice(pInfo->dev); pInfo = pInfo->next; } -#endif xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { xf86EnableAccess(xf86Screens[i]); @@ -119,13 +117,11 @@ resume(pmEvent event, Bool undo) (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); } SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset); -#if !defined(__EMX__) pInfo = xf86InputDevs; while (pInfo) { EnableDevice(pInfo->dev); pInfo = pInfo->next; } -#endif xf86inSuspend = FALSE; } diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 274f7e754..3da102f5d 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -172,9 +172,6 @@ void xf86PostKbdEvent(unsigned key); void xf86PostMseEvent(DeviceIntPtr device, int buttons, int dx, int dy); void xf86Wakeup(pointer blockData, int err, pointer pReadmask); void xf86SigHandler(int signo); -#ifdef MEMDEBUG -void xf86SigMemDebug(int signo); -#endif void xf86HandlePMEvents(int fd, pointer data); extern int (*xf86PMGetEventFromOs)(int fd,pmEvent *events,int num); extern pmWait (*xf86PMConfirmEventToOs)(int fd,pmEvent event); diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 7ca0669a5..09ebb0717 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -138,6 +138,9 @@ typedef struct { Bool allowEmptyInput; /* Allow the server to start with no input * devices. */ + Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */ + Bool autoEnableDevices; /* Whether to enable, or let the client + * control. */ } xf86InfoRec, *xf86InfoPtr; #ifdef DPMSExtension diff --git a/hw/xfree86/common/xf86Version.h b/hw/xfree86/common/xf86Version.h index f7ac89b1b..b93ac7d23 100644 --- a/hw/xfree86/common/xf86Version.h +++ b/hw/xfree86/common/xf86Version.h @@ -1,4 +1,3 @@ - /* * Copyright (c) 1994-2003 by The XFree86 Project, Inc. * @@ -55,5 +54,3 @@ 0) #endif - -/* $XConsortium: xf86Version.h /main/78 1996/10/28 05:42:10 kaleb $ */ diff --git a/hw/xfree86/common/xf86XKB.c b/hw/xfree86/common/xf86XKB.c index b805885bd..11694544a 100644 --- a/hw/xfree86/common/xf86XKB.c +++ b/hw/xfree86/common/xf86XKB.c @@ -1,4 +1,3 @@ -/* $XConsortium: xf86XKB.c /main/4 1996/02/04 09:28:04 kaleb $ */ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index c08b15f7e..e45d44c02 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -45,7 +45,6 @@ * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ -/* $XConsortium: xf86Xinput.c /main/14 1996/10/27 11:05:25 kaleb $ */ #ifdef HAVE_XORG_CONFIG_H #include <xorg-config.h> @@ -84,9 +83,7 @@ #include <stdarg.h> -#include "osdep.h" /* EnabledDevices */ #include <X11/Xpoll.h> -#include "xf86_OSproc.h" /* sigio stuff */ #include "mi.h" @@ -207,17 +204,6 @@ OpenInputDevice(DeviceIntPtr dev, if (!dev->inited) ActivateDevice(dev); - if (!dev->public.on) { - if (EnableDevice(dev)) { - dev->startup = FALSE; - } - else { - ErrorF("couldn't enable device %s\n", dev->name); - *status = BadDevice; - return; - } - } - *status = Success; } @@ -300,6 +286,7 @@ ChangeDeviceControl (ClientPtr client, DeviceIntPtr dev, xDeviceCtl *control) case DEVICE_RESOLUTION: case DEVICE_ABS_CALIB: case DEVICE_ABS_AREA: + case DEVICE_ENABLE: return Success; default: return BadMatch; @@ -325,6 +312,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) InputOption *option = NULL; DeviceIntPtr dev = NULL; int rval = Success; + int is_auto = 0; idev = xcalloc(sizeof(*idev), 1); if (!idev) @@ -340,7 +328,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) * test if the module is already loaded first */ drv = xf86LookupInputDriver(option->value); if (!drv) - if(xf86LoadOneModule(option->value, NULL)) + if (xf86LoadOneModule(option->value, NULL)) drv = xf86LookupInputDriver(option->value); if (!drv) { xf86Msg(X_ERROR, "No input driver matching `%s'\n", @@ -354,6 +342,7 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) goto unwind; } } + if (strcasecmp(option->key, "name") == 0 || strcasecmp(option->key, "identifier") == 0) { if (idev->identifier) { @@ -366,8 +355,19 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) goto unwind; } } + + /* Right now, the only automatic config we know of is HAL. */ + if (strcmp(option->key, "_source") == 0 && + strcmp(option->value, "server/hal") == 0) { + if (!xf86Info.autoAddDevices) { + rval = BadMatch; + goto unwind; + } + + is_auto = 1; + } } - if(!idev->driver || !idev->identifier) { + if (!idev->driver || !idev->identifier) { xf86Msg(X_ERROR, "No input driver/identifier specified (ignoring)\n"); rval = BadRequest; goto unwind; @@ -408,7 +408,10 @@ NewInputDeviceRequest (InputOption *options, DeviceIntPtr *pdev) dev = pInfo->dev; ActivateDevice(dev); - if (dev->inited && dev->startup && xf86Screens[0]->vtSema) + /* Enable it if it's properly initialised, we're currently in the VT, and + * either it's a manual request, or we're automatically enabling devices. */ + if (dev->inited && dev->startup && xf86Screens[0]->vtSema && + (!is_auto || xf86Info.autoEnableDevices)) EnableDevice(dev); *pdev = dev; diff --git a/hw/xfree86/common/xf86Xinput.h b/hw/xfree86/common/xf86Xinput.h index f882b2608..d88bbbeee 100644 --- a/hw/xfree86/common/xf86Xinput.h +++ b/hw/xfree86/common/xf86Xinput.h @@ -1,4 +1,3 @@ -/* $XConsortium: xf86Xinput.h /main/11 1996/10/27 11:05:29 kaleb $ */ /* * Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org> * diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 7fb884232..0365ddd62 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -516,7 +516,7 @@ typedef struct _serverlayoutrec { char * id; screenLayoutPtr screens; GDevPtr inactives; - IDevPtr inputs; + IDevPtr* inputs; /* NULL terminated */ pointer options; } serverLayoutRec, *serverLayoutPtr; diff --git a/hw/xfree86/common/xisb.c b/hw/xfree86/common/xisb.c index 88506f659..d021ec15b 100644 --- a/hw/xfree86/common/xisb.c +++ b/hw/xfree86/common/xisb.c @@ -39,10 +39,6 @@ #include <xorg-config.h> #endif -#ifdef __UNIXOS2__ -#define I_NEED_OS2_H -#endif - #include <misc.h> #include <xf86.h> #include <xf86Version.h> diff --git a/hw/xfree86/common/xisb.h b/hw/xfree86/common/xisb.h index 01ae675c4..b7bdd5682 100644 --- a/hw/xfree86/common/xisb.h +++ b/hw/xfree86/common/xisb.h @@ -24,7 +24,6 @@ * in this Software without prior written authorization from Metro Link. * */ -/* $XFree86$ */ #ifndef _xisb_H_ #define _xisb_H_ |