radeonsi: fix max_dw computation for CS preambles

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19131>
This commit is contained in:
Marek Olšák 2022-10-10 17:18:52 -04:00 committed by Marge Bot
parent c62170fe57
commit a9341eb9da
2 changed files with 2 additions and 2 deletions

View file

@ -75,7 +75,7 @@ si_create_shadowing_ib_preamble(struct si_context *sctx)
struct si_pm4_state *pm4 = (struct si_pm4_state *)CALLOC_STRUCT(si_shadow_preamble);
/* Add all the space that we allocated. */
pm4->max_dw = sizeof(struct si_shadow_preamble) - offsetof(struct si_shadow_preamble, pm4.pm4);
pm4->max_dw = (sizeof(struct si_shadow_preamble) - offsetof(struct si_shadow_preamble, pm4.pm4)) / 4;
if (sctx->screen->dpbb_allowed) {
si_pm4_cmd_add(pm4, PKT3(PKT3_EVENT_WRITE, 0, 0));

View file

@ -5553,7 +5553,7 @@ void si_init_cs_preamble_state(struct si_context *sctx, bool uses_reg_shadowing)
return;
/* Add all the space that we allocated. */
pm4->max_dw = sizeof(struct si_cs_preamble) - offsetof(struct si_cs_preamble, pm4.pm4);
pm4->max_dw = (sizeof(struct si_cs_preamble) - offsetof(struct si_cs_preamble, pm4.pm4)) / 4;
if (!uses_reg_shadowing) {
si_pm4_cmd_add(pm4, PKT3(PKT3_CONTEXT_CONTROL, 1, 0));