Mesa (master): dri2_glx: Put the invalidate b/c code back in

Kristian Høgsberg krh at kemper.freedesktop.org
Wed May 19 02:59:26 UTC 2010


Module: Mesa
Branch: master
Commit: 4cd259ca59128ff2712c42ff2d2340b01a3b74a8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4cd259ca59128ff2712c42ff2d2340b01a3b74a8

Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Tue May 18 14:45:10 2010 -0400

dri2_glx: Put the invalidate b/c code back in

The backwards compatibility code calls the DRI driver invalidate hook
on swap buffer and flush front buffer.  This lets the DRI driver rely
on invalidate callbacks and drop the glViewport() hack, even if the
server doesn't send invalidate events.  This is essentially a revert
of 2d00d16da7f5d2255cb37b48edaf4cbb9ca7e930, except that we now also
pass the __DRI_USE_INVALIDATE extension even when the server doesn't
have DRI2 invalidate events.

---

 src/glx/dri2_glx.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 17352e9..4595991 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -361,6 +361,14 @@ 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);
 }
 
@@ -421,16 +429,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);
@@ -737,8 +745,7 @@ dri2CreateDisplay(Display * dpy)
    pdp->loader_extensions[i++] = &systemTimeExtension.base;
 
 #ifdef __DRI_USE_INVALIDATE
-   if (pdp->invalidateAvailable)
-      pdp->loader_extensions[i++] = &dri2UseInvalidate.base;
+   pdp->loader_extensions[i++] = &dri2UseInvalidate.base;
 #endif
    pdp->loader_extensions[i++] = NULL;
 




More information about the mesa-commit mailing list