radv: Add thread for timeline syncobj submission.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 22 Jun 2020 20:07:46 +0000 (22:07 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Jul 2020 17:36:46 +0000 (17:36 +0000)
commitfb6b38d78007436326cf451a210033a20616f2ce
tree257f6608d2484e4ec49217f1523b9dfcad927654
parentfa97061a8235b64009d7897ecf20cc81258f3403
radv: Add thread for timeline syncobj submission.

For cross-process timelines we have to have a thread to wait
till the requested points become available.

The functions actually dealing with timeline semaphores stubbed out, to
implement in the next patch. As such the thread code shouldn't trigger
yet.

The core idea is that we still use the refcount mechanism that we use with
emulated timelines, though the native timeline syncobj don't participate
in the refcounting. This way we keep the ordering of submission in a queue
as each submission is also blocked by its predecessor.

Where we change behavior is when the number of blockers reaches 0. In the
new code we check if we need to wait for the timeline semaphores to
be available and if so we won't execute the submission immediately but
pass it to the submission thread.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5600>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h