radeonsi: don't do BREAK_BATCH for context regs with only 1 context per batch
authorMarek Olšák <marek.olsak@amd.com>
Sun, 11 Jun 2023 01:41:49 +0000 (21:41 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 22 Jun 2023 08:35:55 +0000 (08:35 +0000)
because it has no effect

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

src/gallium/drivers/radeonsi/si_state.c

index 8075ec1..44a5558 100644 (file)
@@ -72,7 +72,8 @@ static void si_emit_cb_render_state(struct si_context *sctx)
    /* GFX9: Flush DFSM when CB_TARGET_MASK changes.
     * I think we don't have to do anything between IBs.
     */
-   if (sctx->screen->dpbb_allowed && sctx->last_cb_target_mask != cb_target_mask) {
+   if (sctx->screen->dpbb_allowed && sctx->last_cb_target_mask != cb_target_mask &&
+       sctx->screen->pbb_context_states_per_bin > 1) {
       sctx->last_cb_target_mask = cb_target_mask;
 
       radeon_begin(cs);
@@ -3550,7 +3551,8 @@ static void si_emit_framebuffer_state(struct si_context *sctx)
    radeon_set_context_reg(R_028208_PA_SC_WINDOW_SCISSOR_BR,
                           S_028208_BR_X(state->width) | S_028208_BR_Y(state->height));
 
-   if (sctx->screen->dpbb_allowed) {
+   if (sctx->screen->dpbb_allowed &&
+       sctx->screen->pbb_context_states_per_bin > 1) {
       radeon_emit(PKT3(PKT3_EVENT_WRITE, 0, 0));
       radeon_emit(EVENT_TYPE(V_028A90_BREAK_BATCH) | EVENT_INDEX(0));
    }