Commit d8ec33fe authored by Adam Jackson's avatar Adam Jackson 🎧

glx: Use vnd layer for dispatch (v4)

The big change here is MakeCurrent and context tag tracking. We now
delegate context tags entirely to the vnd layer, and simply store a
pointer to the context state as the tag data. If a context is deleted
while it's current, we allocate a fake ID for the context and move the
context state there, so the tag data still points to a real context. As
a result we can stop trying so hard to detach the client from contexts
at disconnect time and just let resource destruction handle it.

Since vnd handles all the MakeCurrent protocol now, our request handlers
for it can just be return BadImplementation. We also remove a bunch of
LEGAL_NEW_RESOURCE, because now by the time we're called vnd has already
allocated its tracking resource on that XID.

v2: Update to match v2 of the vnd import, and remove more redundant work
like request length checks.

v3: Add/remove the XID map from the vendor private thunk, not the
backend. (Kyle Brenneman)

v4: Fix deletion of ghost contexts (Kyle Brenneman)
Signed-off-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 8753218b
......@@ -1295,7 +1295,7 @@ if test "x$GLX" = xyes; then
PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL)
AC_SUBST(XLIB_CFLAGS)
AC_DEFINE(GLXEXT, 1, [Build GLX extension])
GLX_LIBS='$(top_builddir)/glx/libglx.la'
GLX_LIBS='$(top_builddir)/glx/libglx.la $(top_builddir)/glx/libglxvnd.la'
GLX_SYS_LIBS="$GLX_SYS_LIBS $GL_LIBS"
else
GLX=no
......
......@@ -123,8 +123,6 @@ __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc)
if (req->length != expected_size)
return BadLength;
LEGAL_NEW_RESOURCE(req->context, client);
/* The GLX_ARB_create_context spec says:
*
* "* If <config> is not a valid GLXFBConfig, GLXBadFBConfig is
......
......@@ -47,6 +47,7 @@
#include "indirect_table.h"
#include "indirect_util.h"
#include "protocol-versions.h"
#include "glxvndabi.h"
static char GLXServerVendorName[] = "SGI";
......@@ -135,6 +136,10 @@ _X_HIDDEN int
validGlxContext(ClientPtr client, XID id, int access_mode,
__GLXcontext ** context, int *err)
{
/* no ghost contexts */
if (id & SERVER_BIT)
return FALSE;
*err = dixLookupResourceByType((void **) context, id,
__glXContextRes, client, access_mode);
if (*err != Success || (*context)->idExists == GL_FALSE) {
......@@ -240,8 +245,6 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
__GLXcontext *glxc, *shareglxc;
int err;
LEGAL_NEW_RESOURCE(gcId, client);
/*
** Find the display list space that we want to share.
**
......@@ -356,14 +359,11 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
int
__glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateContextReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
......@@ -376,14 +376,11 @@ __glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc)
int
__glXDisp_CreateNewContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
......@@ -417,62 +414,33 @@ __glXDisp_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
int
__glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLXcontext *glxc;
int err;
REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
if (!validGlxContext(cl->client, req->context, DixDestroyAccess,
&glxc, &err))
return err;
glxc->idExists = GL_FALSE;
if (!glxc->currentClient)
FreeResourceByType(req->context, __glXContextRes, FALSE);
if (glxc->currentClient) {
XID ghost = FakeClientID(glxc->currentClient->index);
if (!AddResource(ghost, __glXContextRes, glxc))
return BadAlloc;
ChangeResourceValue(glxc->id, __glXContextRes, NULL);
glxc->id = ghost;
}
FreeResourceByType(req->context, __glXContextRes, FALSE);
return Success;
}
/*
* This will return "deleted" contexts, ie, where idExists is GL_FALSE.
* Contrast validGlxContext, which will not. We're cheating here and
* using the XID as the context tag, which is fine as long as we defer
* actually destroying the context until it's no longer referenced, and
* block clients from trying to MakeCurrent on contexts that are on the
* way to destruction. Notice that DoMakeCurrent calls validGlxContext
* for new contexts but __glXLookupContextByTag for previous contexts.
*/
__GLXcontext *
__glXLookupContextByTag(__GLXclientState * cl, GLXContextTag tag)
{
__GLXcontext *ret;
if (dixLookupResourceByType((void **) &ret, tag, __glXContextRes,
cl->client, DixUseAccess) == Success)
return ret;
return NULL;
}
/*****************************************************************************/
static void
StopUsingContext(__GLXcontext * glxc)
{
if (glxc) {
glxc->currentClient = NULL;
if (!glxc->idExists) {
FreeResourceByType(glxc->id, __glXContextRes, FALSE);
}
}
}
static void
StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc)
{
glxc->currentClient = cl->client;
return glxServer.getContextTagPrivate(cl->client, tag);
}
static __GLXconfig *
......@@ -583,14 +551,12 @@ __glXGetDrawable(__GLXcontext * glxc, GLXDrawable drawId, ClientPtr client,
** Make an OpenGL context and drawable current.
*/
static int
DoMakeCurrent(__GLXclientState * cl,
GLXDrawable drawId, GLXDrawable readId,
GLXContextID contextId, GLXContextTag tag)
int
xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId,
XID contextId, GLXContextTag newContextTag)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReply reply;
__GLXcontext *glxc, *prevglxc;
__GLXclientState *cl = glxGetClient(client);
__GLXcontext *glxc = NULL, *prevglxc = NULL;
__GLXdrawable *drawPriv = NULL;
__GLXdrawable *readPriv = NULL;
int error;
......@@ -603,39 +569,28 @@ DoMakeCurrent(__GLXclientState * cl,
if ((drawId == None) != (readId == None))
return BadMatch;
/*
** Lookup old context. If we have one, it must be in a usable state.
*/
/* Look up old context. If we have one, it must be in a usable state. */
if (tag != 0) {
prevglxc = __glXLookupContextByTag(cl, tag);
if (!prevglxc) {
/*
** Tag for previous context is invalid.
*/
prevglxc = glxServer.getContextTagPrivate(client, tag);
if (!prevglxc)
return __glXError(GLXBadContextTag);
}
if (prevglxc->renderMode != GL_RENDER) {
/* Oops. Not in render mode render. */
client->errorValue = prevglxc->id;
return __glXError(GLXBadContextState);
}
}
else {
prevglxc = 0;
}
/*
** Lookup new context. It must not be current for someone else.
*/
/* Look up new context. It must not be current for someone else. */
if (contextId != None) {
int status;
if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error))
return error;
if ((glxc != prevglxc) && glxc->currentClient) {
/* Context is current to somebody else */
if ((glxc != prevglxc) && glxc->currentClient)
return BadAccess;
}
if (drawId) {
drawPriv = __glXGetDrawable(glxc, drawId, client, &status);
......@@ -648,38 +603,25 @@ DoMakeCurrent(__GLXclientState * cl,
if (readPriv == NULL)
return status;
}
} else {
/* Switching to no context. Ignore new drawable. */
glxc = 0;
drawPriv = 0;
readPriv = 0;
}
if (prevglxc) {
/*
** Flush the previous context if needed.
*/
/* Flush the previous context if needed. */
Bool need_flush = !prevglxc->isDirect;
#ifdef GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
if (prevglxc->releaseBehavior == GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB)
need_flush = GL_FALSE;
#endif
if (need_flush) {
if (__glXForceCurrent(cl, tag, (int *) &error)) {
glFlush();
}
else {
if (!__glXForceCurrent(cl, tag, (int *) &error))
return error;
}
glFlush();
}
/*
** Make the previous context not current.
*/
if (!(*prevglxc->loseCurrent) (prevglxc)) {
/* Make the previous context not current. */
if (!(*prevglxc->loseCurrent) (prevglxc))
return __glXError(GLXBadContext);
}
lastGLContext = NULL;
if (!prevglxc->isDirect) {
prevglxc->drawPriv = NULL;
......@@ -687,8 +629,7 @@ DoMakeCurrent(__GLXclientState * cl,
}
}
if ((glxc != 0) && !glxc->isDirect) {
if (glxc && !glxc->isDirect) {
glxc->drawPriv = drawPriv;
glxc->readPriv = readPriv;
......@@ -702,66 +643,35 @@ DoMakeCurrent(__GLXclientState * cl,
}
glxc->currentClient = client;
glxServer.setContextTagPrivate(client, newContextTag, glxc);
}
StopUsingContext(prevglxc);
reply = (xGLXMakeCurrentReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
.contextTag = 0
};
if (glxc) {
StartUsingContext(cl, glxc);
reply.contextTag = glxc->id;
if (prevglxc) {
prevglxc->currentClient = NULL;
if (!prevglxc->idExists) {
FreeResourceByType(prevglxc->id, __glXContextRes, FALSE);
}
}
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.contextTag);
}
WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
return Success;
}
int
__glXDisp_MakeCurrent(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
return DoMakeCurrent(cl, req->drawable, req->drawable,
req->context, req->oldContextTag);
return BadImplementation;
}
int
__glXDisp_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
return DoMakeCurrent(cl, req->drawable, req->readdrawable,
req->context, req->oldContextTag);
return BadImplementation;
}
int
__glXDisp_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
return DoMakeCurrent(cl, req->drawable, req->readable,
req->context, req->oldContextTag);
return BadImplementation;
}
int
......@@ -773,8 +683,6 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc)
__GLXcontext *glxc;
int err;
REQUEST_SIZE_MATCH(xGLXIsDirectReq);
if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
return err;
......@@ -838,14 +746,11 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
int
__glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
GLXContextTag tag;
__GLXcontext *glxc = NULL;
int error;
REQUEST_SIZE_MATCH(xGLXWaitGLReq);
tag = req->contextTag;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
......@@ -867,14 +772,11 @@ __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
int
__glXDisp_WaitX(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
GLXContextTag tag;
__GLXcontext *glxc = NULL;
int error;
REQUEST_SIZE_MATCH(xGLXWaitXReq);
tag = req->contextTag;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
......@@ -903,8 +805,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
__GLXcontext *src, *dst;
int error;
REQUEST_SIZE_MATCH(xGLXCopyContextReq);
source = req->source;
dest = req->dest;
tag = req->contextTag;
......@@ -992,8 +892,6 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
......@@ -1213,10 +1111,8 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
int
__glXDisp_GetFBConfigs(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
return DoGetFBConfigs(cl, req->screen);
}
......@@ -1287,8 +1183,6 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen * pGlxScreen,
DrawablePtr pDraw;
int err;
LEGAL_NEW_RESOURCE(glxDrawableId, client);
err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess);
if (err != Success) {
client->errorValue = drawableId;
......@@ -1354,14 +1248,11 @@ determineTextureTarget(ClientPtr client, XID glxDrawableID,
int
__glXDisp_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLXconfig *config;
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
......@@ -1442,11 +1333,8 @@ DoDestroyDrawable(__GLXclientState * cl, XID glxdrawable, int type)
int
__glXDisp_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
}
......@@ -1472,8 +1360,6 @@ DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId,
PixmapPtr pPixmap;
int err;
LEGAL_NEW_RESOURCE(glxDrawableId, client);
if (!validGlxScreen(client, screenNum, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err))
......@@ -1658,8 +1544,6 @@ __glXDisp_CreateWindow(__GLXclientState * cl, GLbyte * pc)
}
REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3);
LEGAL_NEW_RESOURCE(req->glxwindow, client);
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err))
......@@ -1709,8 +1593,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
__GLXdrawable *pGlxDraw;
int error;
REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
tag = req->contextTag;
drawId = req->drawable;
if (tag) {
......@@ -1813,11 +1695,8 @@ __glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
int
__glXDisp_QueryContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
REQUEST_SIZE_MATCH(xGLXQueryContextReq);
return DoQueryContext(cl, req->context);
}
......@@ -2453,8 +2332,6 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
char *buf;
int err;
REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
......@@ -2508,8 +2385,6 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
__GLXscreen *pGlxScreen;
int err;
REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
return err;
......
......@@ -56,13 +56,10 @@
int
__glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->visual);
......@@ -75,13 +72,10 @@ __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_CreateNewContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->fbconfig);
......@@ -115,13 +109,10 @@ __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
......@@ -131,69 +122,28 @@ __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_MakeCurrent(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXDisp_MakeCurrent(cl, pc);
return BadImplementation;
}
int
__glXDispSwap_MakeContextCurrent(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readdrawable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXDisp_MakeContextCurrent(cl, pc);
return BadImplementation;
}
int
__glXDispSwap_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->drawable);
__GLX_SWAP_INT(&req->readable);
__GLX_SWAP_INT(&req->context);
__GLX_SWAP_INT(&req->oldContextTag);
return __glXDisp_MakeCurrentReadSGI(cl, pc);
return BadImplementation;
}
int
__glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXIsDirectReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->context);
......@@ -203,13 +153,10 @@ __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->majorVersion);
__GLX_SWAP_INT(&req->minorVersion);
......@@ -220,13 +167,10 @@ __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXWaitGLReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
......@@ -236,13 +180,10 @@ __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXWaitXReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->contextTag);
......@@ -252,13 +193,10 @@ __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXCopyContextReq);
__GLX_SWAP_SHORT(&req->length);
__GLX_SWAP_INT(&req->source);
__GLX_SWAP_INT(&req->dest);
......@@ -270,13 +208,10 @@ __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
__GLX_SWAP_INT(&req->screen);
return __glXDisp_GetVisualConfigs(cl, pc);
}
......@@ -284,13 +219,10 @@ __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_GetFBConfigs(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;
REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
__GLX_SWAP_INT(&req->screen);
return __glXDisp_GetFBConfigs(cl, pc);
}
......@@ -312,13 +244,10 @@ __glXDispSwap_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc)
int
__glXDispSwap_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
{
ClientPtr client = cl->client;
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
__GLX_DECLARE_SWAP_VARIABLES;