radeonsi: add internal blitter_running flag

to skip the indirection in si_decompress_textures

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>
This commit is contained in:
Marek Olšák 2021-01-09 22:58:40 -05:00 committed by Marge Bot
parent 5fabeb49d8
commit 1a2dde8f86
6 changed files with 13 additions and 10 deletions

View File

@ -80,10 +80,14 @@ void si_blitter_begin(struct si_context *sctx, enum si_blitter_op op)
sctx->dpbb_force_off = true;
si_mark_atom_dirty(sctx, &sctx->atoms.s.dpbb_state);
}
sctx->blitter_running = true;
}
void si_blitter_end(struct si_context *sctx)
{
sctx->blitter_running = false;
if (sctx->screen->dpbb_allowed) {
sctx->dpbb_force_off = false;
si_mark_atom_dirty(sctx, &sctx->atoms.s.dpbb_state);
@ -723,7 +727,7 @@ void si_decompress_textures(struct si_context *sctx, unsigned shader_mask)
{
unsigned compressed_colortex_counter, mask;
if (sctx->blitter->running)
if (sctx->blitter_running)
return;
/* Update the compressed_colortex_mask if necessary. */

View File

@ -79,8 +79,7 @@ void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_info *inf
sctx->render_cond_force_off = true;
/* Skip decompression to prevent infinite recursion. */
if (sctx->blitter)
sctx->blitter->running = true;
sctx->blitter_running = true;
/* Dispatch compute. */
sctx->b.launch_grid(&sctx->b, info);
@ -89,8 +88,7 @@ void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_info *inf
sctx->flags &= ~SI_CONTEXT_STOP_PIPELINE_STATS;
sctx->flags |= SI_CONTEXT_START_PIPELINE_STATS;
sctx->render_cond_force_off = false;
if (sctx->blitter)
sctx->blitter->running = false;
sctx->blitter_running = false;
/* Restore the original compute shader. */
sctx->b.bind_compute_state(&sctx->b, restore_cs);

View File

@ -859,7 +859,7 @@ void si_update_ps_colorbuf0_slot(struct si_context *sctx)
struct pipe_surface *surf = NULL;
/* si_texture_disable_dcc can get us here again. */
if (sctx->blitter->running)
if (sctx->blitter_running)
return;
/* See whether FBFETCH is used and color buffer 0 is set. */

View File

@ -973,8 +973,9 @@ struct si_context {
unsigned wait_mem_number;
uint16_t prefetch_L2_mask;
bool is_noop;
bool has_graphics;
bool blitter_running;
bool is_noop:1;
bool has_graphics:1;
bool gfx_flush_in_progress : 1;
bool gfx_last_ib_is_busy : 1;
bool compute_is_busy : 1;

View File

@ -4518,7 +4518,7 @@ static void si_emit_sample_mask(struct si_context *sctx)
* this for us.
*/
assert(mask == 0xffff || sctx->framebuffer.nr_samples > 1 ||
(mask & 1 && sctx->blitter->running));
(mask & 1 && sctx->blitter_running));
radeon_begin(cs);
radeon_set_context_reg_seq(cs, R_028C38_PA_SC_AA_MASK_X0Y0_X1Y0, 2);

View File

@ -2032,7 +2032,7 @@ static inline void si_shader_selector_key(struct pipe_context *ctx, struct si_sh
key->part.ps.epilog.alpha_func = si_get_alpha_test_func(sctx);
/* ps_uses_fbfetch is true only if the color buffer is bound. */
if (sctx->ps_uses_fbfetch && !sctx->blitter->running) {
if (sctx->ps_uses_fbfetch && !sctx->blitter_running) {
struct pipe_surface *cb0 = sctx->framebuffer.state.cbufs[0];
struct pipe_resource *tex = cb0->texture;