Mesa (master): radeonsi: move gfx fence wait out of si_check_vm_faults

Nicolai Hähnle nh at kemper.freedesktop.org
Fri Jun 24 10:36:08 UTC 2016


Module: Mesa
Branch: master
Commit: 80dd7870fe87969e97045ea71b1f6e8180ac9606
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=80dd7870fe87969e97045ea71b1f6e8180ac9606

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Mon Jun 20 16:47:06 2016 +0200

radeonsi: move gfx fence wait out of si_check_vm_faults

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/radeonsi/si_debug.c      | 5 -----
 src/gallium/drivers/radeonsi/si_hw_context.c | 8 +++++++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c
index 176a195..8e16e29 100644
--- a/src/gallium/drivers/radeonsi/si_debug.c
+++ b/src/gallium/drivers/radeonsi/si_debug.c
@@ -774,11 +774,6 @@ void si_check_vm_faults(struct si_context *sctx)
 	FILE *f;
 	uint32_t addr;
 
-	/* Use conservative timeout 800ms, after which we won't wait any
-	 * longer and assume the GPU is hung.
-	 */
-	sctx->b.ws->fence_wait(sctx->b.ws, sctx->last_gfx_fence, 800*1000*1000);
-
 	if (!si_vm_fault_occured(sctx, &addr))
 		return;
 
diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index 696217d..656d435 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -144,8 +144,14 @@ void si_context_gfx_flush(void *context, unsigned flags,
 		ws->fence_reference(fence, ctx->last_gfx_fence);
 
 	/* Check VM faults if needed. */
-	if (ctx->screen->b.debug_flags & DBG_CHECK_VM)
+	if (ctx->screen->b.debug_flags & DBG_CHECK_VM) {
+		/* Use conservative timeout 800ms, after which we won't wait any
+		 * longer and assume the GPU is hung.
+		 */
+		ctx->b.ws->fence_wait(ctx->b.ws, ctx->last_gfx_fence, 800*1000*1000);
+
 		si_check_vm_faults(ctx);
+	}
 
 	si_begin_new_cs(ctx);
 	ctx->gfx_flush_in_progress = false;




More information about the mesa-commit mailing list