From: Vinson Lee Date: Thu, 11 Feb 2016 00:42:19 +0000 (-0800) Subject: llvmpipe: Do not use barriers if not using threads. X-Git-Tag: upstream/17.1.0~12562 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ed4c1d9210b11ce6faea81455c21531904ea45b;p=platform%2Fupstream%2Fmesa.git 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 --- 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);