From 3effce4fb062371dd6c08fe57b0c12a20cf7af71 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 1 Jun 2017 19:02:16 +0200 Subject: radeonsi/gfx9: prevent a race when the previous shader's main part is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_state_shaders.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c index 727bf4bee9a..08d647b5a54 100644 --- a/src/gallium/drivers/radeonsi/si_state_shaders.c +++ b/src/gallium/drivers/radeonsi/si_state_shaders.c @@ -1634,9 +1634,11 @@ again: else assert(0); + mtx_lock(&previous_stage_sel->mutex); ok = si_check_missing_main_part(sscreen, previous_stage_sel, compiler_state, &shader1_key); + mtx_unlock(&previous_stage_sel->mutex); } else { ok = si_check_missing_main_part(sscreen, sel, compiler_state, key); -- cgit v1.2.3