diff options
author | dawes <dawes> | 2000-11-08 02:53:41 +0000 |
---|---|---|
committer | dawes <dawes> | 2000-11-08 02:53:41 +0000 |
commit | 23d67f1befe18a4aba21b7cae48f3d293cfed1ee (patch) | |
tree | 2cdf6024b3a671041104d5d95b909f6cfe1b751d /xc/programs/Xserver/hw/xfree86/common | |
parent | f93d27aa9ffc3e26ebb937ccd8dfe3319315c70c (diff) |
Import of XFree86 4.0.1eX_4_0_1e
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/common')
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/Imakefile | 7 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/compiler.h | 25 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86.h | 4 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Bus.c | 3 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Config.c | 16 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Configure.c | 25 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Events.c | 44 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Helper.c | 148 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Init.c | 66 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Io.c | 35 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86PM.c | 14 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h | 6 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Priv.h | 3 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h | 3 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xf86xv.h | 6 | ||||
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/common/xisb.c | 5 |
16 files changed, 239 insertions, 171 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/common/Imakefile b/xc/programs/Xserver/hw/xfree86/common/Imakefile index a6c5643d6..9ac94f282 100644 --- a/xc/programs/Xserver/hw/xfree86/common/Imakefile +++ b/xc/programs/Xserver/hw/xfree86/common/Imakefile @@ -4,7 +4,7 @@ XCOMM $XConsortium: Imakefile /main/34 1996/10/27 11:05:08 kaleb $ -XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.121 2000/09/19 12:46:12 eich Exp $ +XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.123 2000/11/03 18:46:05 eich Exp $ @@ -53,7 +53,7 @@ XCOMM $XFree86: xc/programs/Xserver/hw/xfree86/common/Imakefile,v 3.121 2000/09/ #endif MODPATHDEFINES = -DDEFAULT_MODULE_PATH=\"$(MODULEDIR)\" -LOGDEFINES = -DDEFAULT_LOGPREFIX=\"$(LOGDIRECTORY)/XFree86.\" +LOGDEFINES = -DDEFAULT_LOGPREFIX=\"$(LOGDIRECTORY)/XLogFile.\" #if DoLoadableServer EXT_MODULES_DEFINES = $(GLX_DEFINES) @@ -182,6 +182,8 @@ PROJECTROOT = ProjectRoot XCONFIGDEFINES = -DPROJECTROOT='"$(PROJECTROOT)"' \ -DDRIVERS='"$(DRIVERS)"' \ -DIDRIVERS='"$(IDRIVERS)"' +XF86CONFIGFILE = XConfigFile +XCONFIGUREDEFINES = -DXF86CONFIGFILE='"$(XF86CONFIGFILE)"' DEFINES = $(CONSDEFINES) $(KBDDEFINES) $(EXT_DEFINES) $(OSDEFINES) @@ -192,6 +194,7 @@ SpecialCObjectRule(xf86Init,$(ICONFIGFILES),$(OSNAMEDEF) $(BUILDERMSG) $(BUGMSG) SpecialCObjectRule(xf86Events,$(ICONFIGFILES),$(EXT_DEFINES)) SpecialCObjectRule(xf86Globals,$(ICONFIGFILES),$(EXT_DEFINES) $(MODPATHDEFINES) $(LOGDEFINES)) SpecialCObjectRule(xf86Config,$(ICONFIGFILES),$(XCONFIGDEFINES)) +SpecialCObjectRule(xf86Configure,$(ICONFIGFILES),$(XCONFIGUREDEFINES)) #if NeedXF86Beta SpecialCObjectRule($(BETAOBJ),NullParameter,$(EXP_DEFINES)) diff --git a/xc/programs/Xserver/hw/xfree86/common/compiler.h b/xc/programs/Xserver/hw/xfree86/common/compiler.h index 5d6f24ce2..2d3b1465e 100644 --- a/xc/programs/Xserver/hw/xfree86/common/compiler.h +++ b/xc/programs/Xserver/hw/xfree86/common/compiler.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.71 2000/10/20 12:57:25 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.73 2000/11/06 19:24:05 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -355,6 +355,7 @@ static __inline__ void stw_u(unsigned long r5, unsigned short * r11) #endif } +/* to flush the I-cache before jumping to code which just got loaded */ #define PAL_imb 134 #define istream_mem_barrier() \ __asm__ __volatile__("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") @@ -828,7 +829,7 @@ static __inline__ unsigned long ldw_u(unsigned short * r11) #define write_mem_barrier() /* NOP */ #endif /* __arm32__ */ -#elif (defined(Lynx) || defined(linux)) && defined(__powerpc__) +#elif (defined(Lynx) || defined(linux) || defined(__OpenBSD__)) && defined(__powerpc__) #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) @@ -847,7 +848,7 @@ xf86ReadMmio8(void *base, const unsigned long offset) "eieio" : "=r" (val) : "b" (base), "r" (offset), - "m" (*(volatile unsigned char *)(base+offset))); + "m" (*((volatile unsigned char *)base+offset))); return(val); } @@ -860,7 +861,7 @@ xf86ReadMmio16Be(void *base, const unsigned long offset) "eieio" : "=r" (val) : "b" (base), "r" (offset), - "m" (*(volatile unsigned char *)(base+offset))); + "m" (*((volatile unsigned char *)base+offset))); return(val); } @@ -873,7 +874,7 @@ xf86ReadMmio16Le(void *base, const unsigned long offset) "eieio" : "=r" (val) : "b" (base), "r" (offset), - "m" (*(volatile unsigned char *)(base+offset))); + "m" (*((volatile unsigned char *)base+offset))); return(val); } @@ -886,7 +887,7 @@ xf86ReadMmio32Be(void *base, const unsigned long offset) "eieio" : "=r" (val) : "b" (base), "r" (offset), - "m" (*(volatile unsigned char *)(base+offset))); + "m" (*((volatile unsigned char *)base+offset))); return(val); } @@ -899,7 +900,7 @@ xf86ReadMmio32Le(void *base, const unsigned long offset) "eieio" : "=r" (val) : "b" (base), "r" (offset), - "m" (*(volatile unsigned char *)(base+offset))); + "m" (*((volatile unsigned char *)base+offset))); return(val); } @@ -909,7 +910,7 @@ xf86WriteMmioNB8(void *base, const unsigned long offset, { __asm__ __volatile__( "stbx %1,%2,%3\n\t" - : "=m" (*(volatile unsigned char *)(base+offset)) + : "=m" (*((volatile unsigned char *)base+offset)) : "r" (val), "b" (base), "r" (offset)); } @@ -919,7 +920,7 @@ xf86WriteMmioNB16Le(void *base, const unsigned long offset, { __asm__ __volatile__( "sthbrx %1,%2,%3\n\t" - : "=m" (*(volatile unsigned char *)(base+offset)) + : "=m" (*((volatile unsigned char *)base+offset)) : "r" (val), "b" (base), "r" (offset)); } @@ -929,7 +930,7 @@ xf86WriteMmioNB16Be(void *base, const unsigned long offset, { __asm__ __volatile__( "sthx %1,%2,%3\n\t" - : "=m" (*(volatile unsigned char *)(base+offset)) + : "=m" (*((volatile unsigned char *)base+offset)) : "r" (val), "b" (base), "r" (offset)); } @@ -939,7 +940,7 @@ xf86WriteMmioNB32Le(void *base, const unsigned long offset, { __asm__ __volatile__( "stwbrx %1,%2,%3\n\t" - : "=m" (*(volatile unsigned char *)(base+offset)) + : "=m" (*((volatile unsigned char *)base+offset)) : "r" (val), "b" (base), "r" (offset)); } @@ -949,7 +950,7 @@ xf86WriteMmioNB32Be(void *base, const unsigned long offset, { __asm__ __volatile__( "stwx %1,%2,%3\n\t" - : "=m" (*(volatile unsigned char *)(base+offset)) + : "=m" (*((volatile unsigned char *)base+offset)) : "r" (val), "b" (base), "r" (offset)); } diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86.h b/xc/programs/Xserver/hw/xfree86/common/xf86.h index 0a646408e..17f49691d 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.142 2000/09/19 12:46:12 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.143 2000/10/30 23:02:10 tsi Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -235,6 +235,7 @@ const char *xf86GetServerName(void); Bool xf86ServerIsExiting(void); Bool xf86ServerIsResetting(void); Bool xf86ServerIsInitialising(void); +Bool xf86ServerIsOnlyDetecting(void); Bool xf86ServerIsOnlyProbing(void); Bool xf86CaughtSignal(void); Bool xf86GetVidModeAllowNonLocal(void); @@ -245,6 +246,7 @@ Bool xf86GetAllowMouseOpenFail(void); Bool xf86IsPc98(void); pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name); pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name); +pointer xf86LoadOneModule(char *name, pointer optlist); void xf86UnloadSubModule(pointer mod); Bool xf86LoaderCheckSymbol(const char *name); void xf86LoaderReqSymLists(const char **, ...); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c index 3de78801d..9f1c08caa 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Bus.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.54 2000/10/11 22:52:52 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.55 2000/11/02 16:46:17 tsi Exp $ */ /* * Copyright (c) 1997-1999 by The XFree86 Project, Inc. */ @@ -418,6 +418,7 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev) pEnt->devices = xnfrealloc(pEnt->devices, pEnt->numInstances * sizeof(GDevPtr)); pEnt->devices[pEnt->numInstances - 1] = dev; + dev->claimed = TRUE; } /* diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c index 383b00039..49e5b540a 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Config.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Config.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.233 2000/10/24 18:07:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Config.c,v 3.234 2000/11/06 19:24:06 dawes Exp $ */ /* @@ -992,6 +992,20 @@ configInputKbd(IDevPtr inputp) xf86Info.kbdEvents = xf86XqueEvents; xf86Msg(X_CONFIG, "Xqueue selected for keyboard input\n"); #endif +#ifdef WSCONS_SUPPORT + } else if (xf86NameCmp(s, "wskbd") == 0) { + int xf86WSKbdProc(DeviceIntPtr, int); + + xf86Info.kbdProc = xf86WSKbdProc; + xf86Info.kbdEvents = xf86KbdEvents; + s = xf86SetStrOption(inputp->commonOptions, "Device", NULL); + xf86Msg(X_CONFIG, "Keyboard: Protocol: wskbd\n"); + xf86Info.kbdFd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); + if (xf86Info.kbdFd == -1) { + xf86ConfigError("cannot open \"%s\"", s); + return FALSE; + } +#endif } else { xf86ConfigError("\"%s\" is not a valid keyboard protocol name", s); return FALSE; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c index 18f02534a..b7c196f5e 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Configure.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.41 2000/10/20 14:58:59 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Configure.c,v 3.43 2000/11/03 18:46:06 eich Exp $ */ /* * Copyright 2000 by Alan Hourihane, Sychdyn, North Wales. * @@ -116,6 +116,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int { int i, j; pciVideoPtr pVideo = NULL; + Bool isPrimary = FALSE; if (xf86DoProbe || !xf86DoConfigure || !xf86DoConfigurePass1) return NULL; @@ -130,6 +131,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int (DevToConfig[i].pVideo->device == pVideo->device) && (DevToConfig[i].pVideo->func == pVideo->func)) return NULL; + isPrimary = xf86IsPrimaryPci(pVideo); break; case BUS_ISA: /* @@ -138,6 +140,7 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int */ if (!xf86IsPrimaryIsa()) return NULL; + isPrimary = TRUE; for (i = 0; i < nDevToConfig; i++) if (!DevToConfig[i].pVideo) return NULL; @@ -158,6 +161,13 @@ xf86AddBusDeviceToConfigure(const char *driver, BusType bus, void *busData, int i = nDevToConfig++; DevToConfig = xnfrealloc(DevToConfig, nDevToConfig * sizeof(DevToConfigRec)); +#if 1 + if (i > 0 && isPrimary) { + memmove(DevToConfig + 1,DevToConfig, + (nDevToConfig - 1) * sizeof(DevToConfigRec)); + i = 0; + } +#endif memset(DevToConfig + i, 0, sizeof(DevToConfigRec)); # define NewDevice DevToConfig[i] @@ -549,12 +559,12 @@ configureFilesSection (void) parsePrologue (XF86ConfFilesPtr, XF86ConfFilesRec) #ifdef XFree86LOADER - if (xf86ModulePath && xf86ModPathFrom == X_CMDLINE) + if (xf86ModulePath) ptr->file_modulepath = strdup(xf86ModulePath); #endif - if (xf86fpFlag && defaultFontPath) + if (defaultFontPath) ptr->file_fontpath = strdup(defaultFontPath); - if (xf86coFlag && rgbPath) + if (rgbPath) ptr->file_rgbpath = strdup(rgbPath); return ptr; @@ -700,19 +710,20 @@ DoConfigure() #ifdef __EMX__ #define PATH_MAX 2048 #endif + const char* configfile = XF86CONFIGFILE".new"; char homebuf[PATH_MAX]; /* getenv might return R/O memory, as with OS/2 */ strncpy(homebuf,home,PATH_MAX-1); homebuf[PATH_MAX-1] = '\0'; home = homebuf; - + ErrorF("CONFIGFILE %s\n",configfile); if (!(filename = (char *)ALLOCATE_LOCAL(strlen(home) + - strlen("XF86Config.new") + 3))) + strlen(configfile) + 3))) if (home[0] == '/' && home[1] == '\0') home[0] = '\0'; - sprintf(filename, "%s/XF86Config.new", home); + sprintf(filename, "%s/%s", home,configfile); } xf86writeConfigFile(filename, xf86config); diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c index 05b90b876..459fb28c9 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Events.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Events.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.98 2000/10/17 16:53:16 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 3.100 2000/11/06 19:24:06 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -1168,9 +1168,10 @@ xf86VTSwitch() xf86EnableInputHandler(ih); } else { - if (xf86OSPMClose) - xf86OSPMClose(); - + if (xf86OSPMClose) + xf86OSPMClose(); + xf86OSPMClose = NULL; + for (i = 0; i < xf86NumScreens; i++) { /* * zero all access functions to @@ -1346,3 +1347,38 @@ XTestGenerateEvent(int dev_type, int keycode, int keystate, int mousex, #endif /* XTESTEXT1 */ +#ifdef WSCONS_SUPPORT + +/* XXX Currently XKB is mandatory. */ + +void +xf86PostWSKbdEvent(struct wscons_event *event) +{ + int type = event->type; + int value = event->value; + Bool down = (type == WSCONS_EVENT_KEY_DOWN ? TRUE : FALSE); + KeyClassRec *keyc = ((DeviceIntPtr)xf86Info.pKeyboard)->key; + xEvent kevent; + KeySym *keysym; + int keycode; + + /* + * Now map the scancodes to real X-keycodes ... + */ + keycode = value + MIN_KEYCODE; + keysym = keyc->curKeySyms.map + + keyc->curKeySyms.mapWidth * (keycode - keyc->curKeySyms.minKeyCode); + + /* + * check for an autorepeat-event + */ + if ((down && KeyPressed(keycode)) && + (xf86Info.autoRepeat != AutoRepeatModeOn || keyc->modifierMap[keycode])) + return; + + xf86Info.lastEventTime = kevent.u.keyButtonPointer.time + = event->time.tv_sec * 1000 + event->time.tv_nsec / 1000000; + + ENQUEUE(&kevent, keycode, (down ? KeyPress : KeyRelease), XE_KEYBOARD); +} +#endif /* WSCONS_SUPPORT */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c index b49b3028c..789eedbac 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Helper.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.97 2000/10/27 18:31:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.100 2000/11/03 18:46:06 eich Exp $ */ /* * Copyright (c) 1997-1998 by The XFree86 Project, Inc. @@ -768,10 +768,12 @@ xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual) /* Check if the visual is valid for the depth */ if (scrp->depth == 1 && scrp->defaultVisual != StaticGray) bad = TRUE; +#if 0 else if (scrp->depth == 4 && (scrp->defaultVisual == TrueColor || scrp->defaultVisual == DirectColor)) bad = TRUE; +#endif else if (scrp->depth > MAX_PSEUDO_DEPTH && scrp->defaultVisual != TrueColor && scrp->defaultVisual != DirectColor) @@ -1446,17 +1448,12 @@ xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips) int -xf86MatchDevice(const char *drivername, GDevPtr **driversectlist) +xf86MatchDevice(const char *drivername, GDevPtr **sectlist) { - static char * drivernames[MAXDRIVERS]; - static GDevPtr * devices[MAXDRIVERS]; - static int count[MAXDRIVERS]; - GDevPtr gdp; + GDevPtr gdp, *pgdp = NULL; confScreenPtr screensecptr; int i,j; - *driversectlist = NULL; - if (xf86DoProbe) return 1; if (xf86DoConfigure && xf86DoConfigurePass1) return 1; @@ -1465,48 +1462,18 @@ xf86MatchDevice(const char *drivername, GDevPtr **driversectlist) * This is a very important function that matches the device sections * as they show up in the config file with the drivers that the server * loads at run time. - + * * ChipProbe can call - * int xf86MatchDevice(char * drivername, GDevPtr * driversectlist) + * int xf86MatchDevice(char * drivername, GDevPtr ** sectlist) * with its driver name. The function allocates an array of GDevPtr and - * returns this via driversectlist and returns the number of elements in + * returns this via sectlist and returns the number of elements in * this list as return value. 0 means none found, -1 means fatal error. * * It can figure out which of the Device sections to use for which card * (using things like the Card statement, etc). For single headed servers * there will of course be just one such Device section. - * - * If there's no Device section with matching name, then xf86MatchDevice() - * returns the first Device section without a Driver statement. This will - * again work out ok in a single headed environment. - */ - /* - * in order to be able to access the results of these queries again, we - * keep two parallel static arrays, one holding the name of the driver, - * the other holding the coresponding Device section pointers. - * So first, we need to check if the query has already been answered - * and simply return that old answer if this is the case. */ i = 0; - while (drivernames[i] && i < MAXDRIVERS) { - if (xf86NameCmp(drivername,drivernames[i]) == 0) { - /* - * we already had that one - */ - *driversectlist = devices[i]; - return count[i]; - } - i++; - } - - if (i == MAXDRIVERS) - return -1; - - /* - * if we get here, this is a new name - */ - drivernames[i] = xstrdup(drivername); - count[i] = 0; /* * first we need to loop over all the Screens sections to get to all @@ -1520,10 +1487,8 @@ xf86MatchDevice(const char *drivername, GDevPtr **driversectlist) /* * we have a matching driver that wasn't claimed, yet */ - screensecptr->device->claimed = TRUE; - devices[i] = xnfrealloc(devices[i], - (count[i] + 2) * sizeof(GDevPtr)); - devices[i][count[i]++] = screensecptr->device; + pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); + pgdp[i++] = screensecptr->device; } } @@ -1534,50 +1499,23 @@ xf86MatchDevice(const char *drivername, GDevPtr **driversectlist) if (gdp->driver && !gdp->claimed && !xf86NameCmp(gdp->driver,drivername)) { /* we have a matching driver that wasn't claimed yet */ - gdp->claimed = TRUE; - devices[i] = - xnfrealloc(devices[i], (count[i] + 2) * sizeof(GDevPtr)); - devices[i][count[i]++] = gdp; + pgdp = xnfrealloc(pgdp, (i + 2) * sizeof(GDevPtr)); + pgdp[i++] = gdp; } j++; } -#if 0 - /* - * XXX The parser won't let devices with no Driver name through, so - * this can be removed. - */ - if (count[i] == 0) { - /* - * we haven't found a single one, let's try to find one that - * wasn't claimed and has no driver given - */ - for (j=0; xf86ConfigLayout.screens[j].screen != NULL; j++) { - screensecptr = xf86ConfigLayout.screens[j].screen; - if ((screensecptr->device->driver == NULL) - && (! screensecptr->device->claimed)) { - /* - * we have a device section without driver that wasn't claimed - */ - screensecptr->device->claimed = TRUE; - devices[i] = xnfrealloc(devices[i], - (count[i] + 2) * sizeof(GDevPtr)); - devices[i][count[i]++] = screensecptr->device; - } - } - } -#endif /* * make the array NULL terminated and return its address */ - if( count[i] ) - devices[i][count[i]] = NULL; - else - devices[i] = NULL; - - *driversectlist = devices[i]; + if (i) + pgdp[i] = NULL; - return count[i]; + if (sectlist) + *sectlist = pgdp; + else + xfree(pgdp); + return i; } struct Inst { @@ -2246,6 +2184,13 @@ xf86ServerIsInitialising() Bool +xf86ServerIsOnlyDetecting(void) +{ + return xf86DoProbe || xf86DoConfigure; +} + + +Bool xf86ServerIsOnlyProbing(void) { return xf86ProbeOnly; @@ -2337,6 +2282,47 @@ xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name) #endif } +/* + * xf86LoadOneModule loads a single module. + */ +pointer +xf86LoadOneModule(char *name, pointer opt) +{ +#ifdef XFree86LOADER + int errmaj, errmin; +#endif + char *Name; + pointer mod; + + 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) + return NULL; + if (*Name == '\0') { + xfree(Name); + return NULL; + } + +#ifdef XFree86LOADER + mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin); + if (!mod) + LoaderErrorMsg(NULL, Name, errmaj, errmin); +#else + mod = (pointer)1; +#endif + xfree(Name); + return mod; +} + void xf86UnloadSubModule(pointer mod) { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c index b4f982d47..19b9c198c 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Init.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Init.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.167 2000/10/27 18:31:02 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.170 2000/11/03 18:46:07 eich Exp $ */ /* * Copyright 1991-1999 by The XFree86 Project, Inc. @@ -733,9 +733,16 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) */ xf86OpenConsole(); + /* + should we reopen it here? We need to deal with an already opened + device. We could leave this to the OS layer. For now we simply + close it here + */ + if (xf86OSPMClose) + xf86OSPMClose(); if ((xf86OSPMClose = xf86OSPMOpen()) != NULL) xf86MsgVerb(3,X_INFO,"APM registered successfully\n"); - + /* Make sure full I/O access is enabled */ xf86EnableIO(); } @@ -1049,7 +1056,8 @@ ddxGiveUp() xf86CloseConsole(); if (xf86OSPMClose) xf86OSPMClose(); - + xf86OSPMClose = NULL; + xf86CloseLog(); /* If an unexpected signal was caught, dump a core for debugging */ @@ -1537,19 +1545,28 @@ ddxUseMsg() #ifndef OSVENDOR #define OSVENDOR "" #endif +#ifndef PRE_RELEASE +#define PRE_RELEASE (XF86_VERSION_BETA || XF86_VERSION_ALPHA) +#endif static void xf86PrintBanner() { +#if PRE_RELEASE + ErrorF("\n" + "This is a pre-release version of XFree86, and is not supported in any\n" + "way. Bugs may be reported to XFree86@XFree86.Org and patches submitted\n" + "to fixes@XFree86.Org. Before reporting bugs in pre-release versions,\n" + "please check the latest version in the XFree86 CVS repository\n" + "(http://www.XFree86.Org/cvs)\n"); +#endif ErrorF("\nXFree86 Version%s/ X Window System\n", XF86_VERSION); ErrorF("(protocol Version %d, revision %d, vendor release %d)\n", X_PROTOCOL, X_PROTOCOL_REVISION, VENDOR_RELEASE ); ErrorF("Release Date: %s\n", XF86_DATE); - ErrorF("\tIf the server is older than 6-12 months, or if your card is " - "newer\n" - "\tthan the above date, look for a newer version before " - "reporting\n" - "\tproblems. (see http://www.XFree86.Org/FAQ)\n"); + ErrorF("\tIf the server is older than 6-12 months, or if your card is\n" + "\tnewer than the above date, look for a newer version before\n" + "\treporting problems. (See http://www.XFree86.Org/FAQ)\n"); ErrorF("Operating System:%s%s\n", OSNAME, OSVENDOR); #if defined(BUILDERSTRING) ErrorF("%s \n",BUILDERSTRING); @@ -1638,39 +1655,6 @@ xf86LoadModules(char **list, pointer *optlist) return !failed; } -/* - * xf86LoadOneModule loads a single module. - */ -pointer -xf86LoadOneModule(char *name, pointer opt) -{ - int errmaj, errmin; - char *Name; - pointer mod; - - 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 || *Name == '\0') - return NULL; - - if (!(mod = LoadModule(Name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin))){ - LoaderErrorMsg(NULL, Name, errmaj, errmin); - xfree(Name); - return FALSE; - } - xfree(Name); - return mod; -} - #endif /* Pixmap format stuff */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Io.c b/xc/programs/Xserver/hw/xfree86/common/xf86Io.c index d8642b65b..4b2e731a4 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Io.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Io.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.40 2000/08/10 17:40:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Io.c,v 3.41 2000/11/06 19:24:06 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -411,3 +411,36 @@ GetTimeInMillis() } #endif /* !AMOEBA && !(sun || SVR4) && !MINIX */ +#ifdef WSCONS_SUPPORT + +#define NUMEVENTS 64 + +static void +wsconssig(fd, closure) + int fd; + void *closure; +{ + static struct wscons_event events[NUMEVENTS]; + int n, i; + + n = read(fd, events, sizeof events); + if (n <= 0) + return; + n /= sizeof(struct wscons_event); + for (i = 0; i < n; i++) + xf86PostWSKbdEvent(&events[i]); +} + +int +xf86WSKbdProc(pKeyboard, what) + DeviceIntPtr pKeyboard; /* Keyboard to manipulate */ + int what; /* What to do to it */ +{ + switch (what) { + case DEVICE_INIT: + xf86FlushInput(xf86Info.kbdFd); + xf86InstallSIGIOHandler(xf86Info.kbdFd, wsconssig, pKeyboard); + } + return xf86KbdProc(pKeyboard, what); +} +#endif /* WSCONS_SUPPORT */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PM.c b/xc/programs/Xserver/hw/xfree86/common/xf86PM.c index f260270e9..5ac6dbd7f 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86PM.c +++ b/xc/programs/Xserver/hw/xfree86/common/xf86PM.c @@ -1,6 +1,5 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.2 2000/02/12 23:59:10 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PM.c,v 3.3 2000/11/03 18:46:07 eich Exp $ */ -#define NOT_YET #include "X.h" #include "xf86.h" @@ -34,9 +33,10 @@ eventName(pmEvent event) static void DoApmEvent(pmEvent event) { - /* we leave that as a global for now. I don't know if this might - * cause problems in the future. It is a global server variable - * therefore it needs to be in a server info structure + /* + * we leave that as a global function for now. I don't know if + * this might cause problems in the future. It is a global server + * variable therefore it needs to be in a server info structure */ static Bool suspended; int i; @@ -49,7 +49,6 @@ DoApmEvent(pmEvent event) case XF86_APM_USER_SUSPEND: /* should we do this ? */ if (!suspended) { -#ifdef NOT_YET for (i = 0; i < xf86NumScreens; i++) { xf86EnableAccess(xf86Screens[i]); if (xf86Screens[i]->EnableDisableFBAccess) @@ -65,7 +64,6 @@ DoApmEvent(pmEvent event) } xf86AccessLeave(); xf86AccessLeaveState(); -#endif suspended = TRUE; } break; @@ -75,7 +73,6 @@ DoApmEvent(pmEvent event) case XF86_APM_STANDBY_FAILED: case XF86_APM_SUSPEND_FAILED: if (suspended) { -#ifdef NOT_YET xf86AccessEnter(); xf86EnterServerState(SETUP); for (i = 0; i < xf86NumScreens; i++) { @@ -92,7 +89,6 @@ DoApmEvent(pmEvent event) (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); } SaveScreens(SCREEN_SAVER_FORCER, ScreenSaverReset); -#endif suspended = FALSE; } break; diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h index 39b6472e7..4fddde903 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.75 2000/10/23 21:16:45 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86PciInfo.h,v 1.76 2000/11/02 22:15:46 robin Exp $ */ /* * PCI Probe * @@ -1011,8 +1011,8 @@ static pciVendorDeviceInfo xf86PCIVendorInfoData[] = { {PCI_VENDOR_NUMNINE, { {PCI_CHIP_I128, "Imagine 128",0}, {PCI_CHIP_I128_2, "Imagine 128 II",0}, - {PCI_CHIP_I128_T2R, "Imagine 128 T2R",0}, - {PCI_CHIP_I128_T2R4, "Imagine 128 T2R4",0}, + {PCI_CHIP_I128_T2R, "Imagine 128 Rev 3D T2R",0}, + {PCI_CHIP_I128_T2R4, "Imagine 128 Rev IV T2R4",0}, {0x0000, NULL,0}}}, #ifdef VENDOR_INCLUDE_NONVIDEO {PCI_VENDOR_UMC, { diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h index 00cece3a9..03ee01a07 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Priv.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.67 2000/06/20 05:08:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.68 2000/10/30 23:02:11 tsi Exp $ */ /* * Copyright (c) 1997 by The XFree86 Project, Inc. @@ -165,7 +165,6 @@ void OsVendorVErrorF(const char *f, va_list args); /* xf86Init.c */ Bool xf86LoadModules(char **list, pointer *optlist); -pointer xf86LoadOneModule(char *name, pointer optlist); /* xf86Io.c */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h b/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h index 4e8ca8fbf..20e254988 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.20 2000/09/19 12:46:13 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.21 2000/11/06 19:24:07 dawes Exp $ */ /* * Copyright (c) 1997,1998 by The XFree86 Project, Inc. @@ -166,6 +166,7 @@ typedef struct { #define CODRV01X 2 #define SYSCONS 8 #define PCVT 16 +#define WSCONS 32 #endif /* Values of xf86Info.mouseFlags */ diff --git a/xc/programs/Xserver/hw/xfree86/common/xf86xv.h b/xc/programs/Xserver/hw/xfree86/common/xf86xv.h index bae9ca4b0..bc0996c56 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xf86xv.h +++ b/xc/programs/Xserver/hw/xfree86/common/xf86xv.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.18 2000/08/04 16:13:26 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86xv.h,v 1.19 2000/11/02 16:33:27 tsi Exp $ */ #ifndef _XVDIX_H_ #define _XVDIX_H_ @@ -68,7 +68,7 @@ typedef int (* GetStillFuncPtr)( ScrnInfoPtr pScrn, short vid_x, short vid_y, short drw_x, short drw_y, short vid_w, short vid_h, short drw_w, short drw_h, RegionPtr clipBoxes, pointer data ); -typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool exit); +typedef void (* StopVideoFuncPtr)(ScrnInfoPtr pScrn, pointer data, Bool Exit); typedef int (* SetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute, INT32 value, pointer data); typedef int (* GetPortAttributeFuncPtr)(ScrnInfoPtr pScrn, Atom attribute, @@ -79,7 +79,7 @@ typedef void (* QueryBestSizeFuncPtr)(ScrnInfoPtr pScrn, Bool motion, typedef int (* PutImageFuncPtr)( ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x, short drw_y, short src_w, short src_h, short drw_w, short drw_h, - int image, unsigned char* buf, short width, short height, Bool sync, + int image, unsigned char* buf, short width, short height, Bool Sync, RegionPtr clipBoxes, pointer data ); typedef int (* ReputImageFuncPtr)( ScrnInfoPtr pScrn, short drw_x, short drw_y, RegionPtr clipBoxes, pointer data ); diff --git a/xc/programs/Xserver/hw/xfree86/common/xisb.c b/xc/programs/Xserver/hw/xfree86/common/xisb.c index 7c5711aa6..4132c7abf 100644 --- a/xc/programs/Xserver/hw/xfree86/common/xisb.c +++ b/xc/programs/Xserver/hw/xfree86/common/xisb.c @@ -24,7 +24,7 @@ * in this Software without prior written authorization from Metro Link. * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.4 1999/03/06 13:12:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xisb.c,v 1.5 2000/11/06 19:24:07 dawes Exp $ */ /* X Input Serial Buffer routines for use in any XInput driver that accesses @@ -127,7 +127,8 @@ XisbRead (XISBuffer *b) } } if (b->trace) - ErrorF ("read 0x%02x (%c)\n", b->buf[b->current], b->buf[b->current]); + ErrorF ("read 0x%02x (%c)\n", b->buf[b->current], + isprint(b->buf[b->current])?b->buf[b->current]:'.'); return (b->buf[b->current++]); } |