From fe31e7843dce3e757933edfbffe3e634fb78bc66 Mon Sep 17 00:00:00 2001 From: Lars-Ivar Hesselberg Simonsen Date: Mon, 3 Mar 2025 12:19:25 +0100 Subject: [PATCH] panvk: 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: 2ffc05d8d2c ("panvk: Add support for CmdDispatchIndirect") Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/vulkan/csf/panvk_vX_cmd_dispatch.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/panfrost/vulkan/csf/panvk_vX_cmd_dispatch.c b/src/panfrost/vulkan/csf/panvk_vX_cmd_dispatch.c index f27fc026ca5..22880b29d78 100644 --- a/src/panfrost/vulkan/csf/panvk_vX_cmd_dispatch.c +++ b/src/panfrost/vulkan/csf/panvk_vX_cmd_dispatch.c @@ -317,9 +317,17 @@ cmd_dispatch(struct panvk_cmd_buffer *cmdbuf, struct panvk_dispatch_info *info) cs_req_res(b, CS_COMPUTE_RES); if (indirect) { - cs_trace_run_compute_indirect(b, tracing_ctx, - cs_scratch_reg_tuple(b, 0, 4), wg_per_task, - 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_trace_run_compute(b, tracing_ctx, cs_scratch_reg_tuple(b, 0, 4), + wg_per_task, task_axis, false, + cs_shader_res_sel(0, 0, 0, 0)); } else { unsigned task_axis = MALI_TASK_AXIS_X; unsigned task_increment = 0;