summaryrefslogtreecommitdiff
authorKristian Høgsberg <krh@bitplanet.net>2010-05-10 19:51:31 (GMT)
committer Kristian Høgsberg <krh@bitplanet.net>2010-05-10 21:48:11 (GMT)
commit2d00d16da7f5d2255cb37b48edaf4cbb9ca7e930 (patch) (side-by-side diff)
treeb81c77833ec954bd3601a94163e0c67e2a97b0cd
parent7c5152c1994487a42b90b068fdc5101dbef63d36 (diff)
downloadmesa-2d00d16da7f5d2255cb37b48edaf4cbb9ca7e930.zip
mesa-2d00d16da7f5d2255cb37b48edaf4cbb9ca7e930.tar.gz
glx: Only call DRI2 invalidate when necessary
We only need this when the server may have swapped the buffers or when we receive an invalidate event from the server. The default behaviour is still that the DRI driver will invalidate its own buffers when glViewport is called. https://bugs.freedesktop.org/show_bug.cgi?id=27277
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/glx/dri2_glx.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 6058c72..ca2a753 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -359,14 +359,6 @@ dri2WaitGL(__GLXDRIdrawable * pdraw)
static void
dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate)
{
- __GLXDRIdrawablePrivate *pdraw = loaderPrivate;
- __GLXdisplayPrivate *priv = __glXInitialize(pdraw->base.psc->dpy);
- __GLXDRIdisplayPrivate *pdp = (__GLXDRIdisplayPrivate *)priv->dri2Display;
-
- /* Old servers don't send invalidate events */
- if (!pdp->invalidateAvailable)
- dri2InvalidateBuffers(priv->dpy, pdraw->base.drawable);
-
dri2WaitGL(loaderPrivate);
}
@@ -427,16 +419,16 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor,
(*pdraw->psc->f->flush)(pdraw->driDrawable);
#endif
- /* Old servers don't send invalidate events */
- if (!pdp->invalidateAvailable)
- dri2InvalidateBuffers(dpyPriv->dpy, pdraw->drawable);
-
/* Old servers can't handle swapbuffers */
if (!pdp->swapAvailable) {
dri2CopySubBuffer(pdraw, 0, 0, priv->width, priv->height);
return 0;
}
+ /* Old servers don't send invalidate events */
+ if (!pdp->invalidateAvailable)
+ dri2InvalidateBuffers(dpyPriv->dpy, pdraw->drawable);
+
#ifdef X_DRI2SwapBuffers
DRI2SwapBuffers(pdraw->psc->dpy, pdraw->xDrawable, target_msc, divisor,
remainder, &ret);