diff --git a/configure.ac b/configure.ac index 3e08645..32d575f 100644 --- a/configure.ac +++ b/configure.ac @@ -2051,16 +2051,19 @@ require_egl_drm() { } radeon_llvm_check() { + if test ${LLVM_VERSION_INT} -lt 307; then + amdgpu_llvm_target_name='r600' + else + amdgpu_llvm_target_name='amdgpu' + fi if test "x$enable_gallium_llvm" != "xyes"; then AC_MSG_ERROR([--enable-gallium-llvm is required when building $1]) fi llvm_check_version_for "3" "4" "2" $1 - if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then - AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM - sources with the --enable-experimental-targets=R600 - configure flag]) + if test true && $LLVM_CONFIG --targets-built | grep -iqvw $amdgpu_llvm_target_name ; then + AC_MSG_ERROR([LLVM $amdgpu_llvm_target_name not enabled in your LLVM build.]) fi - LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo" + LLVM_COMPONENTS="${LLVM_COMPONENTS} $amdgpu_llvm_target_name bitreader ipo" NEED_RADEON_LLVM=yes if test "x$have_libelf" != xyes; then AC_MSG_ERROR([$1 requires libelf when using llvm]) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp index be3e834..76c302f 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp @@ -277,8 +277,10 @@ disassemble(const void* func, llvm::raw_ostream & Out) options.StackAlignmentOverride = 4; #endif #if defined(DEBUG) || defined(PROFILE) +#if HAVE_LLVM < 0x0307 options.NoFramePointerElim = true; #endif +#endif OwningPtr TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "", options)); /* diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 5e8a634..5e25819 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp +++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp @@ -50,6 +50,12 @@ #include +// Workaround http://llvm.org/PR23628 +#if HAVE_LLVM >= 0x0307 +# pragma push_macro("DEBUG") +# undef DEBUG +#endif + #include #include #include @@ -70,6 +76,11 @@ #include #include +// Workaround http://llvm.org/PR23628 +#if HAVE_LLVM >= 0x0307 +# pragma pop_macro("DEBUG") +#endif + #include "pipe/p_config.h" #include "util/u_debug.h" #include "util/u_cpu_detect.h" @@ -439,8 +450,10 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT, #if HAVE_LLVM < 0x0304 options.NoFramePointerElimNonLeaf = true; #endif +#if HAVE_LLVM < 0x0307 options.NoFramePointerElim = true; #endif +#endif builder.setEngineKind(EngineKind::JIT) .setErrorStr(&Error) diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c index 624077c..25580b6 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.c +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c @@ -86,10 +86,18 @@ static void init_r600_target() { static unsigned initialized = 0; if (!initialized) { +#if HAVE_LLVM < 0x0307 LLVMInitializeR600TargetInfo(); LLVMInitializeR600Target(); LLVMInitializeR600TargetMC(); LLVMInitializeR600AsmPrinter(); +#else + LLVMInitializeAMDGPUTargetInfo(); + LLVMInitializeAMDGPUTarget(); + LLVMInitializeAMDGPUTargetMC(); + LLVMInitializeAMDGPUAsmPrinter(); + +#endif initialized = 1; } } diff --git a/src/gallium/drivers/radeon/radeon_video.c b/src/gallium/drivers/radeon/radeon_video.c index 65949fb..56f3b2e 100644 --- a/src/gallium/drivers/radeon/radeon_video.c +++ b/src/gallium/drivers/radeon/radeon_video.c @@ -299,7 +299,7 @@ int rvid_get_video_param(struct pipe_screen *screen, case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE: case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN: case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH: - return 41; + return (rscreen->family < CHIP_TONGA) ? 41 : 52; default: return 0; }