mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-02-16 17:50:39 +01:00
Block AIGLX clients if they draw before swap is complete
This commit is contained in:
parent
d8342156dd
commit
f2cdca03e3
4 changed files with 28 additions and 10 deletions
|
|
@ -55,6 +55,10 @@ struct __GLXcontext {
|
|||
unsigned long mask);
|
||||
int (*forceCurrent) (__GLXcontext *context);
|
||||
|
||||
Bool (*wait) (__GLXcontext *context,
|
||||
__GLXclientState *cl,
|
||||
int *error);
|
||||
|
||||
__GLXtextureFromPixmap *textureFromPixmap;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -245,6 +245,18 @@ __glXDRIcontextForceCurrent(__GLXcontext *baseContext)
|
|||
read->driDrawable);
|
||||
}
|
||||
|
||||
static Bool
|
||||
__glXDRIcontextWait(__GLXcontext *baseContext,
|
||||
__GLXclientState *cl, int *error)
|
||||
{
|
||||
if (DRI2WaitSwap(cl->client, baseContext->drawPriv->pDraw)) {
|
||||
*error = cl->client->noClientException;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef __DRI_TEX_BUFFER
|
||||
|
||||
static int
|
||||
|
|
@ -350,6 +362,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen,
|
|||
context->base.copy = __glXDRIcontextCopy;
|
||||
context->base.forceCurrent = __glXDRIcontextForceCurrent;
|
||||
context->base.textureFromPixmap = &__glXDRItextureFromPixmap;
|
||||
context->base.wait = __glXDRIcontextWait;
|
||||
|
||||
context->driContext =
|
||||
(*screen->dri2->createNewContext)(screen->driScreen,
|
||||
|
|
|
|||
|
|
@ -445,6 +445,9 @@ __GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
|
|||
}
|
||||
}
|
||||
|
||||
if (cx->wait && (*cx->wait)(cx, cl, error))
|
||||
return NULL;
|
||||
|
||||
if (cx == __glXLastContext) {
|
||||
/* No need to re-bind */
|
||||
return cx;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,14 @@
|
|||
#include <GL/gl.h>
|
||||
#include <GL/glxproto.h>
|
||||
|
||||
/* For glxscreens.h */
|
||||
/*
|
||||
** GLX resources.
|
||||
*/
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
|
||||
typedef struct __GLXclientStateRec __GLXclientState;
|
||||
typedef struct __GLXdrawable __GLXdrawable;
|
||||
typedef struct __GLXcontext __GLXcontext;
|
||||
|
||||
|
|
@ -71,15 +78,6 @@ typedef struct __GLXcontext __GLXcontext;
|
|||
#define False 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** GLX resources.
|
||||
*/
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
|
||||
typedef struct __GLXclientStateRec __GLXclientState;
|
||||
|
||||
extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
|
||||
extern __GLXclientState *glxGetClient(ClientPtr pClient);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue