panfrost: mark indirect compute buffer as read

When we dispatch an indirect compute job, the buffer containing
the indirect parameters should be marked as read (since the GPU
will read the parameters from there). Without this there's a
race condition if the CPU later updates the buffer.

Signed-off-by: Eric R. Smith <eric.smith@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28512>
This commit is contained in:
Eric R. Smith 2024-04-01 11:09:28 -03:00 committed by Marge Bot
parent fb1c3f7f5d
commit ad7457fe20

View file

@ -3065,6 +3065,11 @@ panfrost_launch_grid_on_batch(struct pipe_context *pipe,
mali_ptr saved_tls = batch->tls.gpu;
batch->tls.gpu = panfrost_emit_shared_memory(batch, info);
/* if indirect, mark the indirect buffer as being read */
if (info->indirect)
panfrost_batch_read_rsrc(batch, pan_resource(info->indirect), PIPE_SHADER_COMPUTE);
/* launch it */
JOBX(launch_grid)(batch, info);
batch->compute_count++;
batch->tls.gpu = saved_tls;