radeon: add some debugging for flush ioctls
authorDave Airlie <airlied@redhat.com>
Mon, 23 Feb 2009 03:33:35 +0000 (13:33 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 23 Feb 2009 04:04:18 +0000 (14:04 +1000)
src/mesa/drivers/dri/radeon/radeon_common.c

index 6b161ef7a60f1f0a977d137d0215a8f339d80afa..3c491d584a00e6a9d1d70e7441cdc35ef78df39e 100644 (file)
@@ -715,6 +715,12 @@ int rcommonFlushCmdBufLocked(radeonContextPtr rmesa, const char *caller)
                exit(-1);
        }
        rmesa->cmdbuf.flushing = 1;
+
+       if (RADEON_DEBUG & DEBUG_IOCTL) {
+               fprintf(stderr, "%s from %s - %i cliprects\n",
+                       __FUNCTION__, caller, rmesa->numClipRects);
+       }
+
        if (rmesa->cmdbuf.cs->cdw) {
                ret = radeon_cs_emit(rmesa->cmdbuf.cs);
                rmesa->hw.all_dirty = GL_TRUE;
@@ -832,6 +838,11 @@ void rcommonBeginBatch(radeonContextPtr rmesa, int n,
                radeonEmitState(rmesa);
        }
        radeon_cs_begin(rmesa->cmdbuf.cs, n, file, function, line);
+
+        if (DEBUG_CMDBUF && RADEON_DEBUG & DEBUG_IOCTL)
+                fprintf(stderr, "BEGIN_BATCH(%d) at %d, from %s:%i\n",
+                        n, rmesa->cmdbuf.cs->cdw, function, line);
+
 }