radeon/llvm: Initialize gallivm targets when initializing the AMDGPU target v2
authorTom Stellard <thomas.stellard@amd.com>
Thu, 24 Sep 2015 16:29:56 +0000 (16:29 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 2 Oct 2015 23:41:27 +0000 (23:41 +0000)
This fixes a race condition in the glx-multithreaded-shader-compile
test.

v2:
  - Replace gallivm_init_llvm_{begin,end}() with gallivm_init_llvm_targets().

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/radeon/radeon_llvm_emit.c

index ff30a14b0af3078784c4fbaded2a6e14848a5e1a..6b2ebdead38247e518f52714283d03049355d1ee 100644 (file)
@@ -26,6 +26,7 @@
 #include "radeon_llvm_emit.h"
 #include "radeon_elf_util.h"
 #include "c11/threads.h"
+#include "gallivm/lp_bld_misc.h"
 #include "util/u_memory.h"
 #include "pipe/p_shader_tokens.h"
 
@@ -87,6 +88,7 @@ void radeon_llvm_shader_type(LLVMValueRef F, unsigned type)
 
 static void init_r600_target()
 {
+       gallivm_init_llvm_targets();
 #if HAVE_LLVM < 0x0307
        LLVMInitializeR600TargetInfo();
        LLVMInitializeR600Target();