radeonsi: decrease the size of si_pm4_state::pm4 except for cs_preamble_state

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14122>
This commit is contained in:
Marek Olšák 2021-12-08 19:00:08 -05:00
parent a031cd3c2f
commit 946bd90a09
2 changed files with 12 additions and 2 deletions

View File

@ -54,7 +54,9 @@ struct si_pm4_state {
/* commands for the DE */
uint16_t max_dw;
uint32_t pm4[480];
/* This must be the last field because the array can continue after the structure. */
uint32_t pm4[64];
};
void si_pm4_cmd_add(struct si_pm4_state *state, uint32_t dw);

View File

@ -5383,11 +5383,19 @@ void si_init_cs_preamble_state(struct si_context *sctx, bool uses_reg_shadowing)
struct si_screen *sscreen = sctx->screen;
uint64_t border_color_va = sctx->border_color_buffer->gpu_address;
bool has_clear_state = sscreen->info.has_clear_state;
struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
struct si_cs_preamble {
struct si_pm4_state pm4;
uint32_t more_pm4[150]; /* Add more space because the preamble is large. */
};
struct si_pm4_state *pm4 = (struct si_pm4_state *)CALLOC_STRUCT(si_cs_preamble);
if (!pm4)
return;
/* Add all the space that we allocated. */
pm4->max_dw = sizeof(struct si_cs_preamble) - offsetof(struct si_cs_preamble, pm4.pm4);
if (!uses_reg_shadowing) {
si_pm4_cmd_add(pm4, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));
si_pm4_cmd_add(pm4, CC0_UPDATE_LOAD_ENABLES(1));