dri: Remove unnecessary timestamp pointer indirection
authorKristian Høgsberg <krh@bitplanet.net>
Fri, 28 Oct 2011 20:22:03 +0000 (16:22 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 2 Nov 2011 15:16:02 +0000 (11:16 -0400)
src/gallium/state_trackers/dri/common/dri_drawable.c
src/gallium/state_trackers/dri/drm/dri2.c
src/gallium/state_trackers/dri/sw/dri_drawable.c [deleted symlink]
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/nouveau/nouveau_context.c

index 485616fde6c25a523a221418314d4269ca6bbe11..d8db69e7f042884ab88e8ee0d6c6a8ecbf5f337e 100644 (file)
@@ -62,9 +62,9 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi,
    new_mask = (statt_mask & ~drawable->texture_mask);
 
    /*
-    * dPriv->pStamp is the server stamp.  It should be accessed with a lock, at
-    * least for DRI1.  dPriv->lastStamp is the client stamp.  It has the value
-    * of the server stamp when last checked.
+    * dPriv->dri2.stamp is the server stamp.  dPriv->lastStamp is the
+    * client stamp.  It has the value of the server stamp when last
+    * checked.
     */
    new_stamp = (drawable->texture_stamp != drawable->dPriv->lastStamp);
 
index d3db0ccda5194cc2de917f06a448fe701ff2bcda..a62a084c13f1d3f56680b66c4ef0520aff5527b4 100644 (file)
@@ -65,7 +65,7 @@ dri2_invalidate_drawable(__DRIdrawable *dPriv)
    struct dri_drawable *drawable = dri_drawable(dPriv);
 
    dri2InvalidateDrawable(dPriv);
-   drawable->dPriv->lastStamp = *drawable->dPriv->pStamp;
+   drawable->dPriv->lastStamp = drawable->dPriv->dri2.stamp;
 
    p_atomic_inc(&drawable->base.stamp);
 }
diff --git a/src/gallium/state_trackers/dri/sw/dri_drawable.c b/src/gallium/state_trackers/dri/sw/dri_drawable.c
deleted file mode 120000 (symlink)
index 0fc19be..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../common/dri_drawable.c
\ No newline at end of file
index aa095d8f282905fbe31690c198786bcf81830c01..9deb99727143dc9e611b92dee4928c568d017c93 100644 (file)
@@ -171,7 +171,6 @@ dri2CreateNewDrawable(__DRIscreen *screen,
     pdraw->driContextPriv = NULL;
     pdraw->loaderPrivate = loaderPrivate;
     pdraw->refcount = 1;
-    pdraw->pStamp = NULL;
     pdraw->lastStamp = 0;
     pdraw->w = 0;
     pdraw->h = 0;
@@ -182,8 +181,7 @@ dri2CreateNewDrawable(__DRIscreen *screen,
        return NULL;
     }
 
-    pdraw->pStamp = &pdraw->dri2.stamp;
-    *pdraw->pStamp = pdraw->lastStamp + 1;
+    pdraw->dri2.stamp = pdraw->lastStamp + 1;
 
     return pdraw;
 }
index ab11d45dbd9e4897281adee24d731f9dec37a4bb..38394a7fefa7e52d6f6614a8346b4cffa0983671 100644 (file)
@@ -159,16 +159,10 @@ struct __DRIdrawableRec {
      */
     int refcount;
 
-    /**
-     * Pointer to the "drawable has changed ID" stamp in the SAREA (or
-     * to dri2.stamp if DRI2 is being used).
-     */
-    unsigned int *pStamp;
-
     /**
      * Last value of the stamp.
      *
-     * If this differs from the value stored at __DRIdrawable::pStamp,
+     * If this differs from the value stored at __DRIdrawable::dri2.stamp,
      * then the drawable information has been modified by the X server, and the
      * drawable information (below) should be retrieved from the X server.
      */
@@ -186,6 +180,9 @@ struct __DRIdrawableRec {
      */
     __DRIscreen *driScreenPriv;
 
+    /**
+     * Drawable timestamp.  Increased when the loader calls invalidate.
+     */
     struct {
        unsigned int stamp;
     } dri2;
index 65cbc4168e182bd4637e8cb7e349549ed0bb50e2..2b9507c6a81f24f8a551cc5ac599c1cba782ba8f 100644 (file)
@@ -177,9 +177,9 @@ nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw)
        __DRIbuffer *buffers = NULL;
        int i = 0, count, ret;
 
-       if (draw->lastStamp == *draw->pStamp)
+       if (draw->lastStamp == draw->dri2.stamp)
                return;
-       draw->lastStamp = *draw->pStamp;
+       draw->lastStamp = draw->dri2.stamp;
 
        if (nfb->need_front)
                attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
@@ -257,7 +257,7 @@ update_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw,
        struct gl_context *ctx = dri_ctx->driverPrivate;
        struct gl_framebuffer *fb = draw->driverPrivate;
 
-       *stamp = *draw->pStamp;
+       *stamp = draw->dri2.stamp;
 
        nouveau_update_renderbuffers(dri_ctx, draw);
        _mesa_resize_framebuffer(ctx, fb, draw->w, draw->h);
@@ -337,7 +337,7 @@ validate_framebuffer(__DRIcontext *dri_ctx, __DRIdrawable *draw,
                dri2InvalidateDrawable(draw);
        }
 
-       if (*draw->pStamp != *stamp)
+       if (draw->dri2.stamp != *stamp)
                update_framebuffer(dri_ctx, draw, stamp);
 }