summaryrefslogtreecommitdiff
path: root/src/i830_batchbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-10-14 11:29:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2009-10-14 11:53:20 +0100
commit3c0815abf28744e215bea286e71d935cd486955a (patch)
tree14df4b6a111ff77e3b7af815a0883cafb00d8178 /src/i830_batchbuffer.c
parent2f134b84445d2d0bfe3d81276bc7f6648df062ee (diff)
conf: Add debugging flush options
Make the following options available via xorg.conf: Section "Driver" Option "DebugFlushBatches" "1" # Flush the batch buffer after every # single operation; Option "DebugFlushCaches" "1" # Include a MI_FLUSH at the end of every # batch buffer to force data to be # flushed out of cache and into memory # before the completion of the batch. Option "DebugWait" "1" # Wait for the completion of every batch buffer # before continuing, i.e. perform synchronous # rendering. EndSection Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i830_batchbuffer.c')
-rw-r--r--src/i830_batchbuffer.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index f662dfcd..62466b78 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -98,6 +98,17 @@ void intel_batch_flush(ScrnInfoPtr scrn, Bool flushed)
if (intel->batch_used == 0)
return;
+ if (intel->debug_flush & DEBUG_FLUSH_CACHES) {
+ int flags = MI_WRITE_DIRTY_STATE | MI_INVALIDATE_MAP_CACHE;
+
+ if (IS_I965G(intel))
+ flags = 0;
+
+ *(uint32_t *) (intel->batch_ptr + intel->batch_used) =
+ MI_FLUSH | flags;
+ intel->batch_used += 4;
+ }
+
/* Emit a padding dword if we aren't going to be quad-word aligned. */
if ((intel->batch_used & 4) == 0) {
*(uint32_t *) (intel->batch_ptr + intel->batch_used) = MI_NOOP;
@@ -134,6 +145,9 @@ void intel_batch_flush(ScrnInfoPtr scrn, Bool flushed)
*/
intel->need_mi_flush = TRUE;
+ if (intel->debug_flush & DEBUG_FLUSH_WAIT)
+ intel_batch_wait_last(scrn);
+
if (intel->batch_flush_notify)
intel->batch_flush_notify(scrn);
}