summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
authorJesse Barnes <[email protected]>2010-04-19 14:19:48 -0700
committerJesse Barnes <[email protected]>2010-04-19 14:20:21 -0700
commit0a18cdb0ed2f4b747688f653d9947d174fae77ff (patch)
tree851c77d809ce948d7e6ea2f2878ea77fb0d2b91a /src/glx/dri2_glx.c
parent385e2896ebf54ac0b016132fe513f21a5b67ba4f (diff)
DRI2: check for swapAvailable before using swap interval protocol
This should have been part of the last change...
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index d09d614741d..3a53ce91b38 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -175,6 +175,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
{
__GLXDRIdrawablePrivate *pdraw;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
+ __GLXdisplayPrivate *dpyPriv;
+ __GLXDRIdisplayPrivate *pdp;
pdraw = Xmalloc(sizeof(*pdraw));
if (!pdraw)
@@ -189,6 +191,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
DRI2CreateDrawable(psc->dpy, xDrawable);
+ dpyPriv = __glXInitialize(psc->dpy);
+ pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;;
/* Create a new drawable */
pdraw->base.driDrawable =
(*psc->dri2->createNewDrawable) (psc->__driScreen,
@@ -204,7 +208,9 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
* Make sure server has the same swap interval we do for the new
* drawable.
*/
- DRI2SwapInterval(psc->dpy, xDrawable, pdraw->swap_interval);
+ if (pdp->swapAvailable)
+ DRI2SwapInterval(psc->dpy, xDrawable, pdraw->swap_interval);
+
return &pdraw->base;
}