Mesa (master): r600g: add debug options disabling various copy-buffer-related features

Marek Olšák mareko at kemper.freedesktop.org
Mon Mar 11 12:51:47 UTC 2013


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Tue Mar  5 01:15:45 2013 +0100

r600g: add debug options disabling various copy-buffer-related features

This will be invaluable for debugging and bug reports.

---

 src/gallium/drivers/r600/r600_buffer.c |    1 +
 src/gallium/drivers/r600/r600_pipe.c   |    9 +++++++--
 src/gallium/drivers/r600/r600_pipe.h   |    3 +++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c
index 4dbe363..e46f7fd 100644
--- a/src/gallium/drivers/r600/r600_buffer.c
+++ b/src/gallium/drivers/r600/r600_buffer.c
@@ -150,6 +150,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
 	}
 	else if ((usage & PIPE_TRANSFER_DISCARD_RANGE) &&
 		 !(usage & PIPE_TRANSFER_UNSYNCHRONIZED) &&
+		 !(rctx->screen->debug_flags & DBG_NO_DISCARD_RANGE) &&
 		 (rctx->screen->has_cp_dma ||
 		  (rctx->screen->has_streamout &&
 		   /* The buffer range must be aligned to 4 with streamout. */
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 8c853dc..60a0247 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -56,6 +56,10 @@ static const struct debug_named_value debug_options[] = {
 #if defined(R600_USE_LLVM)
 	{ "nollvm", DBG_NO_LLVM, "Disable the LLVM shader compiler" },
 #endif
+	{ "nocpdma", DBG_NO_CP_DMA, "Disable CP DMA" },
+	{ "nodma", DBG_NO_ASYNC_DMA, "Disable asynchronous DMA" },
+	/* GL uses the word INVALIDATE, gallium uses the word DISCARD */
+	{ "noinvalrange", DBG_NO_DISCARD_RANGE, "Disable handling of INVALIDATE_RANGE map flags" },
 
 	DEBUG_NAMED_VALUE_END /* must be last */
 };
@@ -425,7 +429,7 @@ static struct pipe_context *r600_create_context(struct pipe_screen *screen, void
 	rctx->rings.gfx.flushing = false;
 
 	rctx->rings.dma.cs = NULL;
-	if (rscreen->info.r600_has_dma) {
+	if (rscreen->info.r600_has_dma && !(rscreen->debug_flags & DBG_NO_ASYNC_DMA)) {
 		rctx->rings.dma.cs = rctx->ws->cs_create(rctx->ws, RING_DMA);
 		rctx->rings.dma.flush = r600_flush_dma_ring;
 		rctx->ws->cs_set_flush_callback(rctx->rings.dma.cs, r600_flush_dma_from_winsys, rctx);
@@ -1136,7 +1140,8 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
 		break;
 	}
 
-	rscreen->has_cp_dma = rscreen->info.drm_minor >= 27;
+	rscreen->has_cp_dma = rscreen->info.drm_minor >= 27 &&
+			      !(rscreen->debug_flags & DBG_NO_CP_DMA);
 
 	if (r600_init_tiling(rscreen)) {
 		FREE(rscreen);
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 7e0f242..285d45f 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -249,6 +249,9 @@ typedef boolean (*r600g_dma_blit_t)(struct pipe_context *ctx,
 /* features */
 #define DBG_NO_HYPERZ		(1 << 16)
 #define DBG_NO_LLVM		(1 << 17)
+#define DBG_NO_CP_DMA		(1 << 18)
+#define DBG_NO_ASYNC_DMA	(1 << 19)
+#define DBG_NO_DISCARD_RANGE	(1 << 20)
 
 struct r600_tiling_info {
 	unsigned num_channels;




More information about the mesa-commit mailing list