Module: Mesa
Branch: master
Commit: 1a2dde8f8697edb7bdb5e9112acc291f19409ea1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a2dde8f8697edb7bdb5e9112acc291f19409ea1

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Sat Jan  9 22:58:40 2021 -0500

radeonsi: add internal blitter_running flag

to skip the indirection in si_decompress_textures

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-pra...@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8653>

---

 src/gallium/drivers/radeonsi/si_blit.c          | 6 +++++-
 src/gallium/drivers/radeonsi/si_compute_blit.c  | 6 ++----
 src/gallium/drivers/radeonsi/si_descriptors.c   | 2 +-
 src/gallium/drivers/radeonsi/si_pipe.h          | 5 +++--
 src/gallium/drivers/radeonsi/si_state.c         | 2 +-
 src/gallium/drivers/radeonsi/si_state_shaders.c | 2 +-
 6 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c 
b/src/gallium/drivers/radeonsi/si_blit.c
index 4af96afd4f7..cec7f7cb14b 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -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. */
diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c 
b/src/gallium/drivers/radeonsi/si_compute_blit.c
index 9e29283a642..ec4b77170e1 100644
--- a/src/gallium/drivers/radeonsi/si_compute_blit.c
+++ b/src/gallium/drivers/radeonsi/si_compute_blit.c
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c 
b/src/gallium/drivers/radeonsi/si_descriptors.c
index fdb0333c3a1..51f35e5963f 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -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. */
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h 
b/src/gallium/drivers/radeonsi/si_pipe.h
index ba77a1ebf5e..80b4d9e0e75 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -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;
diff --git a/src/gallium/drivers/radeonsi/si_state.c 
b/src/gallium/drivers/radeonsi/si_state.c
index 2a8e852a5e6..a42aa0f804b 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -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);
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c 
b/src/gallium/drivers/radeonsi/si_state_shaders.c
index b2c7cf0e49e..7d6e51473d7 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -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;
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to