DRI2: add support for new DRI2 protocol requests
Support the new DRI2 2.2 protocol requests: DRI2SwapBuffers, DRI2GetMSC, DRI2WaitMSC, DRI2WaitSBC and DRI2SwapInterval. These requests allow the server to support the SGI_video_sync, SGI_swap_interval, and OML_sync_control GLX extensions if DDX support is present. The new DDX APIs are documented in dri2.h. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Adam Jackson <ajax@nwnk.net> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
@@ -53,8 +53,6 @@ int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap)
|
||||
|
||||
cx = __glXLookupContextByTag(cl, tag);
|
||||
|
||||
LogMessage(X_ERROR, "%s: cx = %p, GLX screen = %p\n", __func__,
|
||||
cx, (cx == NULL) ? NULL : cx->pGlxScreen);
|
||||
if ((cx == NULL) || (cx->pGlxScreen == NULL)) {
|
||||
client->errorValue = tag;
|
||||
return __glXError(GLXBadContext);
|
||||
@@ -68,7 +66,7 @@ int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap)
|
||||
|
||||
if (cx->drawPriv == NULL) {
|
||||
client->errorValue = tag;
|
||||
return __glXError(GLXBadDrawable);
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
pc += __GLX_VENDPRIV_HDR_SIZE;
|
||||
@@ -76,6 +74,9 @@ int DoSwapInterval(__GLXclientState *cl, GLbyte *pc, int do_swap)
|
||||
? bswap_32(*(int *)(pc + 0))
|
||||
: *(int *)(pc + 0);
|
||||
|
||||
if (interval <= 0)
|
||||
return BadValue;
|
||||
|
||||
(void) (*cx->pGlxScreen->swapInterval)(cx->drawPriv, interval);
|
||||
return Success;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user