diff options
author | Owain G. Ainsworth <oga@openbsd.org> | 2010-03-01 14:50:51 +0000 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-03-01 14:50:51 +0000 |
commit | 522fbbee7e3101880975a1b80a7cb1ca2fd5714e (patch) | |
tree | f51233fc3ece548c69c7fb8270016bdee00fc378 | |
parent | 4a83074c013847bf5c9ed3492cf0cfa35ba808c5 (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>
(cherry picked from commit 3c0815abf28744e215bea286e71d935cd486955a)
Conflicts:
src/i830.h
src/i830_batchbuffer.c
src/i830_driver.c
-rw-r--r-- | src/i830.h | 16 | ||||
-rw-r--r-- | src/i830_accel.c | 9 | ||||
-rw-r--r-- | src/i830_batchbuffer.c | 10 | ||||
-rw-r--r-- | src/i830_driver.c | 22 | ||||
-rw-r--r-- | src/i830_render.c | 4 | ||||
-rw-r--r-- | src/i830_uxa.c | 6 | ||||
-rw-r--r-- | src/i915_video.c | 2 | ||||
-rw-r--r-- | src/i965_render.c | 2 | ||||
-rw-r--r-- | src/i965_video.c | 2 |
9 files changed, 48 insertions, 25 deletions
@@ -622,8 +622,16 @@ typedef struct intel_screen_private { */ Bool fallback_debug; struct sdvo_device_mapping sdvo_mappings[2]; + unsigned debug_flush; } intel_screen_private; +enum { + DEBUG_FLUSH_BATCHES = 0x1, + DEBUG_FLUSH_CACHES = 0x2, + DEBUG_FLUSH_WAIT = 0x4, +}; + + static inline intel_screen_private * intel_get_screen_private(ScrnInfoPtr scrn) { @@ -960,13 +968,7 @@ enum { INTEL_CREATE_PIXMAP_TILING_Y, }; -#if (ALWAYS_FLUSH | ALWAYS_SYNC) -void i830_debug_sync(ScrnInfoPtr scrn); -#else -static inline void i830_debug_sync(ScrnInfoPtr scrn) -{ -} -#endif +void i830_debug_flush(ScrnInfoPtr scrn); static inline PixmapPtr get_drawable_pixmap(DrawablePtr drawable) { diff --git a/src/i830_accel.c b/src/i830_accel.c index ec59896b..8b58b8ce 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -153,15 +153,12 @@ void I830EmitFlush(ScrnInfoPtr scrn) } } -#if (ALWAYS_SYNC || ALWAYS_FLUSH) -void i830_debug_sync(ScrnInfoPtr scrn) +void i830_debug_flush(ScrnInfoPtr scrn) { - if (ALWAYS_SYNC) - I830Sync(scrn); - else + intel_screen_private *intel = intel_get_screen_private(scrn); + if (intel->debug_flush & DEBUG_FLUSH_BATCHES) intel_batch_flush(scrn, FALSE); } -#endif /* The following function sets up the supported acceleration. Call it * from the FbInit() function in the SVGA driver, or before ScreenInit diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c index a2c04139..1d106406 100644 --- a/src/i830_batchbuffer.c +++ b/src/i830_batchbuffer.c @@ -173,14 +173,15 @@ void intel_batch_flush(ScrnInfoPtr scrn, Bool flushed) return; /* If we're not using GEM, then emit a flush after each batch buffer */ - if (!intel->have_gem && !flushed) { + if (intel->debug_flush & DEBUG_FLUSH_CACHES || + (!intel->have_gem && !flushed)) { 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; + *(uint32_t *) (intel->batch_ptr + intel->batch_used) = + MI_FLUSH | flags; intel->batch_used += 4; } @@ -221,6 +222,9 @@ void intel_batch_flush(ScrnInfoPtr scrn, Bool flushed) if (intel->have_gem) 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); } diff --git a/src/i830_driver.c b/src/i830_driver.c index cb2575d3..5d25d5d9 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -176,6 +176,9 @@ typedef enum { OPTION_XVMC, #endif OPTION_PREFER_OVERLAY, + OPTION_DEBUG_FLUSH_BATCHES, + OPTION_DEBUG_FLUSH_CACHES, + OPTION_DEBUG_WAIT, } I830Opts; static OptionInfoRec I830Options[] = { @@ -194,6 +197,9 @@ static OptionInfoRec I830Options[] = { {OPTION_XVMC, "XvMC", OPTV_BOOLEAN, {0}, TRUE}, #endif {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_DEBUG_FLUSH_BATCHES, "DebugFlushBatches", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_DEBUG_FLUSH_CACHES, "DebugFlushCaches", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* *INDENT-ON* */ @@ -1266,6 +1272,22 @@ static Bool I830GetEarlyOptions(ScrnInfoPtr scrn) if (xf86ReturnOptValBool(intel->Options, OPTION_FORCEENABLEPIPEA, FALSE)) intel->quirk_flag |= QUIRK_PIPEA_FORCE; + intel->debug_flush = 0; + + if (xf86ReturnOptValBool(intel->Options, + OPTION_DEBUG_FLUSH_BATCHES, + FALSE)) + intel->debug_flush |= DEBUG_FLUSH_BATCHES; + + if (xf86ReturnOptValBool(intel->Options, + OPTION_DEBUG_FLUSH_CACHES, + FALSE)) + intel->debug_flush |= DEBUG_FLUSH_CACHES; + + if (xf86ReturnOptValBool(intel->Options, + OPTION_DEBUG_WAIT, + FALSE)) + intel->debug_flush |= DEBUG_FLUSH_WAIT; return TRUE; } diff --git a/src/i830_render.c b/src/i830_render.c index a7fac173..b141ba4d 100644 --- a/src/i830_render.c +++ b/src/i830_render.c @@ -527,8 +527,6 @@ i830_prepare_composite(int op, PicturePtr source_picture, intel->s8_blendctl = blendctl; } - i830_debug_sync(scrn); - intel->needs_render_state_emit = TRUE; return TRUE; @@ -819,8 +817,6 @@ i830_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, dstY, w, h); intel_batch_end_atomic(scrn); - - i830_debug_sync(scrn); } void i830_batch_flush_notify(ScrnInfoPtr scrn) diff --git a/src/i830_uxa.c b/src/i830_uxa.c index e9f72f31..2b705962 100644 --- a/src/i830_uxa.c +++ b/src/i830_uxa.c @@ -241,7 +241,7 @@ static void i830_uxa_done_solid(PixmapPtr pixmap) { ScrnInfoPtr scrn = xf86Screens[pixmap->drawable.pScreen->myNum]; - i830_debug_sync(scrn); + i830_debug_flush(scrn); } /** @@ -349,7 +349,7 @@ static void i830_uxa_done_copy(PixmapPtr dest) { ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - i830_debug_sync(scrn); + i830_debug_flush(scrn); } /** @@ -361,7 +361,7 @@ void i830_done_composite(PixmapPtr dest) { ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - i830_debug_sync(scrn); + i830_debug_flush(scrn); } #define xFixedToFloat(val) \ diff --git a/src/i915_video.c b/src/i915_video.c index 34ad8f97..e54bd9b4 100644 --- a/src/i915_video.c +++ b/src/i915_video.c @@ -460,4 +460,6 @@ I915DisplayVideoTextured(ScrnInfoPtr scrn, intel_batch_end_atomic(scrn); } + + i830_debug_flush(scrn); } diff --git a/src/i965_render.c b/src/i965_render.c index d283637d..710bd9db 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -1800,8 +1800,6 @@ i965_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, drm_intel_bo_unreference(vb_bo); intel_batch_end_atomic(scrn); - - i830_debug_sync(scrn); } void i965_batch_flush_notify(ScrnInfoPtr scrn) diff --git a/src/i965_video.c b/src/i965_video.c index 0fc10a70..89d5eef8 100644 --- a/src/i965_video.c +++ b/src/i965_video.c @@ -1259,6 +1259,8 @@ I965DisplayVideoTextured(ScrnInfoPtr scrn, #if WATCH_STATS /* i830_dump_error_state(scrn); */ #endif + + i830_debug_flush(scrn); } void i965_free_video(ScrnInfoPtr scrn) |