From 6bf9ad261044f739ace54403708e2d1eeaacf1ed Mon Sep 17 00:00:00 2001 From: Lars-Ivar Hesselberg Simonsen Date: Mon, 3 Mar 2025 12:17:33 +0100 Subject: [PATCH] panfrost: Use RUN_COMPUTE over RUN_COMPUTE_INDIRECT RUN_COMPUTE_INDIRECT has been found to cause intermittent hangs, so this change replaces it with RUN_COMPUTE and a set TASK_AXIS_X. While this task axis might be suboptimal, the performance cost is somewhat offset by RUN_COMPUTE not being an emulated command. Fixes: 447075eeeef ("panfrost: Add support for the CSF job frontend") Reviewed-by: Boris Brezillon Part-of: --- src/gallium/drivers/panfrost/pan_csf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_csf.c b/src/gallium/drivers/panfrost/pan_csf.c index 700cc9107b5..7af8c8272da 100644 --- a/src/gallium/drivers/panfrost/pan_csf.c +++ b/src/gallium/drivers/panfrost/pan_csf.c @@ -952,8 +952,16 @@ GENX(csf_launch_grid)(struct panfrost_batch *batch, /* Wait for the stores */ cs_wait_slot(b, 0, false); - cs_run_compute_indirect(b, DIV_ROUND_UP(max_thread_cnt, threads_per_wg), - false, cs_shader_res_sel(0, 0, 0, 0)); + /* Use run_compute with a set task axis instead of run_compute_indirect as + * run_compute_indirect has been found to cause intermittent hangs. This + * is safe, as the task increment will be clamped by the job size along + * the specified axis. + * The chosen task axis is potentially suboptimal, as choosing good + * increment/axis parameters requires knowledge of job dimensions, but + * this is somewhat offset by run_compute being a native instruction. */ + unsigned task_axis = MALI_TASK_AXIS_X; + cs_run_compute(b, DIV_ROUND_UP(max_thread_cnt, threads_per_wg), task_axis, + false, cs_shader_res_sel(0, 0, 0, 0)); } else { /* Set size in workgroups per dimension immediately */ cs_move32_to(b, cs_sr_reg32(b, COMPUTE, JOB_SIZE_X), info->grid[0]);