summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-09-25 12:05:28 -0700
committerEric Anholt <eric@anholt.net>2012-10-09 14:32:03 -0700
commitab8ae9301fe8c4843d902cb55e64620f5768c7b0 (patch)
treeaa305ce26caa0fb64b03d394dbce93f43953a799 /src/glx/dri2_glx.c
parent8e61b9028ad4f68c9d68fd781b6f44e1f6a266bd (diff)
glx: Replace DRI2GetMSC custom protocol with XCB.
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 60dc0354ca5..18542d18201 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -432,26 +432,24 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable,
return &pdraw->base;
}
-#ifdef X_DRI2GetMSC
-
static int
dri2DrawableGetMSC(struct glx_screen *psc, __GLXDRIdrawable *pdraw,
int64_t *ust, int64_t *msc, int64_t *sbc)
{
- CARD64 dri2_ust, dri2_msc, dri2_sbc;
- int ret;
+ xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
+ xcb_dri2_get_msc_cookie_t get_msc_cookie;
+ xcb_dri2_get_msc_reply_t *get_msc_reply;
- ret = DRI2GetMSC(psc->dpy, pdraw->xDrawable,
- &dri2_ust, &dri2_msc, &dri2_sbc);
- *ust = dri2_ust;
- *msc = dri2_msc;
- *sbc = dri2_sbc;
+ get_msc_cookie = xcb_dri2_get_msc_unchecked(c, pdraw->xDrawable);
+ get_msc_reply = xcb_dri2_get_msc_reply(c, get_msc_cookie, NULL);
+ *ust = merge_counter(get_msc_reply->ust_hi, get_msc_reply->ust_lo);
+ *msc = merge_counter(get_msc_reply->msc_hi, get_msc_reply->msc_lo);
+ *sbc = merge_counter(get_msc_reply->sbc_hi, get_msc_reply->sbc_lo);
+ free(get_msc_reply);
- return ret;
+ return 0;
}
-#endif
-
static int
dri2WaitForMSC(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc)
@@ -1147,18 +1145,14 @@ dri2CreateScreen(int screen, struct glx_display * priv)
psp->getSwapInterval = NULL;
if (pdp->driMinor >= 2) {
-#ifdef X_DRI2GetMSC
psp->getDrawableMSC = dri2DrawableGetMSC;
-#endif
psp->waitForMSC = dri2WaitForMSC;
psp->waitForSBC = dri2WaitForSBC;
#ifdef X_DRI2SwapInterval
psp->setSwapInterval = dri2SetSwapInterval;
psp->getSwapInterval = dri2GetSwapInterval;
#endif
-#if defined(X_DRI2GetMSC) && defined(X_DRI2WaitMSC) && defined(X_DRI2SwapInterval)
__glXEnableDirectExtension(&psc->base, "GLX_OML_sync_control");
-#endif
}
/* DRI2 suports SubBuffer through DRI2CopyRegion, so it's always