DRI2: check for swapAvailable before using swap interval protocol

This should have been part of the last change...
This commit is contained in:
Jesse Barnes
2010-04-19 14:19:48 -07:00
parent 385e2896eb
commit 0a18cdb0ed

View File

@@ -175,6 +175,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
{ {
__GLXDRIdrawablePrivate *pdraw; __GLXDRIdrawablePrivate *pdraw;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
__GLXdisplayPrivate *dpyPriv;
__GLXDRIdisplayPrivate *pdp;
pdraw = Xmalloc(sizeof(*pdraw)); pdraw = Xmalloc(sizeof(*pdraw));
if (!pdraw) if (!pdraw)
@@ -189,6 +191,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
DRI2CreateDrawable(psc->dpy, xDrawable); DRI2CreateDrawable(psc->dpy, xDrawable);
dpyPriv = __glXInitialize(psc->dpy);
pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;;
/* Create a new drawable */ /* Create a new drawable */
pdraw->base.driDrawable = pdraw->base.driDrawable =
(*psc->dri2->createNewDrawable) (psc->__driScreen, (*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 * Make sure server has the same swap interval we do for the new
* drawable. * drawable.
*/ */
DRI2SwapInterval(psc->dpy, xDrawable, pdraw->swap_interval); if (pdp->swapAvailable)
DRI2SwapInterval(psc->dpy, xDrawable, pdraw->swap_interval);
return &pdraw->base; return &pdraw->base;
} }