Mesa (main): freedreno/a6xx: Reduce the size of the config stateobj allocation.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 13 22:29:46 UTC 2021


Module: Mesa
Branch: main
Commit: b53e8831bbc63ae11bbc32d8c4f04f3b66a17771
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b53e8831bbc63ae11bbc32d8c4f04f3b66a17771

Author: Emma Anholt <emma at anholt.net>
Date:   Fri Jul  2 15:21:28 2021 -0700

freedreno/a6xx: Reduce the size of the config stateobj allocation.

Improves the efficiency of suballocation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11697>

---

 src/gallium/drivers/freedreno/a6xx/fd6_program.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_program.c b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
index 937ff0819c5..9be4c7d3aa4 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_program.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_program.c
@@ -230,9 +230,10 @@ setup_stream_out(struct fd6_program_state *state,
 }
 
 static void
-setup_config_stateobj(struct fd_ringbuffer *ring,
-                      struct fd6_program_state *state)
+setup_config_stateobj(struct fd_context *ctx, struct fd6_program_state *state)
 {
+   struct fd_ringbuffer *ring = fd_ringbuffer_new_object(ctx->pipe, 100 * 4);
+
    OUT_REG(ring, A6XX_HLSQ_INVALIDATE_CMD(.vs_state = true, .hs_state = true,
                                           .ds_state = true, .gs_state = true,
                                           .fs_state = true, .cs_state = true,
@@ -291,6 +292,8 @@ setup_config_stateobj(struct fd_ringbuffer *ring,
 
    OUT_PKT4(ring, REG_A6XX_SP_IBO_COUNT, 1);
    OUT_RING(ring, ir3_shader_nibo(state->fs));
+
+   state->config_stateobj = ring;
 }
 
 static inline uint32_t
@@ -1115,7 +1118,6 @@ fd6_program_create(void *data, struct ir3_shader_variant *bs,
    state->ds = ds;
    state->gs = gs;
    state->fs = fs;
-   state->config_stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
    state->binning_stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
    state->stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
    state->streamout_stateobj = fd_ringbuffer_new_object(ctx->pipe, 0x1000);
@@ -1130,7 +1132,7 @@ fd6_program_create(void *data, struct ir3_shader_variant *bs,
    }
 #endif
 
-   setup_config_stateobj(state->config_stateobj, state);
+   setup_config_stateobj(ctx, state);
    setup_stateobj(state->binning_stateobj, ctx, state, key, true);
    setup_stateobj(state->stateobj, ctx, state, key, false);
    state->interp_stateobj = create_interp_stateobj(ctx, state);



More information about the mesa-commit mailing list