[Mesa-dev] [PATCH 15/19] glx: Replace DRI2SwapInterval custom protocol with XCB.

Eric Anholt eric at anholt.net
Tue Sep 25 19:50:13 PDT 2012


---
 src/glx/dri2.c     |   19 -------------------
 src/glx/dri2.h     |    3 ---
 src/glx/dri2_glx.c |    9 ++-------
 3 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index 0c49b83..c77ef7b 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -585,23 +585,4 @@ void DRI2SwapBuffers(Display *dpy, XID drawable, CARD64 target_msc,
 }
 #endif
 
-#ifdef X_DRI2SwapInterval
-void DRI2SwapInterval(Display *dpy, XID drawable, int interval)
-{
-    XExtDisplayInfo *info = DRI2FindDisplay(dpy);
-    xDRI2SwapIntervalReq *req;
-
-    XextSimpleCheckExtension (dpy, info, dri2ExtensionName);
-
-    LockDisplay(dpy);
-    GetReq(DRI2SwapInterval, req);
-    req->reqType = info->codes->major_opcode;
-    req->dri2ReqType = X_DRI2SwapInterval;
-    req->drawable = drawable;
-    req->interval = interval;
-    UnlockDisplay(dpy);
-    SyncHandle();
-}
-#endif
-
 #endif /* GLX_DIRECT_RENDERING */
diff --git a/src/glx/dri2.h b/src/glx/dri2.h
index 991ab37..179e8f9 100644
--- a/src/glx/dri2.h
+++ b/src/glx/dri2.h
@@ -89,7 +89,4 @@ extern void
 DRI2SwapBuffers(Display *dpy, XID drawable, CARD64 target_msc, CARD64 divisor,
 		CARD64 remainder, CARD64 *count);
 
-extern void
-DRI2SwapInterval(Display *dpy, XID drawable, int interval);
-
 #endif
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 178159a..f9e9c79 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -811,11 +811,10 @@ dri2GetBuffersWithFormat(__DRIdrawable * driDrawable,
    return pdraw->buffers;
 }
 
-#ifdef X_DRI2SwapInterval
-
 static int
 dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
 {
+   xcb_connection_t *c = XGetXCBConnection(pdraw->psc->dpy);
    struct dri2_drawable *priv =  (struct dri2_drawable *) pdraw;
    GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1;
    struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc;
@@ -837,7 +836,7 @@ dri2SetSwapInterval(__GLXDRIdrawable *pdraw, int interval)
       break;
    }
 
-   DRI2SwapInterval(priv->base.psc->dpy, priv->base.xDrawable, interval);
+   xcb_dri2_swap_interval(c, priv->base.xDrawable, interval);
    priv->swap_interval = interval;
 
    return 0;
@@ -851,8 +850,6 @@ dri2GetSwapInterval(__GLXDRIdrawable *pdraw)
   return priv->swap_interval;
 }
 
-#endif /* X_DRI2SwapInterval */
-
 static const __DRIdri2LoaderExtension dri2LoaderExtension = {
    {__DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION},
    dri2GetBuffers,
@@ -1146,10 +1143,8 @@ dri2CreateScreen(int screen, struct glx_display * priv)
       psp->getDrawableMSC = dri2DrawableGetMSC;
       psp->waitForMSC = dri2WaitForMSC;
       psp->waitForSBC = dri2WaitForSBC;
-#ifdef X_DRI2SwapInterval
       psp->setSwapInterval = dri2SetSwapInterval;
       psp->getSwapInterval = dri2GetSwapInterval;
-#endif
       __glXEnableDirectExtension(&psc->base, "GLX_OML_sync_control");
    }
 
-- 
1.7.10.4



More information about the mesa-dev mailing list