Module: Mesa
Branch: staging/20.2
Commit: 556d6b099ea0ccc1c5e10d288049248fe1e4e163
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=556d6b099ea0ccc1c5e10d288049248fe1e4e163

Author: Olsak, Marek <[email protected]>
Date:   Wed Sep 30 12:19:05 2020 -0400

radeonsi: Fix dead lock with aux_context_lock in si_screen_clear_buffer.

After disable SDMA on Arcturus(gfx9), dead lock with aux_context_lock is
detected since si_screen_clear_buffer is called recursively before
release lock.

The call trace is:
si_clear_render_target->si_compute_clear_render_target->
si_launch_grid_internal->si_launch_grid->si_emit_cache_flush->
si_prim_discard_signal_next_compute_ib_start->u_suballocator_alloc->
si_resource_create->si_buffer_create->si_alloc_resource->
si_screen_clear_buffer->simple_mtx_lock->
si_sdma_clear_buffer->si_pipe_clear_buffer->
si_clear_buffer->si_compute_do_clear_or_copy->
si_launch_grid_internal->si_launch_grid->si_emit_cache_flush->
si_prim_discard_signal_next_compute_ib_start->u_suballocator_alloc->
si_resource_create->si_buffer_create->si_alloc_resource->
si_screen_clear_buffer->simple_mtx_lock

Fixes: 07a49bf5976 "radeonsi: disable SDMA on gfx9"
Signed-off-by: James Zhu <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6941>
(cherry picked from commit 5e8791a0bf00384cbd7e3a7231bddbc48bd550a8)

---

 .pick_status.json                      | 2 +-
 src/gallium/drivers/radeonsi/si_pipe.c | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 5e3a7bf4126..68902006bee 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1210,7 +1210,7 @@
         "description": "radeonsi: Fix dead lock with aux_context_lock in 
si_screen_clear_buffer.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "07a49bf59766b7c40d35608a98bd4a5796dcc2fe"
     },
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c 
b/src/gallium/drivers/radeonsi/si_pipe.c
index 2b351c395e4..6789f27c346 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -588,6 +588,8 @@ static struct pipe_context *si_create_context(struct 
pipe_screen *screen, unsign
       si_initialize_prim_discard_tunables(sscreen, is_aux_context,
                                           
&sctx->prim_discard_vertex_count_threshold,
                                           &sctx->index_ring_size_per_ib);
+   } else {
+      sctx->prim_discard_vertex_count_threshold = UINT_MAX;
    }
 
    /* Initialize SDMA functions. */

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to