[i915] Add INTEL_DEBUG=sync debug flag to wait for fences after making them.
authorEric Anholt <eric@anholt.net>
Fri, 16 Nov 2007 22:56:26 +0000 (14:56 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 16 Nov 2007 23:36:18 +0000 (15:36 -0800)
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i915/intel_context.h
src/mesa/drivers/dri/intel/intel_batchbuffer.c

index 2b93f60ab4d2f3fc62c37f4f3438b231e1d06b36..a26a424f86223a26e8be9325a47d75755d5b9582 100644 (file)
@@ -245,6 +245,7 @@ static const struct dri_debug_control debug_control[] = {
    {"reg", DEBUG_REGION},
    {"fbo", DEBUG_FBO},
    {"lock", DEBUG_LOCK},
+   {"sync", DEBUG_SYNC},
    {NULL, 0}
 };
 
index 7272f8f352ba953f14ddfcc7376e72ba9c44ae5f..4bec712f3d01cfa433f39f73e0bcf7c07305c26f 100644 (file)
@@ -355,6 +355,7 @@ extern int INTEL_DEBUG;
 #define DEBUG_REGION    0x400
 #define DEBUG_FBO       0x800
 #define DEBUG_LOCK      0x1000
+#define DEBUG_SYNC     0x2000
 
 #define DBG(...)  do { if (INTEL_DEBUG & FILE_DEBUG_FLAG) _mesa_printf(__VA_ARGS__); } while(0)
 
index 9ec60fcff39c6156cd2e3dcd1e4dec97690fa0eb..4e698627a369f4a6f31e644160e5080572c1a21c 100644 (file)
@@ -212,6 +212,12 @@ intel_batchbuffer_flush(struct intel_batchbuffer *batch)
    if (!was_locked)
       UNLOCK_HARDWARE(intel);
 
+   if (INTEL_DEBUG & DEBUG_SYNC) {
+      fprintf(stderr, "waiting for idle\n");
+      if (batch->last_fence != NULL)
+        dri_fence_wait(batch->last_fence);
+   }
+
    /* Reset the buffer:
     */
    intel_batchbuffer_reset(batch);