dri2: support glXWaitGL & glXWaitX by copying fake front to front and

vice-versa.
This commit is contained in:
Alan Hourihane 2009-02-16 11:39:34 +00:00
commit 2a8b8077d8
4 changed files with 67 additions and 11 deletions

View file

@ -760,29 +760,46 @@ int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc)
int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc;
GLXContextTag tag = req->contextTag;
__GLXcontext *glxc = NULL;
int error;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
if (!glxc)
return __glXError(GLXBadContextTag);
if (!__glXForceCurrent(cl, req->contextTag, &error)) {
return error;
if (!__glXForceCurrent(cl, req->contextTag, &error))
return error;
CALL_Finish( GET_DISPATCH(), () );
}
CALL_Finish( GET_DISPATCH(), () );
if (glxc && glxc->drawPriv->waitGL)
(*glxc->drawPriv->waitGL)(glxc->drawPriv);
return Success;
}
int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc)
{
xGLXWaitXReq *req = (xGLXWaitXReq *)pc;
GLXContextTag tag = req->contextTag;
__GLXcontext *glxc = NULL;
int error;
if (tag) {
glxc = __glXLookupContextByTag(cl, tag);
if (!glxc)
return __glXError(GLXBadContextTag);
if (!__glXForceCurrent(cl, req->contextTag, &error)) {
return error;
if (!__glXForceCurrent(cl, req->contextTag, &error))
return error;
}
/*
** In a multithreaded server that had separate X and GL threads, we would
** have to wait for the X thread to finish before returning. As it stands,
** this sample implementation only supports singlethreaded servers, and
** nothing needs to be done here.
*/
if (glxc && glxc->drawPriv->waitGL)
(*glxc->drawPriv->waitGL)(glxc->drawPriv);
return Success;
}