From c372e5c69f55bc932fe35c660b9d38fbf401c367 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 21 Mar 2016 14:09:50 -0400 Subject: [PATCH] Fix llvmpipe crashes when not multithreaded --- ...ot-use-barriers-if-not-using-threads.patch | 42 +++++++++++++++++++ mesa.spec | 7 +++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 0001-llvmpipe-Do-not-use-barriers-if-not-using-threads.patch diff --git a/0001-llvmpipe-Do-not-use-barriers-if-not-using-threads.patch b/0001-llvmpipe-Do-not-use-barriers-if-not-using-threads.patch new file mode 100644 index 0000000..e06293f --- /dev/null +++ b/0001-llvmpipe-Do-not-use-barriers-if-not-using-threads.patch @@ -0,0 +1,42 @@ +From 4ed4c1d9210b11ce6faea81455c21531904ea45b Mon Sep 17 00:00:00 2001 +From: Vinson Lee +Date: Wed, 10 Feb 2016 16:42:19 -0800 +Subject: [PATCH] llvmpipe: Do not use barriers if not using threads. + +Cc: mesa-stable@lists.freedesktop.org +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94088 +Signed-off-by: Vinson Lee +Reviewed-by: Roland Scheidegger +--- + src/gallium/drivers/llvmpipe/lp_rast.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c +index d22e507..9e56c96 100644 +--- a/src/gallium/drivers/llvmpipe/lp_rast.c ++++ b/src/gallium/drivers/llvmpipe/lp_rast.c +@@ -910,7 +910,9 @@ lp_rast_create( unsigned num_threads ) + create_rast_threads(rast); + + /* for synchronizing rasterization threads */ +- pipe_barrier_init( &rast->barrier, rast->num_threads ); ++ if (rast->num_threads > 0) { ++ pipe_barrier_init( &rast->barrier, rast->num_threads ); ++ } + + memset(lp_dummy_tile, 0, sizeof lp_dummy_tile); + +@@ -967,7 +969,9 @@ void lp_rast_destroy( struct lp_rasterizer *rast ) + } + + /* for synchronizing rasterization threads */ +- pipe_barrier_destroy( &rast->barrier ); ++ if (rast->num_threads > 0) { ++ pipe_barrier_destroy( &rast->barrier ); ++ } + + lp_scene_queue_destroy(rast->full_scenes); + +-- +2.5.0 + diff --git a/mesa.spec b/mesa.spec index e318178..c5f3547 100644 --- a/mesa.spec +++ b/mesa.spec @@ -57,7 +57,7 @@ Summary: Mesa graphics libraries Name: mesa Version: 11.2.0 -Release: 0.devel.11.%{git}%{?dist} +Release: 0.devel.12.%{git}%{?dist} License: MIT Group: System Environment/Libraries URL: http://www.mesa3d.org @@ -76,6 +76,7 @@ Patch10: mhack.patch Patch15: mesa-9.2-hardware-float.patch Patch20: mesa-10.2-evergreen-big-endian.patch Patch30: mesa-10.3-bigendian-assert.patch +Patch31: 0001-llvmpipe-Do-not-use-barriers-if-not-using-threads.patch # To have sha info in glxinfo BuildRequires: git-core @@ -352,6 +353,7 @@ grep -q ^/ src/gallium/auxiliary/vl/vl_decoder.c && exit 1 %patch15 -p1 -b .hwfloat %patch20 -p1 -b .egbe %patch30 -p1 -b .beassert +%patch31 -p1 -b .threadless %if 0%{with_private_llvm} sed -i 's/llvm-config/mesa-private-llvm-config-%{__isa_bits}/g' configure.ac @@ -691,6 +693,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Mon Mar 21 2016 Adam Jackson 11.2.0-0.devel.12 +- Fix llvmpipe crashes when not multithreaded + * Fri Feb 19 2016 Dave Airlie 11.2.0-0.devel.11 - rebuild against llvm 3.8.0