fix(videoout): pace the next flip from the vblank a flip was released at #416
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/416"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-02T22:34:38Z.
What
processFlipwaits until the vblank count reacheslastFlipVblank + flipRate + 1, releases the flip, presents it, and then setlastFlipVblankto the vblank count after the host present returned. When the image acquire, the wait for an earlier presentation or the present itself crossed the next vblank, the recorded vblank was one too late, so the next flip's target moved out by one vblank even when that flip was already queued. A frame that was ready in 17 ms was then shown for 33 ms, and a title that advances its logic by a fixed step per presented frame runs in slow motion.A flip takes effect at the vblank it is released at, so
lastFlipVblankis now recorded at release, right after the vblank wait, instead of after the present. Flip events,flipStatusandflipPendingNumare unchanged.This pairs with #417: that change makes a flip complete only once the frame's GPU work has finished, so presents end later and, without this fix, more flips would miss a vblank.
Tested
BUILD_TESTING=ONandctestpass.video_out_flip_tests pacing(needs a GPU and a display, like the file's other presentation modes): submits the first flip of a port at flip rate 2. It is released at vblank 3, and its presentation opens the device and swapchain, so it ends several vblanks later; the test checks thatlastFlipVblankis 3. Three runs each: with this changelastFlipVblankis 3 while the vblank count at completion is 10 or 11; on main it is the count after the present (10 or 11) and the test fails.video_out_flip_tests presentandbacktobackpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)