[Mesa-dev] [PATCH 2/2] radeon/llvm: Initialize gallivm targets when initializing the AMDGPU target

Tom Stellard thomas.stellard at amd.com
Thu Sep 24 09:32:00 PDT 2015


This fixes a race condition in the glx-multithreaded-shader-compile
test.

CC: "10.6 11.0" <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeon/radeon_llvm_emit.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c
index 0002559..045665a 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
@@ -25,6 +25,7 @@
  */
 #include "radeon_llvm_emit.h"
 #include "radeon_elf_util.h"
+#include "gallivm/lp_bld_misc.h"
 #include "util/u_memory.h"
 #include "pipe/p_shader_tokens.h"
 
@@ -88,6 +89,7 @@ static void init_r600_target()
 {
 	static unsigned initialized = 0;
 	if (!initialized) {
+		gallivm_init_llvm_begin();
 #if HAVE_LLVM < 0x0307
 		LLVMInitializeR600TargetInfo();
 		LLVMInitializeR600Target();
@@ -101,6 +103,7 @@ static void init_r600_target()
 
 #endif
 		initialized = 1;
+		gallivm_init_llvm_end();
 	}
 }
 
-- 
2.0.4



More information about the mesa-dev mailing list