summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-07-16 20:19:50 +0300
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-09-28 16:45:05 +0300
commitcbd4d5dbb70db62ba1cb79c7b904e6fa11f62d7e (patch)
treed949b9d89a19e5d07a81583c0b3a3d1d6ebb2ce2
parent58bd317e29f4abf7f950891339d2a6a78ddf7903 (diff)
xserver: delete pervasively use of DISPATCH_PROC
Some functions had to be moved around due some missing static definitions. Another minor clean up like inexistent function declarations and etc were made also. Part of this patch was cooked using: sed -i -e '/static DISPATCH_PROC*.*;/d' `git ls-files` Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
-rw-r--r--Xext/bigreq.c18
-rw-r--r--Xext/saver.c88
-rw-r--r--Xext/shape.c54
-rw-r--r--Xext/shm.c557
-rw-r--r--Xext/sync.c30
-rw-r--r--Xext/xcmisc.c26
-rw-r--r--Xext/xf86bigfont.c6
-rw-r--r--Xext/xtest.c29
-rw-r--r--dix/dispatch.h211
-rw-r--r--hw/dmx/dmx.c56
-rw-r--r--hw/kdrive/ephyr/ephyrdriext.c135
-rw-r--r--hw/xfree86/dixmods/extmod/Makefile.am2
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c86
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dgaext.h10
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c146
-rw-r--r--hw/xfree86/dri/xf86dri.c70
-rw-r--r--hw/xquartz/applewm.c2
-rw-r--r--hw/xquartz/xpr/appledri.c2
-rw-r--r--hw/xwin/InitInput.c6
-rw-r--r--hw/xwin/winclipboardinit.c2
-rwxr-xr-xhw/xwin/winclipboardwrappers.c6
-rwxr-xr-xhw/xwin/winwindowswm.c2
22 files changed, 636 insertions, 908 deletions
diff --git a/Xext/bigreq.c b/Xext/bigreq.c
index ce3734e8d..a540bcbcb 100644
--- a/Xext/bigreq.c
+++ b/Xext/bigreq.c
@@ -40,18 +40,8 @@ from The Open Group.
#include "opaque.h"
#include "modinit.h"
-static DISPATCH_PROC(ProcBigReqDispatch);
-
void BigReqExtensionInit(INITARGS);
-void
-BigReqExtensionInit(INITARGS)
-{
- AddExtension(XBigReqExtensionName, 0, 0,
- ProcBigReqDispatch, ProcBigReqDispatch,
- NULL, StandardMinorOpcode);
-}
-
static int
ProcBigReqDispatch (ClientPtr client)
{
@@ -78,3 +68,11 @@ ProcBigReqDispatch (ClientPtr client)
WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
return Success;
}
+
+void
+BigReqExtensionInit(INITARGS)
+{
+ AddExtension(XBigReqExtensionName, 0, 0,
+ ProcBigReqDispatch, ProcBigReqDispatch,
+ NULL, StandardMinorOpcode);
+}
diff --git a/Xext/saver.c b/Xext/saver.c
index 6d91ddf5e..18886038a 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -62,20 +62,6 @@ in this Software without prior written authorization from the X Consortium.
static int ScreenSaverEventBase = 0;
-static DISPATCH_PROC(ProcScreenSaverQueryInfo);
-static DISPATCH_PROC(ProcScreenSaverDispatch);
-static DISPATCH_PROC(ProcScreenSaverQueryVersion);
-static DISPATCH_PROC(ProcScreenSaverSelectInput);
-static DISPATCH_PROC(ProcScreenSaverSetAttributes);
-static DISPATCH_PROC(ProcScreenSaverUnsetAttributes);
-static DISPATCH_PROC(ProcScreenSaverSuspend);
-static DISPATCH_PROC(SProcScreenSaverDispatch);
-static DISPATCH_PROC(SProcScreenSaverQueryInfo);
-static DISPATCH_PROC(SProcScreenSaverQueryVersion);
-static DISPATCH_PROC(SProcScreenSaverSelectInput);
-static DISPATCH_PROC(SProcScreenSaverSetAttributes);
-static DISPATCH_PROC(SProcScreenSaverUnsetAttributes);
-static DISPATCH_PROC(SProcScreenSaverSuspend);
static Bool ScreenSaverHandle (
ScreenPtr /* pScreen */,
@@ -237,45 +223,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
#define New(t) (malloc(sizeof (t)))
-/****************
- * ScreenSaverExtensionInit
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- ****************/
-
-void
-ScreenSaverExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
- ScreenPtr pScreen;
-
- if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-
- AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
- SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
- "SaverEvent");
- SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
- "SaverSuspend");
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- SetScreenPrivate (pScreen, NULL);
- }
- if (AttrType && SaverEventType && SuspendType &&
- (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
- ProcScreenSaverDispatch, SProcScreenSaverDispatch,
- NULL, StandardMinorOpcode)))
- {
- ScreenSaverEventBase = extEntry->eventBase;
- EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
- }
-}
-
static void
CheckScreenPrivate (ScreenPtr pScreen)
{
@@ -1412,7 +1359,7 @@ ProcScreenSaverSuspend (ClientPtr client)
return Success;
}
-static DISPATCH_PROC((*NormalVector[])) = {
+static int (*NormalVector[]) (ClientPtr /* client */) = {
ProcScreenSaverQueryVersion,
ProcScreenSaverQueryInfo,
ProcScreenSaverSelectInput,
@@ -1513,7 +1460,7 @@ SProcScreenSaverSuspend (ClientPtr client)
return ProcScreenSaverSuspend (client);
}
-static DISPATCH_PROC((*SwappedVector[])) = {
+static int (*SwappedVector[]) (ClientPtr /* client */) = {
SProcScreenSaverQueryVersion,
SProcScreenSaverQueryInfo,
SProcScreenSaverSelectInput,
@@ -1531,3 +1478,34 @@ SProcScreenSaverDispatch (ClientPtr client)
return (*SwappedVector[stuff->data])(client);
return BadRequest;
}
+
+void
+ScreenSaverExtensionInit(INITARGS)
+{
+ ExtensionEntry *extEntry;
+ int i;
+ ScreenPtr pScreen;
+
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
+ AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
+ SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
+ "SaverEvent");
+ SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
+ "SaverSuspend");
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ pScreen = screenInfo.screens[i];
+ SetScreenPrivate (pScreen, NULL);
+ }
+ if (AttrType && SaverEventType && SuspendType &&
+ (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
+ ProcScreenSaverDispatch, SProcScreenSaverDispatch,
+ NULL, StandardMinorOpcode)))
+ {
+ ScreenSaverEventBase = extEntry->eventBase;
+ EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
+ }
+}
diff --git a/Xext/shape.c b/Xext/shape.c
index ac95328b8..115fc07ed 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -68,26 +68,6 @@ static void SShapeNotifyEvent(
* externally by the Xfixes extension and are now defined in window.h
*/
-static DISPATCH_PROC(ProcShapeCombine);
-static DISPATCH_PROC(ProcShapeDispatch);
-static DISPATCH_PROC(ProcShapeGetRectangles);
-static DISPATCH_PROC(ProcShapeInputSelected);
-static DISPATCH_PROC(ProcShapeMask);
-static DISPATCH_PROC(ProcShapeOffset);
-static DISPATCH_PROC(ProcShapeQueryExtents);
-static DISPATCH_PROC(ProcShapeQueryVersion);
-static DISPATCH_PROC(ProcShapeRectangles);
-static DISPATCH_PROC(ProcShapeSelectInput);
-static DISPATCH_PROC(SProcShapeCombine);
-static DISPATCH_PROC(SProcShapeDispatch);
-static DISPATCH_PROC(SProcShapeGetRectangles);
-static DISPATCH_PROC(SProcShapeInputSelected);
-static DISPATCH_PROC(SProcShapeMask);
-static DISPATCH_PROC(SProcShapeOffset);
-static DISPATCH_PROC(SProcShapeQueryExtents);
-static DISPATCH_PROC(SProcShapeQueryVersion);
-static DISPATCH_PROC(SProcShapeRectangles);
-static DISPATCH_PROC(SProcShapeSelectInput);
#ifdef PANORAMIX
#include "panoramiX.h"
@@ -122,23 +102,6 @@ typedef struct _ShapeEvent {
*
****************/
-void
-ShapeExtensionInit(void)
-{
- ExtensionEntry *extEntry;
-
- ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
- ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
- if (ClientType && ShapeEventType &&
- (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
- ProcShapeDispatch, SProcShapeDispatch,
- NULL, StandardMinorOpcode)))
- {
- ShapeEventBase = extEntry->eventBase;
- EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
- }
-}
-
static int
RegionOperate (
ClientPtr client,
@@ -1278,3 +1241,20 @@ SProcShapeDispatch (ClientPtr client)
return BadRequest;
}
}
+
+void
+ShapeExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+
+ ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
+ ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
+ if (ClientType && ShapeEventType &&
+ (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
+ ProcShapeDispatch, SProcShapeDispatch,
+ NULL, StandardMinorOpcode)))
+ {
+ ShapeEventBase = extEntry->eventBase;
+ EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
+ }
+}
diff --git a/Xext/shm.c b/Xext/shm.c
index 3230d83c6..23afe6b1f 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -120,20 +120,6 @@ static void SShmCompletionEvent(
static Bool ShmDestroyPixmap (PixmapPtr pPixmap);
-static DISPATCH_PROC(ProcShmAttach);
-static DISPATCH_PROC(ProcShmCreatePixmap);
-static DISPATCH_PROC(ProcShmDetach);
-static DISPATCH_PROC(ProcShmDispatch);
-static DISPATCH_PROC(ProcShmGetImage);
-static DISPATCH_PROC(ProcShmPutImage);
-static DISPATCH_PROC(ProcShmQueryVersion);
-static DISPATCH_PROC(SProcShmAttach);
-static DISPATCH_PROC(SProcShmCreatePixmap);
-static DISPATCH_PROC(SProcShmDetach);
-static DISPATCH_PROC(SProcShmDispatch);
-static DISPATCH_PROC(SProcShmGetImage);
-static DISPATCH_PROC(SProcShmPutImage);
-static DISPATCH_PROC(SProcShmQueryVersion);
static unsigned char ShmReqCode;
int ShmCompletionCode;
@@ -254,56 +240,6 @@ ShmRegisterPrivates(void)
return TRUE;
}
-void
-ShmExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
-
-#ifdef MUST_CHECK_FOR_SHM_SYSCALL
- if (!CheckForShmSyscall())
- {
- ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
- return;
- }
-#endif
-
- if (!ShmRegisterPrivates())
- return;
-
- sharedPixmaps = xFalse;
- {
- sharedPixmaps = xTrue;
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]);
- if (!screen_priv->shmFuncs)
- screen_priv->shmFuncs = &miFuncs;
- if (!screen_priv->shmFuncs->CreatePixmap)
- sharedPixmaps = xFalse;
- }
- if (sharedPixmaps)
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]);
- screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap;
- screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
- }
- }
- ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
- if (ShmSegType &&
- (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
- ProcShmDispatch, SProcShmDispatch,
- ShmResetProc, StandardMinorOpcode)))
- {
- ShmReqCode = (unsigned char)extEntry->base;
- ShmCompletionCode = extEntry->eventBase;
- BadShmSegCode = extEntry->errorBase;
- SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
- EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
- }
-}
-
/*ARGSUSED*/
static void
ShmResetProc(ExtensionEntry *extEntry)
@@ -581,6 +517,226 @@ doShmPutImage(DrawablePtr dst, GCPtr pGC,
}
}
+static int
+ProcShmPutImage(ClientPtr client)
+{
+ GCPtr pGC;
+ DrawablePtr pDraw;
+ long length;
+ ShmDescPtr shmdesc;
+ REQUEST(xShmPutImageReq);
+
+ REQUEST_SIZE_MATCH(xShmPutImageReq);
+ VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
+ VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
+ if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
+ return BadValue;
+ if (stuff->format == XYBitmap)
+ {
+ if (stuff->depth != 1)
+ return BadMatch;
+ length = PixmapBytePad(stuff->totalWidth, 1);
+ }
+ else if (stuff->format == XYPixmap)
+ {
+ if (pDraw->depth != stuff->depth)
+ return BadMatch;
+ length = PixmapBytePad(stuff->totalWidth, 1);
+ length *= stuff->depth;
+ }
+ else if (stuff->format == ZPixmap)
+ {
+ if (pDraw->depth != stuff->depth)
+ return BadMatch;
+ length = PixmapBytePad(stuff->totalWidth, stuff->depth);
+ }
+ else
+ {
+ client->errorValue = stuff->format;
+ return BadValue;
+ }
+
+ /*
+ * There's a potential integer overflow in this check:
+ * VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
+ * client);
+ * the version below ought to avoid it
+ */
+ if (stuff->totalHeight != 0 &&
+ length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
+ client->errorValue = stuff->totalWidth;
+ return BadValue;
+ }
+ if (stuff->srcX > stuff->totalWidth)
+ {
+ client->errorValue = stuff->srcX;
+ return BadValue;
+ }
+ if (stuff->srcY > stuff->totalHeight)
+ {
+ client->errorValue = stuff->srcY;
+ return BadValue;
+ }
+ if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
+ {
+ client->errorValue = stuff->srcWidth;
+ return BadValue;
+ }
+ if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
+ {
+ client->errorValue = stuff->srcHeight;
+ return BadValue;
+ }
+
+ if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
+ ((stuff->format != ZPixmap) &&
+ (stuff->srcX < screenInfo.bitmapScanlinePad) &&
+ ((stuff->format == XYBitmap) ||
+ ((stuff->srcY == 0) &&
+ (stuff->srcHeight == stuff->totalHeight))))) &&
+ ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
+ (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
+ stuff->dstX, stuff->dstY,
+ stuff->totalWidth, stuff->srcHeight,
+ stuff->srcX, stuff->format,
+ shmdesc->addr + stuff->offset +
+ (stuff->srcY * length));
+ else
+ doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
+ stuff->totalWidth, stuff->totalHeight,
+ stuff->srcX, stuff->srcY,
+ stuff->srcWidth, stuff->srcHeight,
+ stuff->dstX, stuff->dstY,
+ shmdesc->addr + stuff->offset);
+
+ if (stuff->sendEvent)
+ {
+ xShmCompletionEvent ev;
+
+ ev.type = ShmCompletionCode;
+ ev.drawable = stuff->drawable;
+ ev.minorEvent = X_ShmPutImage;
+ ev.majorEvent = ShmReqCode;
+ ev.shmseg = stuff->shmseg;
+ ev.offset = stuff->offset;
+ WriteEventsToClient(client, 1, (xEvent *) &ev);
+ }
+
+ return Success;
+}
+
+static int
+ProcShmGetImage(ClientPtr client)
+{
+ DrawablePtr pDraw;
+ long lenPer = 0, length;
+ Mask plane = 0;
+ xShmGetImageReply xgi;
+ ShmDescPtr shmdesc;
+ int n, rc;
+
+ REQUEST(xShmGetImageReq);
+
+ REQUEST_SIZE_MATCH(xShmGetImageReq);
+ if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
+ {
+ client->errorValue = stuff->format;
+ return BadValue;
+ }
+ rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
+ VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
+ if (pDraw->type == DRAWABLE_WINDOW)
+ {
+ if( /* check for being viewable */
+ !((WindowPtr) pDraw)->realized ||
+ /* check for being on screen */
+ pDraw->x + stuff->x < 0 ||
+ pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
+ pDraw->y + stuff->y < 0 ||
+ pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
+ /* check for being inside of border */
+ stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
+ stuff->x + (int)stuff->width >
+ wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
+ stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
+ stuff->y + (int)stuff->height >
+ wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
+ )
+ return BadMatch;
+ xgi.visual = wVisual(((WindowPtr)pDraw));
+ }
+ else
+ {
+ if (stuff->x < 0 ||
+ stuff->x+(int)stuff->width > pDraw->width ||
+ stuff->y < 0 ||
+ stuff->y+(int)stuff->height > pDraw->height
+ )
+ return BadMatch;
+ xgi.visual = None;
+ }
+ xgi.type = X_Reply;
+ xgi.length = 0;
+ xgi.sequenceNumber = client->sequence;
+ xgi.depth = pDraw->depth;
+ if(stuff->format == ZPixmap)
+ {
+ length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
+ }
+ else
+ {
+ lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
+ plane = ((Mask)1) << (pDraw->depth - 1);
+ /* only planes asked for */
+ length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
+ }
+
+ VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
+ xgi.size = length;
+
+ if (length == 0)
+ {
+ /* nothing to do */
+ }
+ else if (stuff->format == ZPixmap)
+ {
+ (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
+ stuff->width, stuff->height,
+ stuff->format, stuff->planeMask,
+ shmdesc->addr + stuff->offset);
+ }
+ else
+ {
+
+ length = stuff->offset;
+ for (; plane; plane >>= 1)
+ {
+ if (stuff->planeMask & plane)
+ {
+ (*pDraw->pScreen->GetImage)(pDraw,
+ stuff->x, stuff->y,
+ stuff->width, stuff->height,
+ stuff->format, plane,
+ shmdesc->addr + length);
+ length += lenPer;
+ }
+ }
+ }
+
+ if (client->swapped) {
+ swaps(&xgi.sequenceNumber, n);
+ swapl(&xgi.length, n);
+ swapl(&xgi.visual, n);
+ swapl(&xgi.size, n);
+ }
+ WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
+
+ return Success;
+}
+
#ifdef PANORAMIX
static int
ProcPanoramiXShmPutImage(ClientPtr client)
@@ -858,231 +1014,8 @@ CreatePmap:
return result;
}
-
#endif
-static int
-ProcShmPutImage(ClientPtr client)
-{
- GCPtr pGC;
- DrawablePtr pDraw;
- long length;
- ShmDescPtr shmdesc;
- REQUEST(xShmPutImageReq);
-
- REQUEST_SIZE_MATCH(xShmPutImageReq);
- VALIDATE_DRAWABLE_AND_GC(stuff->drawable, pDraw, DixWriteAccess);
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, FALSE, shmdesc, client);
- if ((stuff->sendEvent != xTrue) && (stuff->sendEvent != xFalse))
- return BadValue;
- if (stuff->format == XYBitmap)
- {
- if (stuff->depth != 1)
- return BadMatch;
- length = PixmapBytePad(stuff->totalWidth, 1);
- }
- else if (stuff->format == XYPixmap)
- {
- if (pDraw->depth != stuff->depth)
- return BadMatch;
- length = PixmapBytePad(stuff->totalWidth, 1);
- length *= stuff->depth;
- }
- else if (stuff->format == ZPixmap)
- {
- if (pDraw->depth != stuff->depth)
- return BadMatch;
- length = PixmapBytePad(stuff->totalWidth, stuff->depth);
- }
- else
- {
- client->errorValue = stuff->format;
- return BadValue;
- }
-
- /*
- * There's a potential integer overflow in this check:
- * VERIFY_SHMSIZE(shmdesc, stuff->offset, length * stuff->totalHeight,
- * client);
- * the version below ought to avoid it
- */
- if (stuff->totalHeight != 0 &&
- length > (shmdesc->size - stuff->offset)/stuff->totalHeight) {
- client->errorValue = stuff->totalWidth;
- return BadValue;
- }
- if (stuff->srcX > stuff->totalWidth)
- {
- client->errorValue = stuff->srcX;
- return BadValue;
- }
- if (stuff->srcY > stuff->totalHeight)
- {
- client->errorValue = stuff->srcY;
- return BadValue;
- }
- if ((stuff->srcX + stuff->srcWidth) > stuff->totalWidth)
- {
- client->errorValue = stuff->srcWidth;
- return BadValue;
- }
- if ((stuff->srcY + stuff->srcHeight) > stuff->totalHeight)
- {
- client->errorValue = stuff->srcHeight;
- return BadValue;
- }
-
- if ((((stuff->format == ZPixmap) && (stuff->srcX == 0)) ||
- ((stuff->format != ZPixmap) &&
- (stuff->srcX < screenInfo.bitmapScanlinePad) &&
- ((stuff->format == XYBitmap) ||
- ((stuff->srcY == 0) &&
- (stuff->srcHeight == stuff->totalHeight))))) &&
- ((stuff->srcX + stuff->srcWidth) == stuff->totalWidth))
- (*pGC->ops->PutImage) (pDraw, pGC, stuff->depth,
- stuff->dstX, stuff->dstY,
- stuff->totalWidth, stuff->srcHeight,
- stuff->srcX, stuff->format,
- shmdesc->addr + stuff->offset +
- (stuff->srcY * length));
- else
- doShmPutImage(pDraw, pGC, stuff->depth, stuff->format,
- stuff->totalWidth, stuff->totalHeight,
- stuff->srcX, stuff->srcY,
- stuff->srcWidth, stuff->srcHeight,
- stuff->dstX, stuff->dstY,
- shmdesc->addr + stuff->offset);
-
- if (stuff->sendEvent)
- {
- xShmCompletionEvent ev;
-
- ev.type = ShmCompletionCode;
- ev.drawable = stuff->drawable;
- ev.minorEvent = X_ShmPutImage;
- ev.majorEvent = ShmReqCode;
- ev.shmseg = stuff->shmseg;
- ev.offset = stuff->offset;
- WriteEventsToClient(client, 1, (xEvent *) &ev);
- }
-
- return Success;
-}
-
-
-
-static int
-ProcShmGetImage(ClientPtr client)
-{
- DrawablePtr pDraw;
- long lenPer = 0, length;
- Mask plane = 0;
- xShmGetImageReply xgi;
- ShmDescPtr shmdesc;
- int n, rc;
-
- REQUEST(xShmGetImageReq);
-
- REQUEST_SIZE_MATCH(xShmGetImageReq);
- if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap))
- {
- client->errorValue = stuff->format;
- return BadValue;
- }
- rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixReadAccess);
- if (rc != Success)
- return rc;
- VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client);
- if (pDraw->type == DRAWABLE_WINDOW)
- {
- if( /* check for being viewable */
- !((WindowPtr) pDraw)->realized ||
- /* check for being on screen */
- pDraw->x + stuff->x < 0 ||
- pDraw->x + stuff->x + (int)stuff->width > pDraw->pScreen->width ||
- pDraw->y + stuff->y < 0 ||
- pDraw->y + stuff->y + (int)stuff->height > pDraw->pScreen->height ||
- /* check for being inside of border */
- stuff->x < - wBorderWidth((WindowPtr)pDraw) ||
- stuff->x + (int)stuff->width >
- wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
- stuff->y < -wBorderWidth((WindowPtr)pDraw) ||
- stuff->y + (int)stuff->height >
- wBorderWidth((WindowPtr)pDraw) + (int)pDraw->height
- )
- return BadMatch;
- xgi.visual = wVisual(((WindowPtr)pDraw));
- }
- else
- {
- if (stuff->x < 0 ||
- stuff->x+(int)stuff->width > pDraw->width ||
- stuff->y < 0 ||
- stuff->y+(int)stuff->height > pDraw->height
- )
- return BadMatch;
- xgi.visual = None;
- }
- xgi.type = X_Reply;
- xgi.length = 0;
- xgi.sequenceNumber = client->sequence;
- xgi.depth = pDraw->depth;
- if(stuff->format == ZPixmap)
- {
- length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
- }
- else
- {
- lenPer = PixmapBytePad(stuff->width, 1) * stuff->height;
- plane = ((Mask)1) << (pDraw->depth - 1);
- /* only planes asked for */
- length = lenPer * Ones(stuff->planeMask & (plane | (plane - 1)));
- }
-
- VERIFY_SHMSIZE(shmdesc, stuff->offset, length, client);
- xgi.size = length;
-
- if (length == 0)
- {
- /* nothing to do */
- }
- else if (stuff->format == ZPixmap)
- {
- (*pDraw->pScreen->GetImage)(pDraw, stuff->x, stuff->y,
- stuff->width, stuff->height,
- stuff->format, stuff->planeMask,
- shmdesc->addr + stuff->offset);
- }
- else
- {
-
- length = stuff->offset;
- for (; plane; plane >>= 1)
- {
- if (stuff->planeMask & plane)
- {
- (*pDraw->pScreen->GetImage)(pDraw,
- stuff->x, stuff->y,
- stuff->width, stuff->height,
- stuff->format, plane,
- shmdesc->addr + length);
- length += lenPer;
- }
- }
- }
-
- if (client->swapped) {
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
- }
- WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
-
- return Success;
-}
-
static PixmapPtr
fbShmCreatePixmap (ScreenPtr pScreen,
int width, int height, int depth, char *addr)
@@ -1342,3 +1275,53 @@ SProcShmDispatch (ClientPtr client)
return BadRequest;
}
}
+
+void
+ShmExtensionInit(INITARGS)
+{
+ ExtensionEntry *extEntry;
+ int i;
+
+#ifdef MUST_CHECK_FOR_SHM_SYSCALL
+ if (!CheckForShmSyscall())
+ {
+ ErrorF("MIT-SHM extension disabled due to lack of kernel support\n");
+ return;
+ }
+#endif
+
+ if (!ShmRegisterPrivates())
+ return;
+
+ sharedPixmaps = xFalse;
+ {
+ sharedPixmaps = xTrue;
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ ShmScrPrivateRec *screen_priv = ShmInitScreenPriv(screenInfo.screens[i]);
+ if (!screen_priv->shmFuncs)
+ screen_priv->shmFuncs = &miFuncs;
+ if (!screen_priv->shmFuncs->CreatePixmap)
+ sharedPixmaps = xFalse;
+ }
+ if (sharedPixmaps)
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(screenInfo.screens[i]);
+ screen_priv->destroyPixmap = screenInfo.screens[i]->DestroyPixmap;
+ screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
+ }
+ }
+ ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
+ if (ShmSegType &&
+ (extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
+ ProcShmDispatch, SProcShmDispatch,
+ ShmResetProc, StandardMinorOpcode)))
+ {
+ ShmReqCode = (unsigned char)extEntry->base;
+ ShmCompletionCode = extEntry->eventBase;
+ BadShmSegCode = extEntry->errorBase;
+ SetResourceTypeErrorValue(ShmSegType, BadShmSegCode);
+ EventSwapVector[ShmCompletionCode] = (EventSwapPtr) SShmCompletionEvent;
+ }
+}
diff --git a/Xext/sync.c b/Xext/sync.c
index a51262a99..f23df6cb9 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -100,36 +100,6 @@ static void SyncInitServerTime(void);
static void SyncInitIdleTime(void);
-static DISPATCH_PROC(ProcSyncAwait);
-static DISPATCH_PROC(ProcSyncChangeAlarm);
-static DISPATCH_PROC(ProcSyncChangeCounter);
-static DISPATCH_PROC(ProcSyncCreateAlarm);
-static DISPATCH_PROC(ProcSyncCreateCounter);
-static DISPATCH_PROC(ProcSyncDestroyAlarm);
-static DISPATCH_PROC(ProcSyncDestroyCounter);
-static DISPATCH_PROC(ProcSyncDispatch);
-static DISPATCH_PROC(ProcSyncGetPriority);
-static DISPATCH_PROC(ProcSyncInitialize);
-static DISPATCH_PROC(ProcSyncListSystemCounters);
-static DISPATCH_PROC(ProcSyncQueryAlarm);
-static DISPATCH_PROC(ProcSyncQueryCounter);
-static DISPATCH_PROC(ProcSyncSetCounter);
-static DISPATCH_PROC(ProcSyncSetPriority);
-static DISPATCH_PROC(SProcSyncAwait);
-static DISPATCH_PROC(SProcSyncChangeAlarm);
-static DISPATCH_PROC(SProcSyncChangeCounter);
-static DISPATCH_PROC(SProcSyncCreateAlarm);
-static DISPATCH_PROC(SProcSyncCreateCounter);
-static DISPATCH_PROC(SProcSyncDestroyAlarm);
-static DISPATCH_PROC(SProcSyncDestroyCounter);
-static DISPATCH_PROC(SProcSyncDispatch);
-static DISPATCH_PROC(SProcSyncGetPriority);
-static DISPATCH_PROC(SProcSyncInitialize);
-static DISPATCH_PROC(SProcSyncListSystemCounters);
-static DISPATCH_PROC(SProcSyncQueryAlarm);
-static DISPATCH_PROC(SProcSyncQueryCounter);
-static DISPATCH_PROC(SProcSyncSetCounter);
-static DISPATCH_PROC(SProcSyncSetPriority);
/* Each counter maintains a simple linked list of triggers that are
* interested in the counter. The two functions below are used to
diff --git a/Xext/xcmisc.c b/Xext/xcmisc.c
index 986c870a5..378afccca 100644
--- a/Xext/xcmisc.c
+++ b/Xext/xcmisc.c
@@ -46,24 +46,6 @@ from The Open Group.
#define UINT32_MAX 0xffffffffU
#endif
-static DISPATCH_PROC(ProcXCMiscDispatch);
-static DISPATCH_PROC(ProcXCMiscGetVersion);
-static DISPATCH_PROC(ProcXCMiscGetXIDList);
-static DISPATCH_PROC(ProcXCMiscGetXIDRange);
-static DISPATCH_PROC(SProcXCMiscDispatch);
-static DISPATCH_PROC(SProcXCMiscGetVersion);
-static DISPATCH_PROC(SProcXCMiscGetXIDList);
-static DISPATCH_PROC(SProcXCMiscGetXIDRange);
-
-void XCMiscExtensionInit(INITARGS);
-
-void
-XCMiscExtensionInit(INITARGS)
-{
- AddExtension(XCMiscExtensionName, 0, 0,
- ProcXCMiscDispatch, SProcXCMiscDispatch,
- NULL, StandardMinorOpcode);
-}
static int
ProcXCMiscGetVersion(ClientPtr client)
@@ -215,3 +197,11 @@ SProcXCMiscDispatch (ClientPtr client)
return BadRequest;
}
}
+
+void
+XCMiscExtensionInit(INITARGS)
+{
+ AddExtension(XCMiscExtensionName, 0, 0,
+ ProcXCMiscDispatch, SProcXCMiscDispatch,
+ NULL, StandardMinorOpcode);
+}
diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index 8f0ddd93d..f7dde6e17 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -80,12 +80,6 @@ static void XF86BigfontResetProc(
ExtensionEntry * /* extEntry */
);
-static DISPATCH_PROC(ProcXF86BigfontDispatch);
-static DISPATCH_PROC(ProcXF86BigfontQueryVersion);
-static DISPATCH_PROC(ProcXF86BigfontQueryFont);
-static DISPATCH_PROC(SProcXF86BigfontDispatch);
-static DISPATCH_PROC(SProcXF86BigfontQueryVersion);
-static DISPATCH_PROC(SProcXF86BigfontQueryFont);
#ifdef HAS_SHM
diff --git a/Xext/xtest.c b/Xext/xtest.c
index 7268768b0..d7d254c18 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -84,26 +84,6 @@ static int XTestSwapFakeInput(
xReq * /* req */
);
-static DISPATCH_PROC(ProcXTestCompareCursor);
-static DISPATCH_PROC(ProcXTestDispatch);
-static DISPATCH_PROC(ProcXTestFakeInput);
-static DISPATCH_PROC(ProcXTestGetVersion);
-static DISPATCH_PROC(ProcXTestGrabControl);
-static DISPATCH_PROC(SProcXTestCompareCursor);
-static DISPATCH_PROC(SProcXTestDispatch);
-static DISPATCH_PROC(SProcXTestFakeInput);
-static DISPATCH_PROC(SProcXTestGetVersion);
-static DISPATCH_PROC(SProcXTestGrabControl);
-
-void
-XTestExtensionInit(INITARGS)
-{
- AddExtension(XTestExtensionName, 0, 0,
- ProcXTestDispatch, SProcXTestDispatch,
- NULL, StandardMinorOpcode);
-
- xtest_evlist = InitEventList(GetMaximumEventsNum());
-}
static int
ProcXTestGetVersion(ClientPtr client)
@@ -699,3 +679,12 @@ GetXTestDevice(DeviceIntPtr master)
return NULL;
}
+void
+XTestExtensionInit(INITARGS)
+{
+ AddExtension(XTestExtensionName, 0, 0,
+ ProcXTestDispatch, SProcXTestDispatch,
+ NULL, StandardMinorOpcode);
+
+ xtest_evlist = InitEventList(GetMaximumEventsNum());
+}
diff --git a/dix/dispatch.h b/dix/dispatch.h
index dd07096af..758b83dd9 100644
--- a/dix/dispatch.h
+++ b/dix/dispatch.h
@@ -36,111 +36,110 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifndef DISPATCH_H
#define DISPATCH_H 1
-DISPATCH_PROC(InitClientPrivates);
-DISPATCH_PROC(ProcAllocColor);
-DISPATCH_PROC(ProcAllocColorCells);
-DISPATCH_PROC(ProcAllocColorPlanes);
-DISPATCH_PROC(ProcAllocNamedColor);
-DISPATCH_PROC(ProcBell);
-DISPATCH_PROC(ProcChangeAccessControl);
-DISPATCH_PROC(ProcChangeCloseDownMode);
-DISPATCH_PROC(ProcChangeGC);
-DISPATCH_PROC(ProcChangeHosts);
-DISPATCH_PROC(ProcChangeKeyboardControl);
-DISPATCH_PROC(ProcChangeKeyboardMapping);
-DISPATCH_PROC(ProcChangePointerControl);
-DISPATCH_PROC(ProcChangeProperty);
-DISPATCH_PROC(ProcChangeSaveSet);
-DISPATCH_PROC(ProcChangeWindowAttributes);
-DISPATCH_PROC(ProcCirculateWindow);
-DISPATCH_PROC(ProcClearToBackground);
-DISPATCH_PROC(ProcCloseFont);
-DISPATCH_PROC(ProcConfigureWindow);
-DISPATCH_PROC(ProcConvertSelection);
-DISPATCH_PROC(ProcCopyArea);
-DISPATCH_PROC(ProcCopyColormapAndFree);
-DISPATCH_PROC(ProcCopyGC);
-DISPATCH_PROC(ProcCopyPlane);
-DISPATCH_PROC(ProcCreateColormap);
-DISPATCH_PROC(ProcCreateCursor);
-DISPATCH_PROC(ProcCreateGC);
-DISPATCH_PROC(ProcCreateGlyphCursor);
-DISPATCH_PROC(ProcCreatePixmap);
-DISPATCH_PROC(ProcCreateWindow);
-DISPATCH_PROC(ProcDeleteProperty);
-DISPATCH_PROC(ProcDestroySubwindows);
-DISPATCH_PROC(ProcDestroyWindow);
-DISPATCH_PROC(ProcEstablishConnection);
-DISPATCH_PROC(ProcFillPoly);
-DISPATCH_PROC(ProcForceScreenSaver);
-DISPATCH_PROC(ProcFreeColormap);
-DISPATCH_PROC(ProcFreeColors);
-DISPATCH_PROC(ProcFreeCursor);
-DISPATCH_PROC(ProcFreeGC);
-DISPATCH_PROC(ProcFreePixmap);
-DISPATCH_PROC(ProcGetAtomName);
-DISPATCH_PROC(ProcGetFontPath);
-DISPATCH_PROC(ProcGetGeometry);
-DISPATCH_PROC(ProcGetImage);
-DISPATCH_PROC(ProcGetKeyboardControl);
-DISPATCH_PROC(ProcGetKeyboardMapping);
-DISPATCH_PROC(ProcGetModifierMapping);
-DISPATCH_PROC(ProcGetMotionEvents);
-DISPATCH_PROC(ProcGetPointerControl);
-DISPATCH_PROC(ProcGetPointerMapping);
-DISPATCH_PROC(ProcGetProperty);
-DISPATCH_PROC(ProcGetScreenSaver);
-DISPATCH_PROC(ProcGetSelectionOwner);
-DISPATCH_PROC(ProcGetWindowAttributes);
-DISPATCH_PROC(ProcGrabServer);
-DISPATCH_PROC(ProcImageText16);
-DISPATCH_PROC(ProcImageText8);
-DISPATCH_PROC(ProcInitialConnection);
-DISPATCH_PROC(ProcInstallColormap);
-DISPATCH_PROC(ProcInternAtom);
-DISPATCH_PROC(ProcKillClient);
-DISPATCH_PROC(ProcListExtensions);
-DISPATCH_PROC(ProcListFonts);
-DISPATCH_PROC(ProcListFontsWithInfo);
-DISPATCH_PROC(ProcListHosts);
-DISPATCH_PROC(ProcListInstalledColormaps);
-DISPATCH_PROC(ProcListProperties);
-DISPATCH_PROC(ProcLookupColor);
-DISPATCH_PROC(ProcMapSubwindows);
-DISPATCH_PROC(ProcMapWindow);
-DISPATCH_PROC(ProcNoOperation);
-DISPATCH_PROC(ProcOpenFont);
-DISPATCH_PROC(ProcPolyArc);
-DISPATCH_PROC(ProcPolyFillArc);
-DISPATCH_PROC(ProcPolyFillRectangle);
-DISPATCH_PROC(ProcPolyLine);
-DISPATCH_PROC(ProcPolyPoint);
-DISPATCH_PROC(ProcPolyRectangle);
-DISPATCH_PROC(ProcPolySegment);
-DISPATCH_PROC(ProcPolyText);
-DISPATCH_PROC(ProcPutImage);
-DISPATCH_PROC(ProcQueryBestSize);
-DISPATCH_PROC(ProcQueryColors);
-DISPATCH_PROC(ProcQueryExtension);
-DISPATCH_PROC(ProcQueryFont);
-DISPATCH_PROC(ProcQueryKeymap);
-DISPATCH_PROC(ProcQueryTextExtents);
-DISPATCH_PROC(ProcQueryTree);
-DISPATCH_PROC(ProcReparentWindow);
-DISPATCH_PROC(ProcRotateProperties);
-DISPATCH_PROC(ProcSetClipRectangles);
-DISPATCH_PROC(ProcSetDashes);
-DISPATCH_PROC(ProcSetFontPath);
-DISPATCH_PROC(ProcSetModifierMapping);
-DISPATCH_PROC(ProcSetPointerMapping);
-DISPATCH_PROC(ProcSetScreenSaver);
-DISPATCH_PROC(ProcSetSelectionOwner);
-DISPATCH_PROC(ProcStoreColors);
-DISPATCH_PROC(ProcStoreNamedColor);
-DISPATCH_PROC(ProcTranslateCoords);
-DISPATCH_PROC(ProcUngrabServer);
-DISPATCH_PROC(ProcUninstallColormap);
-DISPATCH_PROC(ProcUnmapSubwindows);
-DISPATCH_PROC(ProcUnmapWindow);
+int ProcAllocColor(ClientPtr /* client */);
+int ProcAllocColorCells(ClientPtr /* client */);
+int ProcAllocColorPlanes(ClientPtr /* client */);
+int ProcAllocNamedColor(ClientPtr /* client */);
+int ProcBell(ClientPtr /* client */);
+int ProcChangeAccessControl(ClientPtr /* client */);
+int ProcChangeCloseDownMode(ClientPtr /* client */);
+int ProcChangeGC(ClientPtr /* client */);
+int ProcChangeHosts(ClientPtr /* client */);
+int ProcChangeKeyboardControl(ClientPtr /* client */);
+int ProcChangeKeyboardMapping(ClientPtr /* client */);
+int ProcChangePointerControl(ClientPtr /* client */);
+int ProcChangeProperty(ClientPtr /* client */);
+int ProcChangeSaveSet(ClientPtr /* client */);
+int ProcChangeWindowAttributes(ClientPtr /* client */);
+int ProcCirculateWindow(ClientPtr /* client */);
+int ProcClearToBackground(ClientPtr /* client */);
+int ProcCloseFont(ClientPtr /* client */);
+int ProcConfigureWindow(ClientPtr /* client */);
+int ProcConvertSelection(ClientPtr /* client */);
+int ProcCopyArea(ClientPtr /* client */);
+int ProcCopyColormapAndFree(ClientPtr /* client */);
+int ProcCopyGC(ClientPtr /* client */);
+int ProcCopyPlane(ClientPtr /* client */);
+int ProcCreateColormap(ClientPtr /* client */);
+int ProcCreateCursor(ClientPtr /* client */);
+int ProcCreateGC(ClientPtr /* client */);
+int ProcCreateGlyphCursor(ClientPtr /* client */);
+int ProcCreatePixmap(ClientPtr /* client */);
+int ProcCreateWindow(ClientPtr /* client */);
+int ProcDeleteProperty(ClientPtr /* client */);
+int ProcDestroySubwindows(ClientPtr /* client */);
+int ProcDestroyWindow(ClientPtr /* client */);
+int ProcEstablishConnection(ClientPtr /* client */);
+int ProcFillPoly(ClientPtr /* client */);
+int ProcForceScreenSaver(ClientPtr /* client */);
+int ProcFreeColormap(ClientPtr /* client */);
+int ProcFreeColors(ClientPtr /* client */);
+int ProcFreeCursor(ClientPtr /* client */);
+int ProcFreeGC(ClientPtr /* client */);
+int ProcFreePixmap(ClientPtr /* client */);
+int ProcGetAtomName(ClientPtr /* client */);
+int ProcGetFontPath(ClientPtr /* client */);
+int ProcGetGeometry(ClientPtr /* client */);
+int ProcGetImage(ClientPtr /* client */);
+int ProcGetKeyboardControl(ClientPtr /* client */);
+int ProcGetKeyboardMapping(ClientPtr /* client */);
+int ProcGetModifierMapping(ClientPtr /* client */);
+int ProcGetMotionEvents(ClientPtr /* client */);
+int ProcGetPointerControl(ClientPtr /* client */);
+int ProcGetPointerMapping(ClientPtr /* client */);
+int ProcGetProperty(ClientPtr /* client */);
+int ProcGetScreenSaver(ClientPtr /* client */);
+int ProcGetSelectionOwner(ClientPtr /* client */);
+int ProcGetWindowAttributes(ClientPtr /* client */);
+int ProcGrabServer(ClientPtr /* client */);
+int ProcImageText16(ClientPtr /* client */);
+int ProcImageText8(ClientPtr /* client */);
+int ProcInitialConnection(ClientPtr /* client */);
+int ProcInstallColormap(ClientPtr /* client */);
+int ProcInternAtom(ClientPtr /* client */);
+int ProcKillClient(ClientPtr /* client */);
+int ProcListExtensions(ClientPtr /* client */);
+int ProcListFonts(ClientPtr /* client */);
+int ProcListFontsWithInfo(ClientPtr /* client */);
+int ProcListHosts(ClientPtr /* client */);
+int ProcListInstalledColormaps(ClientPtr /* client */);
+int ProcListProperties(ClientPtr /* client */);
+int ProcLookupColor(ClientPtr /* client */);
+int ProcMapSubwindows(ClientPtr /* client */);
+int ProcMapWindow(ClientPtr /* client */);
+int ProcNoOperation(ClientPtr /* client */);
+int ProcOpenFont(ClientPtr /* client */);
+int ProcPolyArc(ClientPtr /* client */);
+int ProcPolyFillArc(ClientPtr /* client */);
+int ProcPolyFillRectangle(ClientPtr /* client */);
+int ProcPolyLine(ClientPtr /* client */);
+int ProcPolyPoint(ClientPtr /* client */);
+int ProcPolyRectangle(ClientPtr /* client */);
+int ProcPolySegment(ClientPtr /* client */);
+int ProcPolyText(ClientPtr /* client */);
+int ProcPutImage(ClientPtr /* client */);
+int ProcQueryBestSize(ClientPtr /* client */);
+int ProcQueryColors(ClientPtr /* client */);
+int ProcQueryExtension(ClientPtr /* client */);
+int ProcQueryFont(ClientPtr /* client */);
+int ProcQueryKeymap(ClientPtr /* client */);
+int ProcQueryTextExtents(ClientPtr /* client */);
+int ProcQueryTree(ClientPtr /* client */);
+int ProcReparentWindow(ClientPtr /* client */);
+int ProcRotateProperties(ClientPtr /* client */);
+int ProcSetClipRectangles(ClientPtr /* client */);
+int ProcSetDashes(ClientPtr /* client */);
+int ProcSetFontPath(ClientPtr /* client */);
+int ProcSetModifierMapping(ClientPtr /* client */);
+int ProcSetPointerMapping(ClientPtr /* client */);
+int ProcSetScreenSaver(ClientPtr /* client */);
+int ProcSetSelectionOwner(ClientPtr /* client */);
+int ProcStoreColors(ClientPtr /* client */);
+int ProcStoreNamedColor(ClientPtr /* client */);
+int ProcTranslateCoords(ClientPtr /* client */);
+int ProcUngrabServer(ClientPtr /* client */);
+int ProcUninstallColormap(ClientPtr /* client */);
+int ProcUnmapSubwindows(ClientPtr /* client */);
+int ProcUnmapWindow(ClientPtr /* client */);
#endif /* DISPATCH_H */
diff --git a/hw/dmx/dmx.c b/hw/dmx/dmx.c
index 5718b6a59..1dee077b5 100644
--- a/hw/dmx/dmx.c
+++ b/hw/dmx/dmx.c
@@ -69,39 +69,7 @@ extern void DMXExtensionInit(void);
static unsigned char DMXCode;
-static DISPATCH_PROC(ProcDMXDispatch);
-static DISPATCH_PROC(ProcDMXQueryVersion);
-static DISPATCH_PROC(ProcDMXSync);
-static DISPATCH_PROC(ProcDMXForceWindowCreation);
-static DISPATCH_PROC(ProcDMXGetScreenCount);
-static DISPATCH_PROC(ProcDMXGetScreenAttributes);
-static DISPATCH_PROC(ProcDMXChangeScreensAttributes);
-static DISPATCH_PROC(ProcDMXAddScreen);
-static DISPATCH_PROC(ProcDMXRemoveScreen);
-static DISPATCH_PROC(ProcDMXGetWindowAttributes);
-static DISPATCH_PROC(ProcDMXGetDesktopAttributes);
-static DISPATCH_PROC(ProcDMXChangeDesktopAttributes);
-static DISPATCH_PROC(ProcDMXGetInputCount);
-static DISPATCH_PROC(ProcDMXGetInputAttributes);
-static DISPATCH_PROC(ProcDMXAddInput);
-static DISPATCH_PROC(ProcDMXRemoveInput);
-
-static DISPATCH_PROC(SProcDMXDispatch);
-static DISPATCH_PROC(SProcDMXQueryVersion);
-static DISPATCH_PROC(SProcDMXSync);
-static DISPATCH_PROC(SProcDMXForceWindowCreation);
-static DISPATCH_PROC(SProcDMXGetScreenCount);
-static DISPATCH_PROC(SProcDMXGetScreenAttributes);
-static DISPATCH_PROC(SProcDMXChangeScreensAttributes);
-static DISPATCH_PROC(SProcDMXAddScreen);
-static DISPATCH_PROC(SProcDMXRemoveScreen);
-static DISPATCH_PROC(SProcDMXGetWindowAttributes);
-static DISPATCH_PROC(SProcDMXGetDesktopAttributes);
-static DISPATCH_PROC(SProcDMXChangeDesktopAttributes);
-static DISPATCH_PROC(SProcDMXGetInputCount);
-static DISPATCH_PROC(SProcDMXGetInputAttributes);
-static DISPATCH_PROC(SProcDMXAddInput);
-static DISPATCH_PROC(SProcDMXRemoveInput);
+
static int _DMXXineramaActive(void)
{
@@ -111,17 +79,6 @@ static int _DMXXineramaActive(void)
return 0;
}
-/** Initialize the extension. */
-void DMXExtensionInit(void)
-{
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
- ProcDMXDispatch, SProcDMXDispatch,
- NULL, StandardMinorOpcode)))
- DMXCode = extEntry->base;
-}
-
static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
CARD32 value)
{
@@ -1125,3 +1082,14 @@ static int SProcDMXDispatch (ClientPtr client)
default: return BadRequest;
}
}
+
+/** Initialize the extension. */
+void DMXExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+
+ if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
+ ProcDMXDispatch, SProcDMXDispatch,
+ NULL, StandardMinorOpcode)))
+ DMXCode = extEntry->base;
+}
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index ce584b051..8874a436e 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -72,23 +72,7 @@ typedef EphyrDRIScreenPrivRec* EphyrDRIScreenPrivPtr;
static int DRIErrorBase;
-static DISPATCH_PROC(ProcXF86DRIQueryVersion);
-static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(ProcXF86DRIOpenConnection);
-static DISPATCH_PROC(ProcXF86DRICloseConnection);
-static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
-static DISPATCH_PROC(ProcXF86DRICreateContext);
-static DISPATCH_PROC(ProcXF86DRIDestroyContext);
-static DISPATCH_PROC(ProcXF86DRICreateDrawable);
-static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
-static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
-static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
-static DISPATCH_PROC(ProcXF86DRIDispatch);
-static DISPATCH_PROC(ProcXF86DRIAuthConnection);
-
-static DISPATCH_PROC(SProcXF86DRIQueryVersion);
-static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(SProcXF86DRIDispatch);
+
static Bool ephyrDRIScreenInit (ScreenPtr a_screen) ;
static Bool ephyrDRICreateWindow (WindowPtr a_win) ;
@@ -119,65 +103,6 @@ static DevPrivateKeyRec ephyrDRIScreenKeyRec;
#define GET_EPHYR_DRI_SCREEN_PRIV(screen) ((EphyrDRIScreenPrivPtr) \
dixLookupPrivate(&(screen)->devPrivates, ephyrDRIScreenKey))
-
-Bool
-ephyrDRIExtensionInit (ScreenPtr a_screen)
-{
- Bool is_ok=FALSE ;
- ExtensionEntry* extEntry=NULL;
- EphyrDRIScreenPrivPtr screen_priv=NULL ;
-
- EPHYR_LOG ("enter\n") ;
- if (!hostx_has_dri ()) {
- EPHYR_LOG ("host does not have DRI extension\n") ;
- goto out ;
- }
- EPHYR_LOG ("host X does have DRI extension\n") ;
- if (!hostx_has_xshape ()) {
- EPHYR_LOG ("host does not have XShape extension\n") ;
- goto out ;
- }
- EPHYR_LOG ("host X does have XShape extension\n") ;
-
-#ifdef XF86DRI_EVENTS
- EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
- if (!EventType) {
- EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
- goto out ;
- }
-#endif
-
- if ((extEntry = AddExtension(XF86DRINAME,
- XF86DRINumberEvents,
- XF86DRINumberErrors,
- ProcXF86DRIDispatch,
- SProcXF86DRIDispatch,
- NULL,
- StandardMinorOpcode))) {
- DRIReqCode = (unsigned char)extEntry->base;
- DRIErrorBase = extEntry->errorBase;
- } else {
- EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
- goto out ;
- }
- screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
- if (!screen_priv) {
- EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
- goto out ;
- }
- dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
-
- if (!ephyrDRIScreenInit (a_screen)) {
- EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
- goto out ;
- }
- EphyrMirrorHostVisuals (a_screen) ;
- is_ok=TRUE ;
-out:
- EPHYR_LOG ("leave\n") ;
- return is_ok ;
-}
-
static Bool
ephyrDRIScreenInit (ScreenPtr a_screen)
{
@@ -1428,3 +1353,61 @@ SProcXF86DRIDispatch (register ClientPtr client)
}
}
}
+
+Bool
+ephyrDRIExtensionInit (ScreenPtr a_screen)
+{
+ Bool is_ok=FALSE ;
+ ExtensionEntry* extEntry=NULL;
+ EphyrDRIScreenPrivPtr screen_priv=NULL ;
+
+ EPHYR_LOG ("enter\n") ;
+ if (!hostx_has_dri ()) {
+ EPHYR_LOG ("host does not have DRI extension\n") ;
+ goto out ;
+ }
+ EPHYR_LOG ("host X does have DRI extension\n") ;
+ if (!hostx_has_xshape ()) {
+ EPHYR_LOG ("host does not have XShape extension\n") ;
+ goto out ;
+ }
+ EPHYR_LOG ("host X does have XShape extension\n") ;
+
+#ifdef XF86DRI_EVENTS
+ EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
+ if (!EventType) {
+ EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
+ goto out ;
+ }
+#endif
+
+ if ((extEntry = AddExtension(XF86DRINAME,
+ XF86DRINumberEvents,
+ XF86DRINumberErrors,
+ ProcXF86DRIDispatch,
+ SProcXF86DRIDispatch,
+ NULL,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ } else {
+ EPHYR_LOG_ERROR ("failed to register DRI extension\n") ;
+ goto out ;
+ }
+ screen_priv = calloc(1, sizeof (EphyrDRIScreenPrivRec)) ;
+ if (!screen_priv) {
+ EPHYR_LOG_ERROR ("failed to allocate screen_priv\n") ;
+ goto out ;
+ }
+ dixSetPrivate(&a_screen->devPrivates, ephyrDRIScreenKey, screen_priv);
+
+ if (!ephyrDRIScreenInit (a_screen)) {
+ EPHYR_LOG_ERROR ("ephyrDRIScreenInit() failed\n") ;
+ goto out ;
+ }
+ EphyrMirrorHostVisuals (a_screen) ;
+ is_ok=TRUE ;
+out:
+ EPHYR_LOG ("leave\n") ;
+ return is_ok ;
+}
diff --git a/hw/xfree86/dixmods/extmod/Makefile.am b/hw/xfree86/dixmods/extmod/Makefile.am
index d93e63afa..cce19f7da 100644
--- a/hw/xfree86/dixmods/extmod/Makefile.am
+++ b/hw/xfree86/dixmods/extmod/Makefile.am
@@ -4,7 +4,7 @@ extsmoduledir = $(moduledir)/extensions
extsmodule_LTLIBRARIES = libextmod.la
if DGA
-DGA_SRCS = xf86dga2.c dgaproc.h xf86dgaext.h
+DGA_SRCS = xf86dga2.c dgaproc.h
endif
if XV
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index e522b5c47..ca5d519e5 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -25,7 +25,6 @@
#include <X11/extensions/xf86dgaproto.h>
#include "swaprep.h"
#include "dgaproc.h"
-#include "xf86dgaext.h"
#include "protocol-versions.h"
#include <string.h>
@@ -34,24 +33,6 @@
#define DGA_PROTOCOL_OLD_SUPPORT 1
-static DISPATCH_PROC(ProcXDGADispatch);
-static DISPATCH_PROC(SProcXDGADispatch);
-static DISPATCH_PROC(ProcXDGAQueryVersion);
-static DISPATCH_PROC(ProcXDGAQueryModes);
-static DISPATCH_PROC(ProcXDGASetMode);
-static DISPATCH_PROC(ProcXDGAOpenFramebuffer);
-static DISPATCH_PROC(ProcXDGACloseFramebuffer);
-static DISPATCH_PROC(ProcXDGASetViewport);
-static DISPATCH_PROC(ProcXDGAInstallColormap);
-static DISPATCH_PROC(ProcXDGASelectInput);
-static DISPATCH_PROC(ProcXDGAFillRectangle);
-static DISPATCH_PROC(ProcXDGACopyArea);
-static DISPATCH_PROC(ProcXDGACopyTransparentArea);
-static DISPATCH_PROC(ProcXDGAGetViewportStatus);
-static DISPATCH_PROC(ProcXDGASync);
-static DISPATCH_PROC(ProcXDGASetClientVersion);
-static DISPATCH_PROC(ProcXDGAChangePixmapMode);
-static DISPATCH_PROC(ProcXDGACreateColormap);
static void XDGAResetProc(ExtensionEntry *extEntry);
@@ -85,36 +66,6 @@ typedef struct {
dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p)
-void
-XFree86DGAExtensionInit(INITARGS)
-{
- ExtensionEntry* extEntry;
-
- if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
- return;
-
- if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-
- if ((extEntry = AddExtension(XF86DGANAME,
- XF86DGANumberEvents,
- XF86DGANumberErrors,
- ProcXDGADispatch,
- SProcXDGADispatch,
- XDGAResetProc,
- StandardMinorOpcode))) {
- int i;
-
- DGAReqCode = (unsigned char)extEntry->base;
- DGAErrorBase = extEntry->errorBase;
- DGAEventBase = extEntry->eventBase;
- for (i = KeyPress; i <= MotionNotify; i++)
- SetCriticalEvent (DGAEventBase + i);
- }
-}
-
-
-
static void
XDGAResetProc (ExtensionEntry *extEntry)
{
@@ -663,15 +614,6 @@ ProcXDGACreateColormap(ClientPtr client)
#ifdef DGA_PROTOCOL_OLD_SUPPORT
-static DISPATCH_PROC(ProcXF86DGADirectVideo);
-static DISPATCH_PROC(ProcXF86DGAGetVidPage);
-static DISPATCH_PROC(ProcXF86DGAGetVideoLL);
-static DISPATCH_PROC(ProcXF86DGAGetViewPortSize);
-static DISPATCH_PROC(ProcXF86DGASetVidPage);
-static DISPATCH_PROC(ProcXF86DGASetViewPort);
-static DISPATCH_PROC(ProcXF86DGAInstallColormap);
-static DISPATCH_PROC(ProcXF86DGAQueryDirectVideo);
-static DISPATCH_PROC(ProcXF86DGAViewPortChanged);
static int
@@ -1063,3 +1005,31 @@ XFree86DGARegister(INITARGS)
{
XDGAEventBase = &DGAEventBase;
}
+
+void
+XFree86DGAExtensionInit(INITARGS)
+{
+ ExtensionEntry* extEntry;
+
+ if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0))
+ return;
+
+ if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
+ if ((extEntry = AddExtension(XF86DGANAME,
+ XF86DGANumberEvents,
+ XF86DGANumberErrors,
+ ProcXDGADispatch,
+ SProcXDGADispatch,
+ XDGAResetProc,
+ StandardMinorOpcode))) {
+ int i;
+
+ DGAReqCode = (unsigned char)extEntry->base;
+ DGAErrorBase = extEntry->errorBase;
+ DGAEventBase = extEntry->eventBase;
+ for (i = KeyPress; i <= MotionNotify; i++)
+ SetCriticalEvent (DGAEventBase + i);
+ }
+}
diff --git a/hw/xfree86/dixmods/extmod/xf86dgaext.h b/hw/xfree86/dixmods/extmod/xf86dgaext.h
deleted file mode 100644
index 2b1737305..000000000
--- a/hw/xfree86/dixmods/extmod/xf86dgaext.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _XF86DGAEXT_H_
-#define _XF86DGAEXT_H_
-
-extern DISPATCH_PROC(ProcXF86DGADispatch);
-
-#endif /* _XF86DGAEXT_H_ */
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index 0001c9eeb..4737f2d96 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -65,48 +65,6 @@ typedef struct {
#define VM_SETPRIV(c,p) \
dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
-static DISPATCH_PROC(ProcXF86VidModeDispatch);
-static DISPATCH_PROC(ProcXF86VidModeGetAllModeLines);
-static DISPATCH_PROC(ProcXF86VidModeGetModeLine);
-static DISPATCH_PROC(ProcXF86VidModeGetMonitor);
-static DISPATCH_PROC(ProcXF86VidModeLockModeSwitch);
-static DISPATCH_PROC(ProcXF86VidModeAddModeLine);
-static DISPATCH_PROC(ProcXF86VidModeDeleteModeLine);
-static DISPATCH_PROC(ProcXF86VidModeModModeLine);
-static DISPATCH_PROC(ProcXF86VidModeValidateModeLine);
-static DISPATCH_PROC(ProcXF86VidModeQueryVersion);
-static DISPATCH_PROC(ProcXF86VidModeSwitchMode);
-static DISPATCH_PROC(ProcXF86VidModeSwitchToMode);
-static DISPATCH_PROC(ProcXF86VidModeGetViewPort);
-static DISPATCH_PROC(ProcXF86VidModeSetViewPort);
-static DISPATCH_PROC(ProcXF86VidModeGetDotClocks);
-static DISPATCH_PROC(ProcXF86VidModeSetGamma);
-static DISPATCH_PROC(ProcXF86VidModeGetGamma);
-static DISPATCH_PROC(ProcXF86VidModeSetClientVersion);
-static DISPATCH_PROC(ProcXF86VidModeGetGammaRamp);
-static DISPATCH_PROC(ProcXF86VidModeSetGammaRamp);
-static DISPATCH_PROC(ProcXF86VidModeGetGammaRampSize);
-static DISPATCH_PROC(SProcXF86VidModeDispatch);
-static DISPATCH_PROC(SProcXF86VidModeGetAllModeLines);
-static DISPATCH_PROC(SProcXF86VidModeGetModeLine);
-static DISPATCH_PROC(SProcXF86VidModeGetMonitor);
-static DISPATCH_PROC(SProcXF86VidModeLockModeSwitch);
-static DISPATCH_PROC(SProcXF86VidModeAddModeLine);
-static DISPATCH_PROC(SProcXF86VidModeDeleteModeLine);
-static DISPATCH_PROC(SProcXF86VidModeModModeLine);
-static DISPATCH_PROC(SProcXF86VidModeValidateModeLine);
-static DISPATCH_PROC(SProcXF86VidModeQueryVersion);
-static DISPATCH_PROC(SProcXF86VidModeSwitchMode);
-static DISPATCH_PROC(SProcXF86VidModeSwitchToMode);
-static DISPATCH_PROC(SProcXF86VidModeGetViewPort);
-static DISPATCH_PROC(SProcXF86VidModeSetViewPort);
-static DISPATCH_PROC(SProcXF86VidModeGetDotClocks);
-static DISPATCH_PROC(SProcXF86VidModeSetGamma);
-static DISPATCH_PROC(SProcXF86VidModeGetGamma);
-static DISPATCH_PROC(SProcXF86VidModeSetClientVersion);
-static DISPATCH_PROC(SProcXF86VidModeGetGammaRamp);
-static DISPATCH_PROC(SProcXF86VidModeSetGammaRamp);
-static DISPATCH_PROC(SProcXF86VidModeGetGammaRampSize);
#if 0
static unsigned char XF86VidModeReqCode = 0;
@@ -159,58 +117,6 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
# define DEBUG_P(x) /**/
#endif
-void
-XFree86VidModeExtensionInit(void)
-{
- ExtensionEntry* extEntry;
- ScreenPtr pScreen;
- int i;
- Bool enabled = FALSE;
-
- DEBUG_P("XFree86VidModeExtensionInit");
-
- if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
- return;
-#ifdef XF86VIDMODE_EVENTS
- if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-#endif
-
-#ifdef XF86VIDMODE_EVENTS
- EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
-#endif
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if (VidModeExtensionInit(pScreen))
- enabled = TRUE;
- }
- /* This means that the DDX doesn't want the vidmode extension enabled */
- if (!enabled)
- return;
-
- if (
-#ifdef XF86VIDMODE_EVENTS
- EventType &&
-#endif
- (extEntry = AddExtension(XF86VIDMODENAME,
- XF86VidModeNumberEvents,
- XF86VidModeNumberErrors,
- ProcXF86VidModeDispatch,
- SProcXF86VidModeDispatch,
- NULL,
- StandardMinorOpcode))) {
-#if 0
- XF86VidModeReqCode = (unsigned char)extEntry->base;
-#endif
- VidModeErrorBase = extEntry->errorBase;
-#ifdef XF86VIDMODE_EVENTS
- XF86VidModeEventBase = extEntry->eventBase;
- EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
-#endif
- }
-}
-
static int
ClientMajorVersion(ClientPtr client)
{
@@ -2166,3 +2072,55 @@ SProcXF86VidModeDispatch(ClientPtr client)
return VidModeErrorBase + XF86VidModeClientNotLocal;
}
}
+
+void
+XFree86VidModeExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+ ScreenPtr pScreen;
+ int i;
+ Bool enabled = FALSE;
+
+ DEBUG_P("XFree86VidModeExtensionInit");
+
+ if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
+ return;
+#ifdef XF86VIDMODE_EVENTS
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+#endif
+
+#ifdef XF86VIDMODE_EVENTS
+ EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
+#endif
+
+ for(i = 0; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+ if (VidModeExtensionInit(pScreen))
+ enabled = TRUE;
+ }
+ /* This means that the DDX doesn't want the vidmode extension enabled */
+ if (!enabled)
+ return;
+
+ if (
+#ifdef XF86VIDMODE_EVENTS
+ EventType &&
+#endif
+ (extEntry = AddExtension(XF86VIDMODENAME,
+ XF86VidModeNumberEvents,
+ XF86VidModeNumberErrors,
+ ProcXF86VidModeDispatch,
+ SProcXF86VidModeDispatch,
+ NULL,
+ StandardMinorOpcode))) {
+#if 0
+ XF86VidModeReqCode = (unsigned char)extEntry->base;
+#endif
+ VidModeErrorBase = extEntry->errorBase;
+#ifdef XF86VIDMODE_EVENTS
+ XF86VidModeEventBase = extEntry->eventBase;
+ EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
+#endif
+ }
+}
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index f32565d3c..20baa24f2 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -64,23 +64,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static int DRIErrorBase;
-static DISPATCH_PROC(ProcXF86DRIQueryVersion);
-static DISPATCH_PROC(ProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(ProcXF86DRIOpenConnection);
-static DISPATCH_PROC(ProcXF86DRICloseConnection);
-static DISPATCH_PROC(ProcXF86DRIGetClientDriverName);
-static DISPATCH_PROC(ProcXF86DRICreateContext);
-static DISPATCH_PROC(ProcXF86DRIDestroyContext);
-static DISPATCH_PROC(ProcXF86DRICreateDrawable);
-static DISPATCH_PROC(ProcXF86DRIDestroyDrawable);
-static DISPATCH_PROC(ProcXF86DRIGetDrawableInfo);
-static DISPATCH_PROC(ProcXF86DRIGetDeviceInfo);
-static DISPATCH_PROC(ProcXF86DRIDispatch);
-static DISPATCH_PROC(ProcXF86DRIAuthConnection);
-
-static DISPATCH_PROC(SProcXF86DRIQueryVersion);
-static DISPATCH_PROC(SProcXF86DRIQueryDirectRenderingCapable);
-static DISPATCH_PROC(SProcXF86DRIDispatch);
+
static void XF86DRIResetProc(ExtensionEntry* extEntry);
@@ -88,32 +72,6 @@ static unsigned char DRIReqCode = 0;
extern void XFree86DRIExtensionInit(void);
-void
-XFree86DRIExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
-#ifdef XF86DRI_EVENTS
- EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
-#endif
-
- if (
- DRIExtensionInit() &&
-#ifdef XF86DRI_EVENTS
- EventType && ScreenPrivateIndex != -1 &&
-#endif
- (extEntry = AddExtension(XF86DRINAME,
- XF86DRINumberEvents,
- XF86DRINumberErrors,
- ProcXF86DRIDispatch,
- SProcXF86DRIDispatch,
- XF86DRIResetProc,
- StandardMinorOpcode))) {
- DRIReqCode = (unsigned char)extEntry->base;
- DRIErrorBase = extEntry->errorBase;
- }
-}
-
/*ARGSUSED*/
static void
XF86DRIResetProc (
@@ -677,3 +635,29 @@ SProcXF86DRIDispatch (
return DRIErrorBase + XF86DRIClientNotLocal;
}
}
+
+void
+XFree86DRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+#ifdef XF86DRI_EVENTS
+ EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
+#endif
+
+ if (
+ DRIExtensionInit() &&
+#ifdef XF86DRI_EVENTS
+ EventType && ScreenPrivateIndex != -1 &&
+#endif
+ (extEntry = AddExtension(XF86DRINAME,
+ XF86DRINumberEvents,
+ XF86DRINumberErrors,
+ ProcXF86DRIDispatch,
+ SProcXF86DRIDispatch,
+ XF86DRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ }
+}
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 1c77ad984..cd2bdf0ba 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -70,8 +70,6 @@ static AppleWMProcsPtr appleWMProcs;
static int WMErrorBase;
-static DISPATCH_PROC(ProcAppleWMDispatch);
-static DISPATCH_PROC(SProcAppleWMDispatch);
static unsigned char WMReqCode = 0;
static int WMEventBase = 0;
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c
index 3afe2443c..ebd4a4374 100644
--- a/hw/xquartz/xpr/appledri.c
+++ b/hw/xquartz/xpr/appledri.c
@@ -59,8 +59,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static int DRIErrorBase = 0;
-static DISPATCH_PROC(ProcAppleDRIDispatch);
-static DISPATCH_PROC(SProcAppleDRIDispatch);
static void AppleDRIResetProc(ExtensionEntry* extEntry);
static int ProcAppleDRICreatePixmap(ClientPtr client);
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index 705e618de..0ffa94092 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -39,9 +39,9 @@
*/
#ifdef XWIN_CLIPBOARD
-DISPATCH_PROC(winProcEstablishConnection);
-DISPATCH_PROC(winProcQueryTree);
-DISPATCH_PROC(winProcSetSelectionOwner);
+int winProcEstablishConnection(ClientPtr /* client */);
+int winProcQueryTree(ClientPtr /* client */);
+int winProcSetSelectionOwner(ClientPtr /* client */);
#endif
diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c
index bec63ac8e..d74cd03e2 100644
--- a/hw/xwin/winclipboardinit.c
+++ b/hw/xwin/winclipboardinit.c
@@ -41,7 +41,7 @@
typedef int (*winDispatchProcPtr) (ClientPtr);
-DISPATCH_PROC(winProcSetSelectionOwner);
+int winProcSetSelectionOwner(ClientPtr /* client */);
/*
diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c
index 658d050d2..bdacefba5 100755
--- a/hw/xwin/winclipboardwrappers.c
+++ b/hw/xwin/winclipboardwrappers.c
@@ -52,9 +52,9 @@
* Local function prototypes
*/
-DISPATCH_PROC(winProcEstablishConnection);
-DISPATCH_PROC(winProcQueryTree);
-DISPATCH_PROC(winProcSetSelectionOwner);
+int winProcEstablishConnection(ClientPtr /* client */);
+int winProcQueryTree(ClientPtr /* client */);
+int winProcSetSelectionOwner(ClientPtr /* client */);
/*
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 34d7f4b5c..ca3dbc325 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -45,8 +45,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
static int WMErrorBase;
-static DISPATCH_PROC(ProcWindowsWMDispatch);
-static DISPATCH_PROC(SProcWindowsWMDispatch);
static unsigned char WMReqCode = 0;
static int WMEventBase = 0;