Mesa (10.1): r600g: Disable LLVM by default at runtime for graphics

Carl Worth cworth at kemper.freedesktop.org
Wed Apr 23 09:27:24 UTC 2014


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

Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Apr 16 15:00:09 2014 +0900

r600g: Disable LLVM by default at runtime for graphics

For graphics, the LLVM compiler backend currently has many shortcomings
compared to the non-LLVM one. E.g. it can't handle geometry shaders yet,
but that's just the tip of the iceberg.

So building Mesa with --enable-r600-llvm-compiler is currently not
recommended for anyone who doesn't want to work on fixing those issues.
However, for protection of users who end up enabling it anyway for some
reason, let's disable the LLVM backend at runtime by default. It can be
enabled with the environment variable R600_DEBUG=llvm.

Cc: "10.1" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
(cherry picked from commit 7286739b9beea4683a29fe91850688a07ce23e1a)

---

 src/gallium/drivers/r600/r600_pipe.c   |    6 +++---
 src/gallium/drivers/r600/r600_pipe.h   |    2 +-
 src/gallium/drivers/r600/r600_shader.c |    2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 0b55a41..405600b 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -44,7 +44,7 @@
 static const struct debug_named_value r600_debug_options[] = {
 	/* features */
 #if defined(R600_USE_LLVM)
-	{ "nollvm", DBG_NO_LLVM, "Disable the LLVM shader compiler" },
+	{ "llvm", DBG_LLVM, "Enable the LLVM shader compiler" },
 #endif
 	{ "nocpdma", DBG_NO_CP_DMA, "Disable CP DMA" },
 	{ "nodma", DBG_NO_ASYNC_DMA, "Disable asynchronous DMA" },
@@ -591,8 +591,8 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws)
 		rscreen->b.debug_flags |= DBG_FS | DBG_VS | DBG_GS | DBG_PS | DBG_CS;
 	if (debug_get_bool_option("R600_HYPERZ", FALSE))
 		rscreen->b.debug_flags |= DBG_HYPERZ;
-	if (!debug_get_bool_option("R600_LLVM", TRUE))
-		rscreen->b.debug_flags |= DBG_NO_LLVM;
+	if (debug_get_bool_option("R600_LLVM", FALSE))
+		rscreen->b.debug_flags |= DBG_LLVM;
 
 	if (rscreen->b.family == CHIP_UNKNOWN) {
 		fprintf(stderr, "r600: Unknown chipset 0x%04X\n", rscreen->b.info.pci_id);
diff --git a/src/gallium/drivers/r600/r600_pipe.h b/src/gallium/drivers/r600/r600_pipe.h
index 621cbf9..1328744 100644
--- a/src/gallium/drivers/r600/r600_pipe.h
+++ b/src/gallium/drivers/r600/r600_pipe.h
@@ -195,7 +195,7 @@ struct r600_gs_rings_state {
 
 /* This must start from 16. */
 /* features */
-#define DBG_NO_LLVM		(1 << 17)
+#define DBG_LLVM		(1 << 17)
 #define DBG_NO_CP_DMA		(1 << 18)
 #define DBG_NO_ASYNC_DMA	(1 << 19)
 /* shader backend */
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index d91e68f..94da628 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -1521,7 +1521,7 @@ static int r600_shader_from_tgsi(struct r600_context *rctx,
 	bool pos_emitted = false;
 
 #ifdef R600_USE_LLVM
-	use_llvm = !(rscreen->b.debug_flags & DBG_NO_LLVM);
+	use_llvm = rscreen->b.debug_flags & DBG_LLVM;
 #endif
 	ctx.bc = &shader->bc;
 	ctx.shader = shader;




More information about the mesa-commit mailing list