Files
reims-vgpu/docs/graphics-kext
Anees Iqbal 302544df87 🐛 Answer a present at the refresh after its show, not its draw
A display pipe transaction completed at the first refresh after the host's
window had finished copying its surface. On an RTX 5080 Laptop GPU at 30
frames a second the copy ended 5.2 ms after the show, which itself came 6.0
ms after the 120 Hz refresh WindowServer composited at, so nearly every
present was answered at the second refresh after its take: present_probe -f
30 saw 2.67 to 2.79 refreshes from commit to presentedTime, one more than on
a 780M host.

The guest now gets each answer at the first refresh after the present is
shown (its writers finished), whether or not the window has drawn it yet, as
a Mac's display completes a flip at the vblank that latches it. A present the
window never draws (a hidden window) is answered at the first refresh too,
not the second.

What an answer frees is the surface of every present before it, never its
own, so the host still holds an answer while a window draw still running may
read the surface of a present before it: each draw now holds the answers of
the presents shown after the latest one when it began, until it finishes. The
window's frames, their pixels and their order are unchanged; only when the
guest hears of them moves. The tests that held the old timing now hold the
new one, and a new one checks that a guest drawing into a surface only once a
later answer freed it never draws into one a window draw reads, with draws
of up to four refreshes.
2026-11-08 07:36:01 -08:00
..