diff options
author | Alan Hourihane <alanh@vmware.com> | 2009-02-16 11:39:34 +0000 |
---|---|---|
committer | Alan Hourihane <alanh@vmware.com> | 2009-02-16 11:45:55 +0000 |
commit | 2a8b8077d8f6001eb57deba60e1009fc99c28668 (patch) | |
tree | e6c9c9360a5762b65719e7d7151e09ce755999e6 /glx/glxcmds.c | |
parent | ddb8d8945d1f44d16adc366b6612eef20ae813f7 (diff) |
dri2: support glXWaitGL & glXWaitX by copying fake front to front and
vice-versa.
Diffstat (limited to 'glx/glxcmds.c')
-rw-r--r-- | glx/glxcmds.c | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 33954ee64..8b6dfbc84 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -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; } |