Files
reims-vgpu/docs
Anees Iqbal 4d931d2339 🐛 Name a buffer's surface order as it is posted, not committed
Where the host orders command buffers of different queues over the IOSurfaces
they share (SURFACE_ORDER), the bundle names, for each buffer, the buffers of
other queues it runs after, from the surfaces' writer and reader slots. It
read the slots at the commit. A buffer committed behind one enqueued before
it and not yet committed goes on its ring only once that one is, so another
queue's access to the surface could be posted in between: the held buffer
named the access before it, and the access, which found the held buffer not
yet in the slots, named nothing of it. The two ran unordered, where Metal
submits the held buffer after the access, and so runs it after (read from
Metal's enqueue order; no oracle has measured a held buffer's surface order).

The slots are now read at the post, just before the buffer goes on its ring,
where the commit order's names are read too. The device-cache uses
(SURFACE_USE), with the CPU's generation as of the commit, are still named
at the commit. Each buffer named was still posted before the post that names
it, so the waits run from later posts to earlier ones and cannot meet in a
cycle.

What the host observes: a held buffer's SURFACE_ORDER names the accesses of
other queues posted up to its own post. A buffer posted at its commit names
what it named before. test_iosurface_order's new case posts another queue's
write while a reading buffer is held: the held buffer names it.
2026-11-05 21:59:31 -08:00
..