mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-04 22:36:10 +00:00
dri2: support glXWaitGL & glXWaitX by copying fake front to front and
vice-versa.
This commit is contained in:
parent
ddb8d8945d
commit
2a8b8077d8
4 changed files with 67 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue