Skip to content
Snippets Groups Projects
Commit 3d37291e authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer Committed by Marge Bot
Browse files

radeonsi: prevent recursion in si_decompress_dcc


This avoids u_blitter recursion:

 #0  util_blitter_set_running_flag
 #1  util_blitter_custom_color
 #2  si_blit_decompress_color
 #3  si_decompress_dcc
 #4  si_texture_disable_dcc
 #5  si_update_ps_colorbuf0_slot
 #6  si_bind_ps_shader
 #7  util_blitter_restore_fragment_states
 #8  util_blitter_custom_color
 #9  si_blit_decompress_color
 #10 si_decompress_dcc
 #11 si_sdma_copy_image
 #12 si_blit

cc: mesa-stable

Reviewed-by: default avatarMarek Olšák <marek.olsak@amd.com>
Part-of: <mesa/mesa!16962>
parent 813e60f1
No related branches found
No related tags found
No related merge requests found
...@@ -1355,9 +1355,11 @@ void si_decompress_dcc(struct si_context *sctx, struct si_texture *tex) ...@@ -1355,9 +1355,11 @@ void si_decompress_dcc(struct si_context *sctx, struct si_texture *tex)
/* If graphics is disabled, we can't decompress DCC, but it shouldn't /* If graphics is disabled, we can't decompress DCC, but it shouldn't
* be compressed either. The caller should simply discard it. * be compressed either. The caller should simply discard it.
*/ */
if (!tex->surface.meta_offset || !sctx->has_graphics) if (!tex->surface.meta_offset || !sctx->has_graphics || sctx->in_dcc_decompress)
return; return;
sctx->in_dcc_decompress = true;
if (sctx->gfx_level == GFX8 || tex->buffer.b.b.nr_storage_samples >= 2) { if (sctx->gfx_level == GFX8 || tex->buffer.b.b.nr_storage_samples >= 2) {
si_blit_decompress_color(sctx, tex, 0, tex->buffer.b.b.last_level, 0, si_blit_decompress_color(sctx, tex, 0, tex->buffer.b.b.last_level, 0,
util_max_layer(&tex->buffer.b.b, 0), true, false); util_max_layer(&tex->buffer.b.b, 0), true, false);
...@@ -1399,6 +1401,7 @@ void si_decompress_dcc(struct si_context *sctx, struct si_texture *tex) ...@@ -1399,6 +1401,7 @@ void si_decompress_dcc(struct si_context *sctx, struct si_texture *tex)
*/ */
sctx->flags |= SI_CONTEXT_WB_L2 | SI_CONTEXT_INV_L2_METADATA; sctx->flags |= SI_CONTEXT_WB_L2 | SI_CONTEXT_INV_L2_METADATA;
} }
sctx->in_dcc_decompress = false;
} }
void si_init_blit_functions(struct si_context *sctx) void si_init_blit_functions(struct si_context *sctx)
......
...@@ -1003,6 +1003,7 @@ struct si_context { ...@@ -1003,6 +1003,7 @@ struct si_context {
bool blitter_running; bool blitter_running;
bool in_update_ps_colorbuf0_slot; bool in_update_ps_colorbuf0_slot;
bool in_dcc_decompress;
bool is_noop:1; bool is_noop:1;
bool has_graphics:1; bool has_graphics:1;
bool gfx_flush_in_progress : 1; bool gfx_flush_in_progress : 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment