zink: add semaphore handling for sparse binds
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 10 Jun 2022 19:29:11 +0000 (15:29 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 16 Jun 2022 02:01:53 +0000 (02:01 +0000)
commitd1456a6b0ad0dee9936caa52c9fd915c4bfaa61b
treea0464633724da2303f0f0b8da6e23bef658a99a2
parent285a5144cc17d26a33719061ec76eab3363376ef
zink: add semaphore handling for sparse binds

this is a little tricky since it's possible to need a truly unreasonable
number of sparse binds in one go, so the current implementation will
daisy-chain through the sparse submits such that:
* sparse bind A creates signal semaphore X
* sparse bind B waits on X, creates signal semaphore Y
* sparse bind C waits on Y, creates signal semaphore Z

thus, any number of sparse binds will produce exactly one semaphore
that can be waited on by the following submit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17066>
src/gallium/drivers/zink/zink_bo.c
src/gallium/drivers/zink/zink_bo.h
src/gallium/drivers/zink/zink_context.c