vkr: support asynchronous roundtrip and ringwait
This MR:
- drops
render_context_op_submit_cmd_reply
which was to ensure fence signal order in vtest before multiple timeline support - supports asynchronous roundtrip waiting
- implement
vkSubmitVirtqueueSeqno100000MESA
: update vq seqno tracked by the ring - implement
vkWaitVirtqueueSeqno100000MESA
: ring wait for vq - re-use
vkr_ring
's existing mutex/cond for ring thread control- upon write ring extra (write the vq roundtrip seqno), with ring mutex locked, update seqno and signal ring cond. The ring cond can be either of the below cases:
- ring is not waiting on the cond thus no-op
- ring is waiting in idle status, then wakes up earlier (optimal for perf)
- ring is waiting for roundtrip, then gets signaled and checks seqno again
- upon stopping ring, the same ring cond will be signaled as before. The ring cond can be either of the below cases:
- ring is not waiting on the cond thus no-op
- ring is waiting in idle status, no behavior change as before
- ring is waiting for roundtrip, then gets signaled and checks
ring->started
- upon write ring extra (write the vq roundtrip seqno), with ring mutex locked, update seqno and signal ring cond. The ring cond can be either of the below cases:
- trace
vkr_ring_wait_virtqueue_seqno
idle waiting
- implement
- supports asynchronous ring wait
- implement
vkWaitRingSeqno100000MESA
: vq wait for ring - ctx tracks the ring and the ring seqno to be waited on, and unset the ring after waiting is done
- if ring hasn't reached target ring head position (the ring seqno), ctx does idle waiting
- upon ring thread stores the new ring head position, the new ctx callback checks the ring and ring head against the tracked seqno, and signals the above idle waiting if seqno is reached.
- trace
vkr_context_wait_ring_seqno
idle waiting
- implement
- advertise
asyncRoundtrip
feature
Related MRs:
Edited by Yiwei Zhang