summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-10-22 17:38:40 +0200
committerNicolai Hähnle <nicolai.haehnle@amd.com>2017-11-09 11:53:19 +0100
commitf0d3a4de75fdb865c058aba8614f0fe6ba5f0969 (patch)
tree282bc069bd4f0a566adaef1cfcc66e0c9cff32ea /src/gallium/drivers/llvmpipe
parent28c95cdb299f56c8224446368fb464b7b1d44a6c (diff)
util: move pipe_barrier into src/util and rename to util_barrier
The #if guard is probably not 100% equivalent to the previous PIPE_OS check, but if anything it should be an over-approximation (are there pthread implementations without barriers?), so people will get either a good implementation or compile errors that are easy to fix. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c9
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast_priv.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 0050655d9e3..9e2780ca1d7 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -32,6 +32,7 @@
#include "util/u_surface.h"
#include "util/u_pack_color.h"
#include "util/u_string.h"
+#include "util/u_thread.h"
#include "os/os_time.h"
@@ -822,7 +823,7 @@ thread_function(void *init_data)
/* Wait for all threads to get here so that threads[1+] don't
* get a null rast->curr_scene pointer.
*/
- pipe_barrier_wait( &rast->barrier );
+ util_barrier_wait( &rast->barrier );
/* do work */
if (debug)
@@ -832,7 +833,7 @@ thread_function(void *init_data)
rast->curr_scene);
/* wait for all threads to finish with this scene */
- pipe_barrier_wait( &rast->barrier );
+ util_barrier_wait( &rast->barrier );
/* XXX: shouldn't be necessary:
*/
@@ -914,7 +915,7 @@ lp_rast_create( unsigned num_threads )
/* for synchronizing rasterization threads */
if (rast->num_threads > 0) {
- pipe_barrier_init( &rast->barrier, rast->num_threads );
+ util_barrier_init( &rast->barrier, rast->num_threads );
}
memset(lp_dummy_tile, 0, sizeof lp_dummy_tile);
@@ -973,7 +974,7 @@ void lp_rast_destroy( struct lp_rasterizer *rast )
/* for synchronizing rasterization threads */
if (rast->num_threads > 0) {
- pipe_barrier_destroy( &rast->barrier );
+ util_barrier_destroy( &rast->barrier );
}
lp_scene_queue_destroy(rast->full_scenes);
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
index 3cc52b8d4fd..fe078d5b869 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h
+++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h
@@ -28,8 +28,8 @@
#ifndef LP_RAST_PRIV_H
#define LP_RAST_PRIV_H
-#include "os/os_thread.h"
#include "util/u_format.h"
+#include "util/u_thread.h"
#include "gallivm/lp_bld_debug.h"
#include "lp_memory.h"
#include "lp_rast.h"
@@ -130,7 +130,7 @@ struct lp_rasterizer
thrd_t threads[LP_MAX_THREADS];
/** For synchronizing the rasterization threads */
- pipe_barrier barrier;
+ util_barrier barrier;
};