Repository navigation
SweetFramebuffer: sweetfb_nowait through a host-tested state machine + self-check fallback (STARLTE, off by default) - #47
Conversation
… with a self-check that falls back to the sleeping path (STARLTE, off by default) The first sweetfb_nowait (PR 43) took the frame out under fLock, cleared fDirty, looked at its GPU chains outside the lock and put it back. The tick now decides under fLock with hakios.sweetfb_present.h (scion-kernel drivers/display/sweetfb, copied in by profiles/ios-27.copy, host-tested there): a recorded frame is taken by the first tick that finds its chains done, read as one load of the GPU queue's done number (starlte_gpu_user_done, new: the queue's worker stores it as it retires each chain, woken by the job interrupt with sgu_irq=1), otherwise it stays recorded and the tick does not sleep; a newer swap replaces it. The vsync callback still goes out first on every tick. A frame that waited 4 ticks with nothing on the GPU (impossible unless the logic is wrong) or 30 ticks with the GPU busy is taken by the old sleeping path and counted; the first of the former is logged as SELF-CHECK. The nowait line now gives frames shown done, ticks that left one, frames replaced, and the two fallbacks. Display off/on and the path without the boot-arg are as before. NOT run on a phone.
|
FRANKEL builds: KERNEL OK (fork a81c63f with scion-kernel#365), out/nw2p/kernel sha256 3708a3d5…ddcc. STARLTE: KERNEL OK, sha256 040ae212b01b02a15e8d75e1e512b389b59064c2e0dc1471ca5404db694e170d. |
|
Phone 1 result for this kernel (nw2, sha256 040ae212…; E1 bench line + sweetfb_prof=1 sweetfb_nowait=1; 17 Nov 23:20):
Why. CoreAnimation's swap rate does not change: about 27 swaps/s while swiping, with or without nowait. backboardd paces on its own CADisplayTimer; it never registers our type-5 vsync (see the sweetfb_cav comment in SweetFramebuffer.cpp), so a steady tick gains nothing. The loss comes from replaced frames, 43-64 per 5 s. swap N+1 is held until frame N's chains are done, and it is recorded the instant they are. So N is replaced unless a tick happens to fall in that gap. Stage times on the old path (sp2's sweetfb_trace, 92 swaps):
CA idles about 20 ms per frame. That fits CA starting frame N+1 at the first 60 Hz timer after frame N is done on the GPU. The limit is CPU encode plus GPU time per frame, not the present. Do not enable sweetfb_nowait. Keep these PRs as draft: the state machine, the host test and the self-check are correct, but they give no fps. Close them, or keep the self-check for a later present design. |
sweetfb_nowait=1rewritten on a host-tested state machine, with a self-check that falls back to the old sleeping path. It is STARLTE only and off by default. It has NOT been run on a phone yet (test kernelnw2is with phone 1).fLockwithhakios.sweetfb_present.h. That header lives in scion-kerneldrivers/display/sweetfb/and reaches this tree throughprofiles/ios-27.copy, so this needs the scion-kernel PR (sweetfb_nowait: present state machine codec + host test, copied into the ios-27 tree; PRESENT.md section 6 scion-kernel#365) to build. The tick takes a recorded frame only when one atomic load of the GPU queue's done number shows its chains are done. That number comes from the newstarlte_gpu_user_done(), and the worker stores it as it retires each chain. Otherwise the frame stays recorded, the tick does not sleep, and a newer swap may replace it. The vsync callback still goes out first on every tick.A5XELTE FB nowait: SELF-CHECK:once.nwt1's log, the frames it left for later were in fact shown by a later tick. The stall came after that, and its cause is not identified (details in PRESENT.md section 6).Builds: STARLTE
KERNEL OK(sha256 040ae212…170d); FRANKEL is in the next comment.🤖 Generated with Claude Code