mirror of
https://github.com/lemonade-sdk/mac_linuxgpu.git
synced 2026-11-22 23:57:31 -10:00
PRESENT hands the frame to the output's worker and returns. The worker copies the frame's damage (plus whatever the target buffer missed while off screen) into one of three scanout buffers with SDMA, split in 64-row bands across both SDMA rings when a frame is a MiB or more, and flips with a nonblocking atomic commit. The copy fences sit in the buffer's reservation, so the commit waits for them on the GPU's behalf (the implicit in-fence) and the CPU does not. The flip's out-fence wakes the worker from the flip interrupt; no thread polls. A frame that arrives while one is still waiting replaces it and their damage adds up. Surfaces are reference counted so the worker's hold outlives a RELEASE. Statistics (version 2) report frames received, flipped and replaced, bytes and jobs, the worker's submit time, GPU copy time, and capture-to-flip latency from the vblank timestamp. PRESENT with no rectangle reads the statistics only. test_display_pipeline brings up DM on the CS fixture with two SDMA engines and a vblank thread that raises the HUBP flip interrupt.