Merge branch 'mesa_7_6_branch' of git+ssh://agd5f@git.freedesktop.org/git/mesa/mesa
[mesa.git] / src / mesa / drivers / dri / common / dri_util.h
index 0feb57b3c6e6ac6d40e070f909e04a917ca2d200..c95a5c8299a11c672527137bea9f78b4bbea3cf6 100644 (file)
@@ -106,6 +106,28 @@ do {                                                                    \
     }                                                                   \
 } while (0)
 
+/**
+ * Same as above, but for two drawables simultaneously.
+ *
+ */
+
+#define DRI_VALIDATE_TWO_DRAWABLES_INFO(psp, pdp, prp)                 \
+do {                                                           \
+    while (*((pdp)->pStamp) != (pdp)->lastStamp ||                     \
+          *((prp)->pStamp) != (prp)->lastStamp) {                      \
+        register unsigned int hwContext = (psp)->pSAREA->lock.lock &   \
+           ~(DRM_LOCK_HELD | DRM_LOCK_CONT);                           \
+       DRM_UNLOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext);         \
+                                                                       \
+       DRM_SPINLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
+       DRI_VALIDATE_DRAWABLE_INFO_ONCE(pdp);                           \
+       DRI_VALIDATE_DRAWABLE_INFO_ONCE(prp);                           \
+       DRM_SPINUNLOCK(&(psp)->pSAREA->drawable_lock, (psp)->drawLockID); \
+                                                                       \
+       DRM_LIGHT_LOCK((psp)->fd, &(psp)->pSAREA->lock, hwContext);     \
+    }                                                                   \
+} while (0)
+
 
 /**
  * Driver callback functions.