panfrost: Dirty track stack sizes
authorAlyssa Rosenzweig <alyssa@collabora.com>
Thu, 20 May 2021 18:13:07 +0000 (14:13 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Jun 2021 19:10:28 +0000 (19:10 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11074>

src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index b6f200c..7f3e1d3 100644 (file)
@@ -319,6 +319,9 @@ panfrost_update_state_3d(struct panfrost_batch *batch)
 
         if (dirty & (PAN_DIRTY_VIEWPORT | PAN_DIRTY_SCISSOR))
                 batch->viewport = panfrost_emit_viewport(batch);
+
+        if (dirty & PAN_DIRTY_TLS_SIZE)
+                panfrost_batch_adjust_stack_size(batch);
 }
 
 static void
@@ -580,9 +583,6 @@ panfrost_direct_draw(struct panfrost_batch *batch,
                                  fs_vary, varyings, pos, psiz, tiler.cpu);
         panfrost_emit_vertex_tiler_jobs(batch, &vertex, &tiler);
 
-        /* Adjust the batch stack size based on the new shader stack sizes. */
-        panfrost_batch_adjust_stack_size(batch);
-
         /* Increment transform feedback offsets */
         panfrost_update_streamout_offsets(ctx);
 }
@@ -729,9 +729,6 @@ panfrost_indirect_draw(struct panfrost_batch *batch,
                                             &batch->indirect_draw_ctx);
 
         panfrost_emit_vertex_tiler_jobs(batch, &vertex, &tiler);
-
-        /* Adjust the batch stack size based on the new shader stack sizes. */
-        panfrost_batch_adjust_stack_size(batch);
 }
 
 static void
@@ -1123,6 +1120,8 @@ panfrost_bind_shader_state(
         struct panfrost_context *ctx = pan_context(pctx);
         struct panfrost_device *dev = pan_device(ctx->base.screen);
         ctx->shader[type] = hwcso;
+
+        ctx->dirty |= PAN_DIRTY_TLS_SIZE;
         ctx->dirty_shader[type] |= PAN_DIRTY_STAGE_RENDERER;
 
         if (!hwcso) return;
index 033b479..9e3f86f 100644 (file)
@@ -68,6 +68,7 @@ enum pan_dirty_3d {
         PAN_DIRTY_VERTEX         = BITFIELD_BIT(2),
         PAN_DIRTY_PARAMS         = BITFIELD_BIT(3),
         PAN_DIRTY_DRAWID         = BITFIELD_BIT(4),
+        PAN_DIRTY_TLS_SIZE       = BITFIELD_BIT(5),
 };
 
 enum pan_dirty_shader {