v3dv: don't signal semaphores/fences from a wait thread
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 10 Mar 2022 15:18:10 +0000 (16:18 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 18 Mar 2022 13:17:58 +0000 (13:17 +0000)
commit3b8ab8a9ce70495b39f3b40188b38fe1c3d93c82
treee8869fcc03d890b68db95ea2d131e2d58c92d229
parent03840bfcd15c9d584a9368a86b783c3794112ff1
v3dv: don't signal semaphores/fences from a wait thread

When we have a wait thread we can't ensure that the last job in the last
command buffer will be the one to signal semaphores because in this case
there is no gurantee that jobs from command buffers in the batch will be
submitted to the GPU in order, as those put in a wait thread will be
submitted later when the event wait operation is completed.

Instead, we need to wait for all outstanding wait threads to complete
and only then we should signal any semaphores or fences.

This also fixes a bug where the wait for events was the last job in
the command buffer. In this case, once the event wait is completed
we have no additional jobs to submit and thus would never try to
signal semaphores or fences.

Reviewed-by: Melissa Wen <mwen@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15342>
src/broadcom/vulkan/v3dv_queue.c