broadcom/simulator: Fix Indirect CSD jobs for V3D 7.1.6+

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34465>
This commit is contained in:
Maíra Canal
2025-04-10 20:01:05 -03:00
committed by Marge Bot
parent d3ad4e3465
commit 3122df666e

View File

@@ -732,8 +732,17 @@ v3d_rewrite_csd_job_wg_counts_from_indirect(int fd,
submit->cfg[0] = wg_counts[0] << V3D_CSD_CFG012_WG_COUNT_SHIFT;
submit->cfg[1] = wg_counts[1] << V3D_CSD_CFG012_WG_COUNT_SHIFT;
submit->cfg[2] = wg_counts[2] << V3D_CSD_CFG012_WG_COUNT_SHIFT;
submit->cfg[4] = DIV_ROUND_UP(indirect_csd->wg_size, 16) *
(wg_counts[0] * wg_counts[1] * wg_counts[2]) - 1;
uint32_t num_batches = DIV_ROUND_UP(indirect_csd->wg_size, 16) *
(wg_counts[0] * wg_counts[1] * wg_counts[2]);
/* V3D 7.1.6 and later don't subtract 1 from the number of batches */
if (sim_state.ver < 71 || (sim_state.ver == 71 && sim_state.rev < 6)) {
submit->cfg[4] = num_batches - 1;
} else {
submit->cfg[4] = num_batches;
}
assert(submit->cfg[4] != ~0);
for (int i = 0; i < 3; i++) {
/* 0xffffffff indicates that the uniform rewrite is not needed */