radeonsi/gfx9: prevent a race when the previous shader's main part is missing
authorMarek Olšák <marek.olsak@amd.com>
Thu, 1 Jun 2017 17:02:16 +0000 (19:02 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jun 2017 16:43:42 +0000 (18:43 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 727bf4bee9afe738172e88da98deccc8f5977d35..08d647b5a54e9eb1a6aa18aaad139019101a540d 100644 (file)
@@ -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);