diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
commit | 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d (patch) | |
tree | 092efcfc39e3e293baaf04c4c84027ee453d3e13 /hw/xfree86/dixmods/extmod | |
parent | eace88989c3b65d5c20e9f37ea9b23c7c8e19335 (diff) | |
parent | ae869fc7669764729e13fdd70149ed636753f2a3 (diff) |
Merge branch 'master' into mpx
Conflicts:
XTrap/xtrapddmi.c
Xext/security.c
Xext/xprint.c
Xext/xtest.c
Xext/xvdisp.c
Xi/exevents.c
Xi/grabdevb.c
Xi/grabdevk.c
Xi/opendev.c
Xi/ungrdev.c
Xi/ungrdevb.c
Xi/ungrdevk.c
dix/cursor.c
dix/devices.c
dix/dixutils.c
dix/events.c
dix/getevents.c
dix/main.c
dix/window.c
hw/xfree86/ramdac/xf86Cursor.c
include/dix.h
include/input.h
include/inputstr.h
mi/midispcur.c
mi/miinitext.c
mi/misprite.c
render/animcur.c
xfixes/cursor.c
xkb/xkbAccessX.c
Diffstat (limited to 'hw/xfree86/dixmods/extmod')
-rw-r--r-- | hw/xfree86/dixmods/extmod/modinit.h | 5 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86dga2.c | 30 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86misc.c | 40 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86vmode.c | 43 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xvmod.c | 2 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xvmodproc.h | 2 |
6 files changed, 42 insertions, 80 deletions
diff --git a/hw/xfree86/dixmods/extmod/modinit.h b/hw/xfree86/dixmods/extmod/modinit.h index 41f060b2a..191b3ef89 100644 --- a/hw/xfree86/dixmods/extmod/modinit.h +++ b/hw/xfree86/dixmods/extmod/modinit.h @@ -129,8 +129,11 @@ extern void ShmRegisterFuncs( extern void XaceExtensionInit(INITARGS); #endif +#ifdef XSELINUX +extern void XSELinuxExtensionInit(INITARGS); +#endif + #if 1 -extern void SecurityExtensionSetup(INITARGS); extern void SecurityExtensionInit(INITARGS); #endif diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index fa9530860..295e05e9e 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -62,8 +62,7 @@ unsigned char DGAReqCode = 0; int DGAErrorBase; int DGAEventBase; -static int DGAGeneration = 0; -static int DGAClientPrivateIndex; +static DevPrivateKey DGAClientPrivateKey = &DGAClientPrivateKey; static int DGACallbackRefCount = 0; /* This holds the client's version information */ @@ -72,7 +71,11 @@ typedef struct { int minor; } DGAPrivRec, *DGAPrivPtr; -#define DGAPRIV(c) ((c)->devPrivates[DGAClientPrivateIndex].ptr) +#define DGA_GETPRIV(c) ((DGAPrivPtr) \ + dixLookupPrivate(&(c)->devPrivates, DGAClientPrivateKey)) +#define DGA_SETPRIV(c,p) \ + dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p) + void XFree86DGAExtensionInit(INITARGS) @@ -97,23 +100,6 @@ XFree86DGAExtensionInit(INITARGS) for (i = KeyPress; i <= MotionNotify; i++) SetCriticalEvent (DGAEventBase + i); } - - /* - * Allocate a client private index to hold the client's version - * information. - */ - if (DGAGeneration != serverGeneration) { - DGAClientPrivateIndex = AllocateClientPrivateIndex(); - /* - * Allocate 0 length, and use the private to hold a pointer to - * our DGAPrivRec. - */ - if (!AllocateClientPrivate(DGAClientPrivateIndex, 0)) { - ErrorF("XFree86DGAExtensionInit: AllocateClientPrivate failed\n"); - return; - } - DGAGeneration = serverGeneration; - } } @@ -590,12 +576,12 @@ ProcXDGASetClientVersion(ClientPtr client) DGAPrivPtr pPriv; REQUEST_SIZE_MATCH(xXDGASetClientVersionReq); - if ((pPriv = DGAPRIV(client)) == NULL) { + if ((pPriv = DGA_GETPRIV(client)) == NULL) { pPriv = xalloc(sizeof(DGAPrivRec)); /* XXX Need to look into freeing this */ if (!pPriv) return BadAlloc; - DGAPRIV(client) = pPriv; + DGA_SETPRIV(client, pPriv); } pPriv->major = stuff->major; pPriv->minor = stuff->minor; diff --git a/hw/xfree86/dixmods/extmod/xf86misc.c b/hw/xfree86/dixmods/extmod/xf86misc.c index 3a6f83eca..66278a298 100644 --- a/hw/xfree86/dixmods/extmod/xf86misc.c +++ b/hw/xfree86/dixmods/extmod/xf86misc.c @@ -41,8 +41,7 @@ #endif static int miscErrorBase; -static int MiscGeneration = 0; -static int MiscClientPrivateIndex; +static DevPrivateKey MiscClientPrivateKey = &MiscClientPrivateKey; /* This holds the client's version information */ typedef struct { @@ -50,7 +49,10 @@ typedef struct { int minor; } MiscPrivRec, *MiscPrivPtr; -#define MPRIV(c) ((c)->devPrivates[MiscClientPrivateIndex].ptr) +#define M_GETPRIV(c) ((MiscPrivPtr) \ + dixLookupPrivate(&(c)->devPrivates, MiscClientPrivateKey)) +#define M_SETPRIV(c,p) \ + dixSetPrivate(&(c)->devPrivates, MiscClientPrivateKey, p) static void XF86MiscResetProc( ExtensionEntry* /* extEntry */ @@ -61,7 +63,7 @@ ClientVersion(ClientPtr client, int *major, int *minor) { MiscPrivPtr pPriv; - pPriv = MPRIV(client); + pPriv = M_GETPRIV(client); if (!pPriv) { if (major) *major = 0; if (minor) *minor = 0; @@ -123,24 +125,6 @@ XFree86MiscExtensionInit(void) if (!xf86GetModInDevEnabled()) return; - /* - * Allocate a client private index to hold the client's version - * information. - */ - if (MiscGeneration != serverGeneration) { - MiscClientPrivateIndex = AllocateClientPrivateIndex(); - /* - * Allocate 0 length, and use the private to hold a pointer to our - * MiscPrivRec. - */ - if (!AllocateClientPrivate(MiscClientPrivateIndex, 0)) { - ErrorF("XFree86MiscExtensionInit: " - "AllocateClientPrivate failed\n"); - return; - } - MiscGeneration = serverGeneration; - } - if ( (extEntry = AddExtension(XF86MISCNAME, XF86MiscNumberEvents, @@ -205,7 +189,9 @@ ProcXF86MiscSetSaver(client) if (stuff->screen > screenInfo.numScreens) return BadValue; - vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr; + vptr = (ScrnInfoPtr) + dixLookupPrivate(&screenInfo.screens[stuff->screen]->devPrivates, + xf86ScreenKey); REQUEST_SIZE_MATCH(xXF86MiscSetSaverReq); @@ -233,7 +219,9 @@ ProcXF86MiscGetSaver(client) if (stuff->screen > screenInfo.numScreens) return BadValue; - vptr = (ScrnInfoPtr) screenInfo.screens[stuff->screen]->devPrivates[xf86ScreenIndex].ptr; + vptr = (ScrnInfoPtr) + dixLookupPrivate(&screenInfo.screens[stuff->screen]->devPrivates, + xf86ScreenKey); REQUEST_SIZE_MATCH(xXF86MiscGetSaverReq); rep.type = X_Reply; @@ -497,11 +485,11 @@ ProcXF86MiscSetClientVersion(ClientPtr client) REQUEST_SIZE_MATCH(xXF86MiscSetClientVersionReq); - if ((pPriv = MPRIV(client)) == NULL) { + if ((pPriv = M_GETPRIV(client)) == NULL) { pPriv = xalloc(sizeof(MiscPrivRec)); if (!pPriv) return BadAlloc; - MPRIV(client) = pPriv; + M_SETPRIV(client, pPriv); } if (xf86GetVerbosity() > 1) ErrorF("SetClientVersion: %i %i\n",stuff->major,stuff->minor); diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c index 3b054a829..718d40fbd 100644 --- a/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/hw/xfree86/dixmods/extmod/xf86vmode.c @@ -52,8 +52,7 @@ from Kaleb S. KEITHLEY #define DEFAULT_XF86VIDMODE_VERBOSITY 3 static int VidModeErrorBase; -static int VidModeGeneration = 0; -static int VidModeClientPrivateIndex; +static DevPrivateKey VidModeClientPrivateKey = &VidModeClientPrivateKey; /* This holds the client's version information */ typedef struct { @@ -61,7 +60,10 @@ typedef struct { int minor; } VidModePrivRec, *VidModePrivPtr; -#define VMPRIV(c) ((c)->devPrivates[VidModeClientPrivateIndex].ptr) +#define VM_GETPRIV(c) ((VidModePrivPtr) \ + dixLookupPrivate(&(c)->devPrivates, VidModeClientPrivateKey)) +#define VM_SETPRIV(c,p) \ + dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p) static void XF86VidModeResetProc( ExtensionEntry* /* extEntry */ @@ -145,10 +147,12 @@ typedef struct _XF86VidModeScreenPrivate { Bool hasWindow; } XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr; -static int ScreenPrivateIndex; +static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKey; -#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr)(s)->devPrivates[ScreenPrivateIndex].ptr) -#define SetScreenPrivate(s,v) ((s)->devPrivates[ScreenPrivateIndex].ptr = (pointer) v); +#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \ + dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey)) +#define SetScreenPrivate(s,v) \ + dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v) #define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s) #define New(t) (xalloc (sizeof (t))) @@ -172,7 +176,6 @@ XFree86VidModeExtensionInit(void) #ifdef XF86VIDMODE_EVENTS EventType = CreateNewResourceType(XF86VidModeFreeEvents); - ScreenPrivateIndex = AllocateScreenPrivateIndex (); #endif for(i = 0; i < screenInfo.numScreens; i++) { @@ -187,27 +190,9 @@ XFree86VidModeExtensionInit(void) if (!enabled) return; - /* - * Allocate a client private index to hold the client's version - * information. - */ - if (VidModeGeneration != serverGeneration) { - VidModeClientPrivateIndex = AllocateClientPrivateIndex(); - /* - * Allocate 0 length, and use the private to hold a pointer to our - * VidModePrivRec. - */ - if (!AllocateClientPrivate(VidModeClientPrivateIndex, 0)) { - ErrorF("XFree86VidModeExtensionInit: " - "AllocateClientPrivate failed\n"); - return; - } - VidModeGeneration = serverGeneration; - } - if ( #ifdef XF86VIDMODE_EVENTS - EventType && ScreenPrivateIndex != -1 && + EventType && #endif (extEntry = AddExtension(XF86VIDMODENAME, XF86VidModeNumberEvents, @@ -239,7 +224,7 @@ ClientMajorVersion(ClientPtr client) { VidModePrivPtr pPriv; - pPriv = VMPRIV(client); + pPriv = VM_GETPRIV(client); if (!pPriv) return 0; else @@ -1682,11 +1667,11 @@ ProcXF86VidModeSetClientVersion(ClientPtr client) REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq); - if ((pPriv = VMPRIV(client)) == NULL) { + if ((pPriv = VM_GETPRIV(client)) == NULL) { pPriv = xalloc(sizeof(VidModePrivRec)); if (!pPriv) return BadAlloc; - VMPRIV(client) = pPriv; + VM_SETPRIV(client, pPriv); } pPriv->major = stuff->major; pPriv->minor = stuff->minor; diff --git a/hw/xfree86/dixmods/extmod/xvmod.c b/hw/xfree86/dixmods/extmod/xvmod.c index 7c1450c7a..6b3f1149a 100644 --- a/hw/xfree86/dixmods/extmod/xvmod.c +++ b/hw/xfree86/dixmods/extmod/xvmod.c @@ -16,7 +16,7 @@ void XvRegister() { XvScreenInitProc = XvScreenInit; - XvGetScreenIndexProc = XvGetScreenIndex; + XvGetScreenKeyProc = XvGetScreenKey; XvGetRTPortProc = XvGetRTPort; XvMCScreenInitProc = XvMCScreenInit; } diff --git a/hw/xfree86/dixmods/extmod/xvmodproc.h b/hw/xfree86/dixmods/extmod/xvmodproc.h index 81356a149..b39c915b4 100644 --- a/hw/xfree86/dixmods/extmod/xvmodproc.h +++ b/hw/xfree86/dixmods/extmod/xvmodproc.h @@ -5,7 +5,7 @@ #include "xvmcext.h" -extern int (*XvGetScreenIndexProc)(void); +extern DevPrivateKey (*XvGetScreenKeyProc)(void); extern unsigned long (*XvGetRTPortProc)(void); extern int (*XvScreenInitProc)(ScreenPtr); extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr); |