aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx/glxcmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx/glxcmds.c')
-rw-r--r--xorg-server/glx/glxcmds.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index 73e76ca9f..64ebf9ecd 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -42,10 +42,6 @@
#include <windowstr.h>
#include "glxutil.h"
#include "glxext.h"
-#include "glapitable.h"
-#include "glapi.h"
-#include "glthread.h"
-#include "dispatch.h"
#include "indirect_dispatch.h"
#include "indirect_table.h"
#include "indirect_util.h"
@@ -299,7 +295,7 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
glxc->id = gcId;
glxc->share_id = shareList;
glxc->idExists = GL_TRUE;
- glxc->isCurrent = GL_FALSE;
+ glxc->currentClient = NULL;
glxc->isDirect = isDirect;
glxc->hasUnflushedCommands = GL_FALSE;
glxc->renderMode = GL_RENDER;
@@ -406,9 +402,7 @@ __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc)
&glxc, &err))
return err;
- glxc->idExists = GL_FALSE;
- if (!glxc->isCurrent)
- FreeResourceByType(req->context, __glXContextRes, FALSE);
+ FreeResourceByType(req->context, __glXContextRes, FALSE);
return Success;
}
@@ -444,7 +438,7 @@ StopUsingContext(__GLXcontext * glxc)
/* Tell server GL library */
__glXLastContext = 0;
}
- glxc->isCurrent = GL_FALSE;
+ glxc->currentClient = NULL;
if (!glxc->idExists) {
FreeResourceByType(glxc->id, __glXContextRes, FALSE);
}
@@ -454,8 +448,8 @@ StopUsingContext(__GLXcontext * glxc)
static void
StartUsingContext(__GLXclientState * cl, __GLXcontext * glxc)
{
- glxc->isCurrent = GL_TRUE;
__glXLastContext = glxc;
+ glxc->currentClient = cl->client;
}
/**
@@ -589,7 +583,7 @@ DoMakeCurrent(__GLXclientState * cl,
if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error))
return error;
- if ((glxc != prevglxc) && glxc->isCurrent) {
+ if ((glxc != prevglxc) && glxc->currentClient) {
/* Context is current to somebody else */
return BadAccess;
}
@@ -619,7 +613,7 @@ DoMakeCurrent(__GLXclientState * cl,
*/
if (prevglxc->hasUnflushedCommands) {
if (__glXForceCurrent(cl, tag, (int *) &error)) {
- CALL_Flush(GET_DISPATCH(), ());
+ glFlush();
prevglxc->hasUnflushedCommands = GL_FALSE;
}
else {
@@ -652,7 +646,7 @@ DoMakeCurrent(__GLXclientState * cl,
return __glXError(GLXBadContext);
}
- glxc->isCurrent = GL_TRUE;
+ glxc->currentClient = client;
}
StopUsingContext(prevglxc);
@@ -802,7 +796,7 @@ __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
if (!__glXForceCurrent(cl, req->contextTag, &error))
return error;
- CALL_Finish(GET_DISPATCH(), ());
+ glFinish();
}
if (glxc && glxc->drawPriv->waitGL)
@@ -873,7 +867,7 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
/*
** The destination context must not be current for any client.
*/
- if (dst->isCurrent) {
+ if (dst->currentClient) {
client->errorValue = dest;
return BadAccess;
}
@@ -900,7 +894,7 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
** Do whatever is needed to make sure that all preceding requests
** in both streams are completed before the copy is executed.
*/
- CALL_Finish(GET_DISPATCH(), ());
+ glFinish();
tagcx->hasUnflushedCommands = GL_FALSE;
}
else {
@@ -1249,7 +1243,8 @@ DoCreateGLXPixmap(ClientPtr client, __GLXscreen * pGlxScreen,
err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId,
glxDrawableId, GLX_DRAWABLE_PIXMAP);
- ((PixmapPtr) pDraw)->refcnt++;
+ if (err == Success)
+ ((PixmapPtr) pDraw)->refcnt++;
return err;
}
@@ -1676,7 +1671,7 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
** Do whatever is needed to make sure that all preceding requests
** in both streams are completed before the swap is executed.
*/
- CALL_Finish(GET_DISPATCH(), ());
+ glFinish();
glxc->hasUnflushedCommands = GL_FALSE;
}
else {
@@ -1873,7 +1868,7 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
** Do whatever is needed to make sure that all preceding requests
** in both streams are completed before the swap is executed.
*/
- CALL_Finish(GET_DISPATCH(), ());
+ glFinish();
glxc->hasUnflushedCommands = GL_FALSE;
}
else {