Skip to content

vkr: support asynchronous roundtrip and ringwait

Yiwei Zhang requested to merge zzyiwei/virglrenderer:async-roundtrip into master

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:
        1. ring is not waiting on the cond thus no-op
        2. ring is waiting in idle status, then wakes up earlier (optimal for perf)
        3. 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:
        1. ring is not waiting on the cond thus no-op
        2. ring is waiting in idle status, no behavior change as before
        3. ring is waiting for roundtrip, then gets signaled and checks ring->started
    • trace vkr_ring_wait_virtqueue_seqno idle waiting
  • 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
  • advertise asyncRoundtrip feature

Related MRs:

Edited by Yiwei Zhang

Merge request reports

Loading