diff options
author | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-03-26 14:23:28 +0200 |
commit | 76bcc36ed305418a3ddc5752d287ede894243e1b (patch) | |
tree | bacb320c825768471ce56f058f17ce863d592376 /xorg-server/glx/glxext.c | |
parent | 7d894e32566b710952c44cbc71939ad1d9e2fa8d (diff) | |
parent | 0f834b91a4768673833ab4917e87d86c237bb1a6 (diff) | |
download | vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.gz vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.tar.bz2 vcxsrv-76bcc36ed305418a3ddc5752d287ede894243e1b.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
pixman/pixman/pixman-mmx.c
xorg-server/Xext/shm.c
xorg-server/Xext/syncsrv.h
xorg-server/Xext/xvmain.c
xorg-server/Xi/exevents.c
xorg-server/Xi/opendev.c
xorg-server/composite/compalloc.c
xorg-server/composite/compoverlay.c
xorg-server/dix/colormap.c
xorg-server/dix/devices.c
xorg-server/dix/dispatch.c
xorg-server/dix/dixfonts.c
xorg-server/dix/eventconvert.c
xorg-server/dix/events.c
xorg-server/dix/gc.c
xorg-server/dix/getevents.c
xorg-server/dix/main.c
xorg-server/dix/privates.c
xorg-server/dix/registry.c
xorg-server/dix/resource.c
xorg-server/exa/exa_accel.c
xorg-server/exa/exa_migration_classic.c
xorg-server/exa/exa_unaccel.c
xorg-server/fb/fb.h
xorg-server/fb/fbcopy.c
xorg-server/fb/fbpixmap.c
xorg-server/glx/dispatch.h
xorg-server/glx/glapi.h
xorg-server/glx/glapi_gentable.c
xorg-server/glx/glapitable.h
xorg-server/glx/glprocs.h
xorg-server/glx/glxcmds.c
xorg-server/glx/glxcmdsswap.c
xorg-server/glx/glxdricommon.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/glxext.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch.h
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_size.h
xorg-server/glx/indirect_size_get.h
xorg-server/glx/indirect_table.c
xorg-server/glx/indirect_util.c
xorg-server/glx/rensize.c
xorg-server/glx/single2swap.c
xorg-server/glx/singlepix.c
xorg-server/glx/singlepixswap.c
xorg-server/glx/singlesize.c
xorg-server/hw/dmx/dmxinit.c
xorg-server/hw/kdrive/ephyr/ephyr.c
xorg-server/hw/kdrive/ephyr/hostx.c
xorg-server/hw/kdrive/ephyr/hostx.h
xorg-server/hw/kdrive/src/kinput.c
xorg-server/hw/xfree86/common/compiler.h
xorg-server/hw/xwin/InitInput.c
xorg-server/hw/xwin/InitOutput.c
xorg-server/hw/xwin/ddraw.h
xorg-server/hw/xwin/glx/glwrap.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/hw/xwin/glx/wgl_ext_api.h
xorg-server/hw/xwin/glx/winpriv.c
xorg-server/hw/xwin/win.h
xorg-server/hw/xwin/winallpriv.c
xorg-server/hw/xwin/winauth.c
xorg-server/hw/xwin/winclipboard.h
xorg-server/hw/xwin/winclipboardinit.c
xorg-server/hw/xwin/winclipboardthread.c
xorg-server/hw/xwin/winclipboardunicode.c
xorg-server/hw/xwin/winclipboardwndproc.c
xorg-server/hw/xwin/winclipboardwrappers.c
xorg-server/hw/xwin/winclipboardxevents.c
xorg-server/hw/xwin/wincmap.c
xorg-server/hw/xwin/winconfig.c
xorg-server/hw/xwin/wincreatewnd.c
xorg-server/hw/xwin/wincursor.c
xorg-server/hw/xwin/windialogs.c
xorg-server/hw/xwin/winengine.c
xorg-server/hw/xwin/winerror.c
xorg-server/hw/xwin/wingc.c
xorg-server/hw/xwin/wingetsp.c
xorg-server/hw/xwin/winkeybd.c
xorg-server/hw/xwin/winkeybd.h
xorg-server/hw/xwin/winlayouts.h
xorg-server/hw/xwin/winmisc.c
xorg-server/hw/xwin/winmonitors.c
xorg-server/hw/xwin/winmouse.c
xorg-server/hw/xwin/winmsg.c
xorg-server/hw/xwin/winmsg.h
xorg-server/hw/xwin/winmultiwindowclass.c
xorg-server/hw/xwin/winmultiwindowicons.c
xorg-server/hw/xwin/winmultiwindowshape.c
xorg-server/hw/xwin/winmultiwindowwindow.c
xorg-server/hw/xwin/winmultiwindowwm.c
xorg-server/hw/xwin/winmultiwindowwndproc.c
xorg-server/hw/xwin/winnativegdi.c
xorg-server/hw/xwin/winpfbdd.c
xorg-server/hw/xwin/winpixmap.c
xorg-server/hw/xwin/winpolyline.c
xorg-server/hw/xwin/winprefs.c
xorg-server/hw/xwin/winprocarg.c
xorg-server/hw/xwin/winregistry.c
xorg-server/hw/xwin/winscrinit.c
xorg-server/hw/xwin/winsetsp.c
xorg-server/hw/xwin/winshaddd.c
xorg-server/hw/xwin/winshadddnl.c
xorg-server/hw/xwin/winshadgdi.c
xorg-server/hw/xwin/wintrayicon.c
xorg-server/hw/xwin/winwin32rootless.c
xorg-server/hw/xwin/winwin32rootlesswindow.c
xorg-server/hw/xwin/winwin32rootlesswndproc.c
xorg-server/hw/xwin/winwindow.c
xorg-server/hw/xwin/winwindow.h
xorg-server/hw/xwin/winwindowswm.c
xorg-server/hw/xwin/winwndproc.c
xorg-server/include/callback.h
xorg-server/include/dixstruct.h
xorg-server/include/misc.h
xorg-server/include/os.h
xorg-server/include/scrnintstr.h
xorg-server/mi/micmap.c
xorg-server/mi/miinitext.c
xorg-server/mi/mioverlay.c
xorg-server/mi/misprite.c
xorg-server/mi/mivaltree.c
xorg-server/mi/miwindow.c
xorg-server/miext/damage/damage.c
xorg-server/miext/rootless/rootlessGC.c
xorg-server/miext/rootless/rootlessWindow.c
xorg-server/os/WaitFor.c
xorg-server/os/access.c
xorg-server/os/connection.c
xorg-server/os/io.c
xorg-server/os/log.c
xorg-server/os/osinit.c
xorg-server/os/utils.c
xorg-server/os/xdmcp.c
xorg-server/os/xprintf.c
xorg-server/os/xstrans.c
xorg-server/render/mipict.c
xorg-server/xkb/xkbActions.c
xorg-server/xkb/xkbInit.c
xorg-server/xkeyboard-config/compat/default.in
Diffstat (limited to 'xorg-server/glx/glxext.c')
-rw-r--r-- | xorg-server/glx/glxext.c | 369 |
1 files changed, 195 insertions, 174 deletions
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c index 88e109c88..8671ed026 100644 --- a/xorg-server/glx/glxext.c +++ b/xorg-server/glx/glxext.c @@ -70,6 +70,7 @@ RESTYPE __glXDrawableRes; xGLXSingleReply __glXReply; static DevPrivateKeyRec glxClientPrivateKeyRec; + #define glxClientPrivateKey (&glxClientPrivateKeyRec) /* @@ -80,7 +81,8 @@ static int __glXDispatch(ClientPtr); /* ** Called when the extension is reset. */ -static void ResetExtension(ExtensionEntry* extEntry) +static void +ResetExtension(ExtensionEntry * extEntry) { __glXFlushContextCache(); } @@ -88,7 +90,8 @@ static void ResetExtension(ExtensionEntry* extEntry) /* ** Reset state used to keep track of large (multi-request) commands. */ -void __glXResetLargeCommandStatus(__GLXclientState *cl) +void +__glXResetLargeCommandStatus(__GLXclientState * cl) { cl->largeCmdBytesSoFar = 0; cl->largeCmdBytesTotal = 0; @@ -102,11 +105,12 @@ void __glXResetLargeCommandStatus(__GLXclientState *cl) ** flag that the ID is no longer valid, and (maybe) free the context. ** use. */ -static int ContextGone(__GLXcontext* cx, XID id) +static int +ContextGone(__GLXcontext * cx, XID id) { cx->idExists = GL_FALSE; if (!cx->isCurrent) { - __glXFreeContext(cx); + __glXFreeContext(cx); } return True; @@ -121,7 +125,8 @@ static int glxBlockClients; ** Destroy routine that gets called when a drawable is freed. A drawable ** contains the ancillary buffers needed for rendering. */ -static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) +static Bool +DrawableGone(__GLXdrawable * glxPriv, XID xid) { __GLXcontext *c, *next; @@ -137,63 +142,67 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid) } for (c = glxAllContexts; c; c = next) { - next = c->next; - if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { - if (GET_DISPATCH()) FlushContext(c); /* Only flush if we still have a context */ - - (*c->loseCurrent)(c); - c->isCurrent = GL_FALSE; - if (c == __glXLastContext) - __glXFlushContextCache(); - } - if (c->drawPriv == glxPriv) - c->drawPriv = NULL; - if (c->readPriv == glxPriv) - c->readPriv = NULL; + next = c->next; + if (c->isCurrent && (c->drawPriv == glxPriv || c->readPriv == glxPriv)) { + if (GET_DISPATCH()) FlushContext(c); /* Only flush if we still have a context */ + + (*c->loseCurrent) (c); + c->isCurrent = GL_FALSE; + if (c == __glXLastContext) + __glXFlushContextCache(); + } + if (c->drawPriv == glxPriv) + c->drawPriv = NULL; + if (c->readPriv == glxPriv) + c->readPriv = NULL; } /* drop our reference to any backing pixmap */ if (glxPriv->type == GLX_DRAWABLE_PIXMAP) - glxPriv->pDraw->pScreen->DestroyPixmap((PixmapPtr)glxPriv->pDraw); + glxPriv->pDraw->pScreen->DestroyPixmap((PixmapPtr) glxPriv->pDraw); glxPriv->destroy(glxPriv); return True; } -void __glXAddToContextList(__GLXcontext *cx) +void +__glXAddToContextList(__GLXcontext * cx) { cx->next = glxAllContexts; glxAllContexts = cx; } -static void __glXRemoveFromContextList(__GLXcontext *cx) +static void +__glXRemoveFromContextList(__GLXcontext * cx) { __GLXcontext *c, *prev; if (cx == glxAllContexts) - glxAllContexts = cx->next; + glxAllContexts = cx->next; else { - prev = glxAllContexts; - for (c = glxAllContexts; c; c = c->next) { - if (c == cx) - prev->next = c->next; - prev = c; - } + prev = glxAllContexts; + for (c = glxAllContexts; c; c = c->next) { + if (c == cx) + prev->next = c->next; + prev = c; + } } } /* ** Free a context. */ -GLboolean __glXFreeContext(__GLXcontext *cx) +GLboolean +__glXFreeContext(__GLXcontext * cx) { - if (cx->idExists || cx->isCurrent) return GL_FALSE; - + if (cx->idExists || cx->isCurrent) + return GL_FALSE; + free(cx->feedbackBuf); free(cx->selectBuf); if (cx == __glXLastContext) { - __glXFlushContextCache(); + __glXFlushContextCache(); } __glXRemoveFromContextList(cx); @@ -203,12 +212,13 @@ GLboolean __glXFreeContext(__GLXcontext *cx) * the latter case we need to lift the DRI lock manually. */ if (!glxBlockClients) { - __glXleaveServer(GL_FALSE); - cx->destroy(cx); - __glXenterServer(GL_FALSE); - } else { - cx->next = glxPendingDestroyContexts; - glxPendingDestroyContexts = cx; + __glXleaveServer(GL_FALSE); + cx->destroy(cx); + __glXenterServer(GL_FALSE); + } + else { + cx->next = glxPendingDestroyContexts; + glxPendingDestroyContexts = cx; } return GL_TRUE; @@ -228,7 +238,8 @@ static GLboolean errorOccured = GL_FALSE; /* ** The GL was will call this routine if an error occurs. */ -void __glXErrorCallBack(GLenum code) +void +__glXErrorCallBack(GLenum code) { errorOccured = GL_TRUE; } @@ -236,7 +247,8 @@ void __glXErrorCallBack(GLenum code) /* ** Clear the error flag before calling the GL command. */ -void __glXClearErrorOccured(void) +void +__glXClearErrorOccured(void) { errorOccured = GL_FALSE; } @@ -244,7 +256,8 @@ void __glXClearErrorOccured(void) /* ** Check if the GL command caused an error. */ -GLboolean __glXErrorOccured(void) +GLboolean +__glXErrorOccured(void) { return errorOccured; } @@ -252,7 +265,8 @@ GLboolean __glXErrorOccured(void) static int __glXErrorBase; int __glXEventBase; -int __glXError(int error) +int +__glXError(int error) { return __glXErrorBase + error; } @@ -264,33 +278,31 @@ glxGetClient(ClientPtr pClient) } static void -glxClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) +glxClientCallback(CallbackListPtr *list, pointer closure, pointer data) { - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - __GLXclientState *cl = glxGetClient(pClient); + NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; + ClientPtr pClient = clientinfo->client; + __GLXclientState *cl = glxGetClient(pClient); switch (pClient->clientState) { case ClientStateRunning: - /* - ** By default, assume that the client supports - ** GLX major version 1 minor version 0 protocol. - */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; - cl->client = pClient; - break; + /* + ** By default, assume that the client supports + ** GLX major version 1 minor version 0 protocol. + */ + cl->GLClientmajorVersion = 1; + cl->GLClientminorVersion = 0; + cl->client = pClient; + break; case ClientStateGone: - free(cl->returnBuf); - free(cl->largeCmdBuf); - free(cl->GLClientextensions); - break; + free(cl->returnBuf); + free(cl->largeCmdBuf); + free(cl->GLClientextensions); + break; default: - break; + break; } } @@ -298,7 +310,8 @@ glxClientCallback (CallbackListPtr *list, static __GLXprovider *__glXProviderStack; -void GlxPushProvider(__GLXprovider *provider) +void +GlxPushProvider(__GLXprovider * provider) { provider->next = __glXProviderStack; __glXProviderStack = provider; @@ -307,7 +320,8 @@ void GlxPushProvider(__GLXprovider *provider) /* ** Initialize the GLX extension. */ -void GlxExtensionInit(void) +void +GlxExtensionInit(void) { ExtensionEntry *extEntry; ScreenPtr pScreen; @@ -315,61 +329,61 @@ void GlxExtensionInit(void) __GLXprovider *p; Bool glx_provided = False; - __glXContextRes = CreateNewResourceType((DeleteType)ContextGone, - "GLXContext"); - __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone, - "GLXDrawable"); + __glXContextRes = CreateNewResourceType((DeleteType) ContextGone, + "GLXContext"); + __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone, + "GLXDrawable"); if (!__glXContextRes || !__glXDrawableRes) - return; + return; - if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState))) - return; - if (!AddCallback (&ClientStateCallback, glxClientCallback, 0)) - return; + if (!dixRegisterPrivateKey + (&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState))) + return; + if (!AddCallback(&ClientStateCallback, glxClientCallback, 0)) + return; for (i = 0; i < screenInfo.numScreens; i++) { - pScreen = screenInfo.screens[i]; - - for (p = __glXProviderStack; p != NULL; p = p->next) { - __GLXscreen *glxScreen; - - glxScreen = p->screenProbe(pScreen); - if (glxScreen != NULL) { - if (glxScreen->GLXminor < glxMinorVersion) - glxMinorVersion = glxScreen->GLXminor; - LogMessage(X_INFO, - "GLX: Initialized %s GL provider for screen %d\n", - p->name, i); - break; - } - - } - - if (!p) - LogMessage(X_INFO, - "GLX: no usable GL providers found for screen %d\n", i); - else - glx_provided = True; + pScreen = screenInfo.screens[i]; + + for (p = __glXProviderStack; p != NULL; p = p->next) { + __GLXscreen *glxScreen; + + glxScreen = p->screenProbe(pScreen); + if (glxScreen != NULL) { + if (glxScreen->GLXminor < glxMinorVersion) + glxMinorVersion = glxScreen->GLXminor; + LogMessage(X_INFO, + "GLX: Initialized %s GL provider for screen %d\n", + p->name, i); + break; + } + + } + + if (!p) + LogMessage(X_INFO, + "GLX: no usable GL providers found for screen %d\n", i); + else + glx_provided = True; } /* don't register extension if GL is not provided on any screen */ if (!glx_provided) - return; + return; /* - ** Add extension to server extensions. - */ + ** Add extension to server extensions. + */ extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS, - __GLX_NUMBER_ERRORS, __glXDispatch, - __glXDispatch, ResetExtension, - StandardMinorOpcode); + __GLX_NUMBER_ERRORS, __glXDispatch, + __glXDispatch, ResetExtension, StandardMinorOpcode); if (!extEntry) { - FatalError("__glXExtensionInit: AddExtensions failed\n"); - return; + FatalError("__glXExtensionInit: AddExtensions failed\n"); + return; } if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) { - ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); - return; + ErrorF("__glXExtensionInit: AddExtensionAlias failed\n"); + return; } __glXErrorBase = extEntry->errorBase; @@ -378,7 +392,8 @@ void GlxExtensionInit(void) /************************************************************************/ -void __glXFlushContextCache(void) +void +__glXFlushContextCache(void) { __glXLastContext = 0; } @@ -389,50 +404,50 @@ void __glXFlushContextCache(void) ** switching it between different contexts). While we are at it, look up ** a context by its tag and return its (__GLXcontext *). */ -__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, - int *error) +__GLXcontext * +__glXForceCurrent(__GLXclientState * cl, GLXContextTag tag, int *error) { __GLXcontext *cx; /* - ** See if the context tag is legal; it is managed by the extension, - ** so if it's invalid, we have an implementation error. - */ + ** See if the context tag is legal; it is managed by the extension, + ** so if it's invalid, we have an implementation error. + */ cx = __glXLookupContextByTag(cl, tag); if (!cx) { - cl->client->errorValue = tag; - *error = __glXError(GLXBadContextTag); - return 0; + cl->client->errorValue = tag; + *error = __glXError(GLXBadContextTag); + return 0; } if (!cx->isDirect) { - if (cx->drawPriv == NULL) { - /* - ** The drawable has vanished. It must be a window, because only - ** windows can be destroyed from under us; GLX pixmaps are - ** refcounted and don't go away until no one is using them. - */ - *error = __glXError(GLXBadCurrentWindow); - return 0; - } + if (cx->drawPriv == NULL) { + /* + ** The drawable has vanished. It must be a window, because only + ** windows can be destroyed from under us; GLX pixmaps are + ** refcounted and don't go away until no one is using them. + */ + *error = __glXError(GLXBadCurrentWindow); + return 0; + } } - - if (cx->wait && (*cx->wait)(cx, cl, error)) - return NULL; + + if (cx->wait && (*cx->wait) (cx, cl, error)) + return NULL; if (cx == __glXLastContext && GET_DISPATCH()) { - /* No need to re-bind */ - return cx; + /* No need to re-bind */ + return cx; } /* Make this context the current one for the GL. */ if (!cx->isDirect) { - if (!(*cx->makeCurrent)(cx)) { - /* Bind failed, and set the error code. Bummer */ - cl->client->errorValue = cx->id; - *error = __glXError(GLXBadContextState); - return 0; - } + if (!(*cx->makeCurrent) (cx)) { + /* Bind failed, and set the error code. Bummer */ + cl->client->errorValue = cx->id; + *error = __glXError(GLXBadContextState); + return 0; + } } __glXLastContext = cx; return cx; @@ -440,19 +455,21 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag, /************************************************************************/ -void glxSuspendClients(void) +void +glxSuspendClients(void) { int i; for (i = 1; i < currentMaxClients; i++) { - if (clients[i] && glxGetClient(clients[i])->inUse) - IgnoreClient(clients[i]); + if (clients[i] && glxGetClient(clients[i])->inUse) + IgnoreClient(clients[i]); } glxBlockClients = TRUE; } -void glxResumeClients(void) +void +glxResumeClients(void) { __GLXcontext *cx, *next; int i; @@ -460,15 +477,15 @@ void glxResumeClients(void) glxBlockClients = FALSE; for (i = 1; i < currentMaxClients; i++) { - if (clients[i] && glxGetClient(clients[i])->inUse) - AttendClient(clients[i]); + if (clients[i] && glxGetClient(clients[i])->inUse) + AttendClient(clients[i]); } __glXleaveServer(GL_FALSE); for (cx = glxPendingDestroyContexts; cx != NULL; cx = next) { - next = cx->next; + next = cx->next; - cx->destroy(cx); + cx->destroy(cx); } glxPendingDestroyContexts = NULL; __glXenterServer(GL_FALSE); @@ -478,43 +495,46 @@ static void __glXnopEnterServer(GLboolean rendering) { } - + static void __glXnopLeaveServer(GLboolean rendering) { } -static void (*__glXenterServerFunc)(GLboolean) = __glXnopEnterServer; -static void (*__glXleaveServerFunc)(GLboolean) = __glXnopLeaveServer; +static void (*__glXenterServerFunc) (GLboolean) = __glXnopEnterServer; +static void (*__glXleaveServerFunc) (GLboolean) = __glXnopLeaveServer; -void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean), - void (*leave)(GLboolean)) +void +__glXsetEnterLeaveServerFuncs(void (*enter) (GLboolean), + void (*leave) (GLboolean)) { - __glXenterServerFunc = enter; - __glXleaveServerFunc = leave; + __glXenterServerFunc = enter; + __glXleaveServerFunc = leave; } - -void __glXenterServer(GLboolean rendering) +void +__glXenterServer(GLboolean rendering) { - glxServerLeaveCount--; + glxServerLeaveCount--; - if (glxServerLeaveCount == 0) - (*__glXenterServerFunc)(rendering); + if (glxServerLeaveCount == 0) + (*__glXenterServerFunc) (rendering); } -void __glXleaveServer(GLboolean rendering) +void +__glXleaveServer(GLboolean rendering) { - if (glxServerLeaveCount == 0) - (*__glXleaveServerFunc)(rendering); + if (glxServerLeaveCount == 0) + (*__glXleaveServerFunc) (rendering); - glxServerLeaveCount++; + glxServerLeaveCount++; } /* ** Top level dispatcher; all commands are executed from here down. */ -static int __glXDispatch(ClientPtr client) +static int +__glXDispatch(ClientPtr client) { REQUEST(xGLXSingleReq); CARD8 opcode; @@ -528,37 +548,38 @@ static int __glXDispatch(ClientPtr client) cl->inUse = TRUE; /* - ** If we're expecting a glXRenderLarge request, this better be one. - */ + ** If we're expecting a glXRenderLarge request, this better be one. + */ if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) { - client->errorValue = stuff->glxCode; - return __glXError(GLXBadLargeRequest); + client->errorValue = stuff->glxCode; + return __glXError(GLXBadLargeRequest); } /* If we're currently blocking GLX clients, just put this guy to * sleep, reset the request and return. */ if (glxBlockClients) { - ResetCurrentRequest(client); - client->sequence--; - IgnoreClient(client); - return Success; + ResetCurrentRequest(client); + client->sequence--; + IgnoreClient(client); + return Success; } /* - ** Use the opcode to index into the procedure table. - */ - proc = __glXGetProtocolDecodeFunction(& Single_dispatch_info, opcode, + ** Use the opcode to index into the procedure table. + */ + proc = __glXGetProtocolDecodeFunction(&Single_dispatch_info, opcode, client->swapped); if (proc != NULL) { - GLboolean rendering = opcode <= X_GLXRenderLarge; - __glXleaveServer(rendering); + GLboolean rendering = opcode <= X_GLXRenderLarge; + + __glXleaveServer(rendering); - retval = (*proc)(cl, (GLbyte *) stuff); + retval = (*proc) (cl, (GLbyte *) stuff); - __glXenterServer(rendering); + __glXenterServer(rendering); } else { - retval = BadRequest; + retval = BadRequest; } return retval; |