From f35b48660114514da475c533420fcbfb56f6224b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 19 Mar 2014 06:17:01 +0000 Subject: [PATCH] rebuild against backported llvm 3.4-5 for radeonsi GL 3.3 support. --- mesa.spec | 11 +++- radeonsi-llvm-version-hack.patch | 99 ++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 radeonsi-llvm-version-hack.patch diff --git a/mesa.spec b/mesa.spec index 1c7cf2b..93fc44d 100644 --- a/mesa.spec +++ b/mesa.spec @@ -51,7 +51,7 @@ Summary: Mesa graphics libraries Name: mesa Version: 10.1 -Release: 2.%{gitdate}%{?dist} +Release: 3.%{gitdate}%{?dist} License: MIT Group: System Environment/Libraries URL: http://www.mesa3d.org @@ -77,6 +77,8 @@ Patch20: mesa-9.2-evergreen-big-endian.patch # https://bugs.freedesktop.org/show_bug.cgi?id=73512 Patch99: 0001-opencl-use-versioned-.so-in-mesa.icd.patch +Patch100: radeonsi-llvm-version-hack.patch + BuildRequires: pkgconfig autoconf automake libtool %if %{with_hardware} BuildRequires: kernel-headers @@ -101,7 +103,7 @@ BuildRequires: gettext %if 0%{?with_private_llvm} BuildRequires: mesa-private-llvm-devel %else -BuildRequires: llvm-devel >= 3.0 +BuildRequires: llvm-devel >= 3.4-5 %if 0%{?with_opencl} BuildRequires: clang-devel >= 3.0 %endif @@ -331,6 +333,8 @@ grep -q ^/ src/gallium/auxiliary/vl/vl_decoder.c && exit 1 %patch99 -p1 -b .icd %endif +%patch100 -p1 -b .radeonsi + %if 0%{with_private_llvm} sed -i 's/llvm-config/mesa-private-llvm-config-%{__isa_bits}/g' configure.ac sed -i 's/`$LLVM_CONFIG --version`/&-mesa/' configure.ac @@ -631,6 +635,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Wed Mar 19 2014 Dave Airlie 10.1-3.20140305 +- rebuild against backported llvm 3.4-5 for radeonsi GL 3.3 support. + * Wed Mar 12 2014 Dave Airlie 10.1-2.20140305 - disable r600 llvm compiler (upstream advice) diff --git a/radeonsi-llvm-version-hack.patch b/radeonsi-llvm-version-hack.patch new file mode 100644 index 0000000..6d12480 --- /dev/null +++ b/radeonsi-llvm-version-hack.patch @@ -0,0 +1,99 @@ +diff -up mesa-20140305/src/gallium/drivers/radeonsi/si_descriptors.c.radeonsi mesa-20140305/src/gallium/drivers/radeonsi/si_descriptors.c +--- mesa-20140305/src/gallium/drivers/radeonsi/si_descriptors.c.radeonsi 2014-03-18 04:37:30.009681609 +0000 ++++ mesa-20140305/src/gallium/drivers/radeonsi/si_descriptors.c 2014-03-18 04:37:36.751681788 +0000 +@@ -151,7 +151,7 @@ static void si_update_descriptors(struct + 7 + /* copy */ + (4 + desc->element_dw_size) * util_bitcount(desc->dirty_mask) + /* update */ + 4; /* pointer update */ +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + if (desc->shader_userdata_reg >= R_00B130_SPI_SHADER_USER_DATA_VS_0 && + desc->shader_userdata_reg < R_00B230_SPI_SHADER_USER_DATA_GS_0) + desc->atom.num_dw += 4; /* second pointer update */ +@@ -176,7 +176,7 @@ static void si_emit_shader_pointer(struc + radeon_emit(cs, va); + radeon_emit(cs, va >> 32); + +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + if (desc->shader_userdata_reg >= R_00B130_SPI_SHADER_USER_DATA_VS_0 && + desc->shader_userdata_reg < R_00B230_SPI_SHADER_USER_DATA_GS_0) { + radeon_emit(cs, PKT3(PKT3_SET_SH_REG, 2, 0)); +diff -up mesa-20140305/src/gallium/drivers/radeonsi/si_pipe.c.radeonsi mesa-20140305/src/gallium/drivers/radeonsi/si_pipe.c +--- mesa-20140305/src/gallium/drivers/radeonsi/si_pipe.c.radeonsi 2014-03-05 06:59:46.000000000 +0000 ++++ mesa-20140305/src/gallium/drivers/radeonsi/si_pipe.c 2014-03-18 04:37:10.090681081 +0000 +@@ -269,7 +269,7 @@ static int si_get_param(struct pipe_scre + return 256; + + case PIPE_CAP_GLSL_FEATURE_LEVEL: +- return HAVE_LLVM >= 0x0305 ? 330 : 140; ++ return HAVE_LLVM >= 0x0304 ? 330 : 140; + + case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT: + return 1; +@@ -313,7 +313,7 @@ static int si_get_param(struct pipe_scre + case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: + return 16384; + case PIPE_CAP_MAX_COMBINED_SAMPLERS: +- return HAVE_LLVM >= 0x0305 ? 48 : 32; ++ return HAVE_LLVM >= 0x0304 ? 48 : 32; + + /* Render targets. */ + case PIPE_CAP_MAX_RENDER_TARGETS: +@@ -346,7 +346,7 @@ static int si_get_shader_param(struct pi + case PIPE_SHADER_VERTEX: + break; + case PIPE_SHADER_GEOMETRY: +-#if HAVE_LLVM < 0x0305 ++#if HAVE_LLVM < 0x0304 + return 0; + #endif + break; +diff -up mesa-20140305/src/gallium/drivers/radeonsi/si_state.c.radeonsi mesa-20140305/src/gallium/drivers/radeonsi/si_state.c +--- mesa-20140305/src/gallium/drivers/radeonsi/si_state.c.radeonsi 2014-03-05 06:59:46.000000000 +0000 ++++ mesa-20140305/src/gallium/drivers/radeonsi/si_state.c 2014-03-18 04:37:10.092681081 +0000 +@@ -2307,7 +2307,7 @@ static void *si_create_fs_state(struct p + return si_create_shader_state(ctx, state, PIPE_SHADER_FRAGMENT); + } + +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + + static void *si_create_gs_state(struct pipe_context *ctx, + const struct pipe_shader_state *state) +@@ -2337,7 +2337,7 @@ static void si_bind_vs_shader(struct pip + sctx->vs_shader = sel; + } + +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + + static void si_bind_gs_shader(struct pipe_context *ctx, void *state) + { +@@ -2396,7 +2396,7 @@ static void si_delete_vs_shader(struct p + si_delete_shader_selector(ctx, sel); + } + +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + + static void si_delete_gs_shader(struct pipe_context *ctx, void *state) + { +@@ -2890,7 +2890,7 @@ static void si_bind_vs_sampler_states(st + si_set_sampler_states(sctx, pm4, count, states, + &sctx->samplers[PIPE_SHADER_VERTEX], + R_00B130_SPI_SHADER_USER_DATA_VS_0); +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + si_set_sampler_states(sctx, pm4, count, states, + &sctx->samplers[PIPE_SHADER_VERTEX], + R_00B330_SPI_SHADER_USER_DATA_ES_0); +@@ -3166,7 +3166,7 @@ void si_init_state_functions(struct si_c + sctx->b.b.bind_fs_state = si_bind_ps_shader; + sctx->b.b.delete_vs_state = si_delete_vs_shader; + sctx->b.b.delete_fs_state = si_delete_ps_shader; +-#if HAVE_LLVM >= 0x0305 ++#if HAVE_LLVM >= 0x0304 + sctx->b.b.create_gs_state = si_create_gs_state; + sctx->b.b.bind_gs_state = si_bind_gs_shader; + sctx->b.b.delete_gs_state = si_delete_gs_shader;