zink: implement threaded context
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 22 Mar 2021 15:01:30 +0000 (11:01 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 1 Apr 2021 00:16:05 +0000 (20:16 -0400)
commitd179c5d28e6ae86dd95d906fff8197e35270dad8
tree03489905f90e5c2e626fb55540627529660c1c1b
parenta442e3ff551dd737607be6d5bb3ca08bea8dc1f5
zink: implement threaded context

this includes:
* async buffer mapping/replacement
* async queue submission
* async (threaded) gallium flush handling

the main churn here is from handling async gallium flushes, which involves
creating multiple gallium fences (zink_tc_fence) for each zink fence (zink_fence).
a tc fence may begin waiting for completion at any time, even before the zink_fence
has had its cmdbuf(s) submitted, so handling this type of desync ends up needing
almost a complete rewrite of the existing queue architecture

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9935>
15 files changed:
src/gallium/drivers/zink/zink_batch.c
src/gallium/drivers/zink/zink_batch.h
src/gallium/drivers/zink/zink_blit.c
src/gallium/drivers/zink/zink_clear.c
src/gallium/drivers/zink/zink_context.c
src/gallium/drivers/zink/zink_context.h
src/gallium/drivers/zink/zink_descriptors.c
src/gallium/drivers/zink/zink_fence.c
src/gallium/drivers/zink/zink_fence.h
src/gallium/drivers/zink/zink_query.c
src/gallium/drivers/zink/zink_resource.c
src/gallium/drivers/zink/zink_resource.h
src/gallium/drivers/zink/zink_screen.c
src/gallium/drivers/zink/zink_screen.h
src/gallium/drivers/zink/zink_surface.c