diff options
Diffstat (limited to 'hw/xfree86/common')
-rw-r--r-- | hw/xfree86/common/compiler.h | 17 | ||||
-rw-r--r-- | hw/xfree86/common/xf86.h | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Bus.c | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Helper.c | 61 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Init.c | 63 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Priv.h | 4 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Privstr.h | 12 |
7 files changed, 104 insertions, 59 deletions
diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h index 56b0b1a32..65a0e5c7c 100644 --- a/hw/xfree86/common/compiler.h +++ b/hw/xfree86/common/compiler.h @@ -1,5 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 1.1.4.3 2003/12/20 00:28:26 kaleb Exp $ */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.105 2003/12/18 21:56:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/compiler.h,v 3.106 2004/02/02 03:55:28 dawes Exp $ */ /* * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. * @@ -59,6 +58,10 @@ # define _COMPILER_H +#if defined(__SUNPRO_C) +# define DO_PROTOTYPES +#endif + /* Allow drivers to use the GCC-supported __inline__ and/or __inline. */ # ifndef __inline__ # if defined(__GNUC__) @@ -1301,6 +1304,7 @@ inl(unsigned short port) # define mem_barrier() /* NOP */ # define write_mem_barrier() /* NOP */ +# if !defined(__SUNPRO_C) # if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) # ifdef GCCUSESGAS @@ -1446,6 +1450,7 @@ inl(unsigned short port) } # endif /* FAKEIT */ +# endif /* __SUNPRO_C */ # endif /* ix86 */ @@ -1541,8 +1546,8 @@ extern void outl(unsigned int a, unsigned int l); #if 0 # include <sys/types.h> #endif -# if !defined(__HIGHC__) && !defined(__SUNPRO_C) -# ifndef __USLC__ +# ifndef __HIGHC__ +# if !defined(__USLC__) && !defined(__SUNPRO_C) # define __USLC__ # endif # endif @@ -1561,8 +1566,8 @@ extern void outl(unsigned int a, unsigned int l); # include <sys/types.h> # endif /* IN_MODULE */ # endif /* USL */ -# ifndef sgi -# include <sys/inline.h> +# if !defined(sgi) && !defined(__SUNPRO_C) +# include <sys/inline.h> # endif # else # include "scoasm.h" diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index e189e81d2..313d43015 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.172 2003/09/24 02:43:16 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86.h,v 3.173 2004/01/27 01:31:44 dawes Exp $ */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -57,7 +57,6 @@ extern int xf86PixmapIndex; extern Bool xf86ResAccessEnter; extern ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */ extern const unsigned char byte_reversed[256]; -extern PropertyPtr *xf86RegisteredPropertiesTable; extern ScrnInfoPtr xf86CurrentScreen; extern Bool pciSlotClaimed; extern Bool isaSlotClaimed; diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index 388823ddb..5e002c8db 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -1,5 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.79 2003/11/03 05:11:01 tsi Exp $ */ -/* $XdotOrg$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Bus.c,v 1.80 2004/02/05 18:24:59 eich Exp $ */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. * diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 713e7861a..076a97f16 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.135 2003/10/08 14:58:27 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Helper.c,v 1.136 2004/01/27 01:31:45 dawes Exp $ */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -2888,11 +2888,12 @@ int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, pointer value ) { - PropertyPtr pNewProp, pRegProp; + RootWinPropPtr pNewProp = NULL, pRegProp; int i; + Bool existing = FALSE; #ifdef DEBUG - ErrorF("xf86RegisterRootWindowProperty(%d, %d, %d, %d, %d, %p)\n", + ErrorF("xf86RegisterRootWindowProperty(%d, %ld, %ld, %d, %ld, %p)\n", ScrnIndex, property, type, format, len, value); #endif @@ -2900,19 +2901,35 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, return(BadMatch); } - if ( (pNewProp = (PropertyPtr)xalloc(sizeof(PropertyRec)))==NULL ) { - return(BadAlloc); + if (xf86RegisteredPropertiesTable && + xf86RegisteredPropertiesTable[ScrnIndex]) { + for (pNewProp = xf86RegisteredPropertiesTable[ScrnIndex]; + pNewProp; pNewProp = pNewProp->next) { + if (strcmp(pNewProp->name, NameForAtom(property)) == 0) + break; + } + } + + if (!pNewProp) { + if ((pNewProp = (RootWinPropPtr)xalloc(sizeof(RootWinProp))) == NULL) { + return(BadAlloc); + } + /* + * We will put this property at the end of the list so that + * the changes are made in the order they were requested. + */ + pNewProp->next = NULL; + } else { + if (pNewProp->name) + xfree(pNewProp->name); + existing = TRUE; } - pNewProp->propertyName = property; + pNewProp->name = xnfstrdup(NameForAtom(property)); pNewProp->type = type; pNewProp->format = format; pNewProp->size = len; pNewProp->data = value; - /* We will put this property at the end of the list so that - * the changes are made in the order they were requested. - */ - pNewProp->next = NULL; #ifdef DEBUG ErrorF("new property filled\n"); @@ -2923,7 +2940,7 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, ErrorF("creating xf86RegisteredPropertiesTable[] size %d\n", xf86NumScreens); #endif - if ( NULL==(xf86RegisteredPropertiesTable=(PropertyPtr*)xnfcalloc(sizeof(PropertyPtr),xf86NumScreens) )) { + if ( NULL==(xf86RegisteredPropertiesTable=(RootWinPropPtr*)xnfcalloc(sizeof(RootWinProp),xf86NumScreens) )) { return(BadAlloc); } for (i=0; i<xf86NumScreens; i++) { @@ -2933,22 +2950,24 @@ xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, #ifdef DEBUG ErrorF("xf86RegisteredPropertiesTable %p\n", - xf86RegisteredPropertiesTable); + (void *)xf86RegisteredPropertiesTable); ErrorF("xf86RegisteredPropertiesTable[%d] %p\n", - ScrnIndex, xf86RegisteredPropertiesTable[ScrnIndex]); + ScrnIndex, (void *)xf86RegisteredPropertiesTable[ScrnIndex]); #endif - if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) { - xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp; - } else { - pRegProp = xf86RegisteredPropertiesTable[ScrnIndex]; - while (pRegProp->next != NULL) { + if (!existing) { + if ( xf86RegisteredPropertiesTable[ScrnIndex] == NULL) { + xf86RegisteredPropertiesTable[ScrnIndex] = pNewProp; + } else { + pRegProp = xf86RegisteredPropertiesTable[ScrnIndex]; + while (pRegProp->next != NULL) { #ifdef DEBUG - ErrorF("- next %p\n", pRegProp); + ErrorF("- next %p\n", (void *)pRegProp); #endif - pRegProp = pRegProp->next; + pRegProp = pRegProp->next; + } + pRegProp->next = pNewProp; } - pRegProp->next = pNewProp; } #ifdef DEBUG ErrorF("xf86RegisterRootWindowProperty succeeded\n"); diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 38f495090..33f19ee88 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.211 2003/11/01 00:47:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Init.c,v 3.212 2004/01/27 01:31:45 dawes Exp $ */ /* * Loosely based on code bearing the following copyright: @@ -155,7 +155,7 @@ xf86CreateRootWindow(WindowPtr pWin) int ret = TRUE; int err = Success; ScreenPtr pScreen = pWin->drawable.pScreen; - PropertyPtr pRegProp, pOldRegProp; + RootWinPropPtr pProp; CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr)(pScreen->devPrivates[xf86CreateRootWindowIndex].ptr); @@ -181,25 +181,19 @@ xf86CreateRootWindow(WindowPtr pWin) } /* Now do our stuff */ - if (xf86RegisteredPropertiesTable != NULL) { if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) { - for (pRegProp = xf86RegisteredPropertiesTable[pScreen->myNum]; - pRegProp != NULL && err==Success; - pRegProp = pRegProp->next ) + for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum]; + pProp != NULL && err==Success; + pProp = pProp->next ) { - Atom oldNameAtom = pRegProp->propertyName; - char *nameString; - /* propertyName was created before the screen existed, - * so the atom does not belong to any screen; - * we need to create a new atom with the same name. - */ - nameString = NameForAtom(oldNameAtom); - pRegProp->propertyName = MakeAtom(nameString, strlen(nameString), TRUE); + Atom prop; + + prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE); err = ChangeWindowProperty(pWin, - pRegProp->propertyName, pRegProp->type, - pRegProp->format, PropModeReplace, - pRegProp->size, pRegProp->data, + prop, pProp->type, + pProp->format, PropModeReplace, + pProp->size, pProp->data, FALSE ); } @@ -207,14 +201,6 @@ xf86CreateRootWindow(WindowPtr pWin) /* Look at err */ ret &= (err==Success); - /* free memory */ - pOldRegProp = xf86RegisteredPropertiesTable[pScreen->myNum]; - while (pOldRegProp!=NULL) { - pRegProp = pOldRegProp->next; - xfree(pOldRegProp); - pOldRegProp = pRegProp; - } - xf86RegisteredPropertiesTable[pScreen->myNum] = NULL; } else { xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " "non-root window %p (parent %p)\n", @@ -303,7 +289,6 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) xf86ScreenIndex = AllocateScreenPrivateIndex(); xf86CreateRootWindowIndex = AllocateScreenPrivateIndex(); xf86PixmapIndex = AllocatePixmapPrivateIndex(); - xf86RegisteredPropertiesTable=NULL; generation = serverGeneration; } @@ -749,6 +734,32 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) } formatsDone = TRUE; + if (xf86Info.vtno >= 0 ) { +#define VT_ATOM_NAME "XFree86_VT" + Atom VTAtom=-1; + CARD32 *VT = NULL; + int ret; + + /* This memory needs to stay available until the screen has been + initialized, and we can create the property for real. + */ + if ( (VT = xalloc(sizeof(CARD32)))==NULL ) { + FatalError("Unable to make VT property - out of memory. Exiting...\n"); + } + *VT = xf86Info.vtno; + + VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME), TRUE); + + for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) { + ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, + VTAtom, XA_INTEGER, 32, + 1, VT ); + if (ret != Success) + xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, + "Failed to register VT property\n"); + } + } + /* If a screen uses depth 24, show what the pixmap format is */ for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->depth == 24) { diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index a46bfc39b..82df2aead 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.82 2003/09/09 03:20:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Priv.h,v 3.83 2004/01/27 01:31:45 dawes Exp $ */ /* * Copyright (c) 1997-2002 by The XFree86 Project, Inc. @@ -113,6 +113,8 @@ extern int xf86LogVerbose; /* log file verbosity level */ extern Bool xf86ProbeOnly; extern Bool xf86DoProbe; +extern RootWinPropPtr *xf86RegisteredPropertiesTable; + #ifndef DEFAULT_VERBOSE #define DEFAULT_VERBOSE 0 #endif diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h index 8b0a0f4ce..93d64fd51 100644 --- a/hw/xfree86/common/xf86Privstr.h +++ b/hw/xfree86/common/xf86Privstr.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.40 2003/10/17 20:02:12 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Privstr.h,v 1.41 2004/01/27 01:31:45 dawes Exp $ */ /* * Copyright (c) 1997-2003 by The XFree86 Project, Inc. @@ -198,6 +198,16 @@ typedef struct { } VidModeRec, *VidModePtr; #endif +/* Information for root window properties. */ +typedef struct _RootWinProp { + struct _RootWinProp * next; + char * name; + Atom type; + short format; + long size; + pointer data; +} RootWinProp, *RootWinPropPtr; + /* private resource types */ #define ResNoAvoid ResBios |