Commit Graph

2108 Commits

Author SHA1 Message Date
Geoffrey McRae
05599ffd02 [client] cursor: restore Wayland pointer convergence
Keep the tracked Wayland hardware position sourced only from absolute
wl_pointer events. Relative motion remains unclipped at output edges,
so accumulating it made the client believe the hardware cursor had
reached the guest position and caused the corrective warp to be
skipped.

Keep cursor coordinates in shape-origin form after absolute
realignment. Preserve the logical hotspot when a shape-only update
changes its hotspot, preventing either path from leaving a permanent
offset.
2026-08-06 22:26:14 +10:00
Geoffrey McRae
5ab10614f2 [client] cursor: improve Wayland hotspot alignment
Center the Wayland diagnostic cursor on its actual pointer hotspot and
preserve it while cursor themes are reloaded for output-scale changes.

Round fractional guest positions to the nearest logical pixel instead of
biasing synchronization toward the top-left corner.

Resynchronize the hardware pointer when a cursor shape changes its
hotspot. Only perform the extra synchronization when the hotspot
actually changes, and update the basic-mode projection at the same time.
2026-08-06 22:26:14 +10:00
Geoffrey McRae
e4874ee32d [client] cursor: restore Wayland edge synchronization
Keep guest-to-host pointer synchronization active while an attempted
surface exit is blocked by the edge of a Wayland output. Continue
forwarding relative motion and wait for wl_pointer.leave before marking
the cursor outside the window.

Distinguish whole-surface releases from exits into letterbox space so
the expected asynchronous release callback cannot disable the feedback
loop before the pointer is confined again.

Treat Wayland pointer capability loss as a real leave so an unrelated
inactive callback cannot be mistaken for the intentional release.
2026-08-06 22:26:14 +10:00
Geoffrey McRae
5cc7f06185 [client] cursor: pace composited redraws
Coalesce pointer updates to the nominal output cadence instead of
waking the renderer for every transport packet. Keep request and
presented generations separate so updates racing a render receive a
trailing swap.

Let JIT consume cursor changes on display callbacks to preserve VRR
cadence, and use a deadline worker for non-JIT rendering. Give normal
source frames a short grace period so an on-rate feed absorbs the
cursor update instead of producing an extra swap.

Repaint visibility and cursor-content changes even when movement
redraws are disabled, including the transition that hides the cursor.
2026-08-06 22:26:10 +10:00
Geoffrey McRae
604b3082f3 [client] overlay: coalesce pointer redraws during splash fade
Pointer updates bypassed the paced overlay render and woke the renderer
for every cursor packet. On the default single-buffer EGL surface,
each full fade redraw could expose the desktop before the splash was
blended again.

Coalesce pointer redraws into the existing fade cadence while keeping
the latest cursor state. Immediate cursor redraw resumes when the fade
ends.
2026-08-06 18:17:34 +10:00
Geoffrey McRae
d8604ec144 [client] metrics: hide presentation timing 2026-08-06 18:04:10 +10:00
Geoffrey McRae
ea6e155bbf [client] metrics: correlate Wayland presentation timing 2026-08-06 18:04:10 +10:00
Geoffrey McRae
bdfb1c3ce0 [client] metrics: expose cadence pipeline stages 2026-08-06 18:04:10 +10:00
Geoffrey McRae
0b744d2286 [common] kvmfr: report cadence hold and lead timing 2026-08-06 18:04:10 +10:00
Geoffrey McRae
1b78384da3 [client] wayland: publish stable presentation cadence 2026-08-06 18:04:10 +10:00
Geoffrey McRae
988675e53a [client] x11: recover stalled present cadence
Reseed the synthetic Present target window when compositor MSC advances
outside the queued range. This prevents a long compositor stall from
permanently exhausting JIT cadence callbacks.

Mark the recovery sample as discontinuous so calibration does not treat the
MSC jump or completion burst as renderer skipping.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
a0b7b12ffc [client] tree: restore unrelated working changes
Restore client and test files that were already staged when the OBS
cadence commit was created. Keep that work out of the scheduler series
while leaving its working-tree contents untouched.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
8a04037c9b [obs] scheduler: serialize cadence controls
Track the LGMP serial for each accepted frame-schedule message and wait
for its acknowledgement before sending another. Preserve pending RESET,
IMMEDIATE, and feedback state after definite enqueue failures.

Use bounded retry polling and request one fresh immediate frame after an
ambiguous pointer-queue fault recovers.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
1040683a3a [client] scheduler: serialize cadence controls
Keep one accepted frame-schedule control in flight until LGMP reports
that its serial has been consumed. Retain ambiguous tokens across pointer
queue recovery instead of retransmitting RESET or IMMEDIATE messages.

Back off acknowledgement polling and definite enqueue failures. Use modular
serial comparison so acknowledgement remains correct across rollover.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
903a8efe75 [client] scheduler: release ownership without live cadence
Renew the frame-schedule lease only while the display server is
producing real cadence callbacks. Release ownership after the cadence
stalls, and reacquire with an immediate reset when it resumes.

For non-JIT rendering, treat only a successful presentation as live
cadence.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
3d1064001d [client] scheduler: qualify presentation feedback
Track cadence, interruption, and calibration wake reasons independently
across X11 and Wayland. Feed phase correction back only when a pure
cadence wake renders the exact frame that was queued at that wake.

Propagate EGL swap results through the display-server boundary. Reject
failed presentations and keep pending Wayland HDR descriptions inactive
until the preceding surface commit succeeds.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
515f4ba06f [client/host/idd/obs] scheduler: validate phase feedback
Bump KVMFR to version 28 and attach generation, epoch, and deadline
identities to cadence deliveries and their timing records.

Accept phase corrections only for the exact completed publication. Keep
VM and client clocks independent by exchanging relative phase errors.

Make submission, completion, and work-estimate accounting best effort
so scheduler state cannot delay GPU submission or frame publication.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
92f46f693f [client] lgmp: serialize stale pointer recovery
Clear timed-out pointer subscriptions under pointerLock so control sends
cannot race a cached queue handle becoming NULL.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
05f3b39b43 [client] egl: snapshot DMA frames before release
Copy imported IVSHMEM frames into renderer-owned textures before
acknowledging their LGMP messages. Hold each lease until its copy fence
signals, and protect selected snapshots until rendering completes.

Track independent delivery lanes, drain acknowledgements on the frame
thread, and recover stale queue subscriptions after host timeouts.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
997c690e04 [client] x11: serialize pointer grab state 2026-08-06 18:02:07 +10:00
Geoffrey McRae
023430da31 [client] input: defer pointer exit until release 2026-08-06 18:02:07 +10:00
Geoffrey McRae
142dc2bcef [client] input: track pointer confinement state 2026-08-06 18:02:07 +10:00
Geoffrey McRae
1baa5a3710 [client] input: gate motion on active capture 2026-08-06 18:02:07 +10:00
Geoffrey McRae
a2a185a95b [client] input: fix rotated cursor scaling 2026-08-06 18:02:07 +10:00
Geoffrey McRae
bbb168aafd [client] input: round warps past viewport edges 2026-08-06 18:02:07 +10:00
Geoffrey McRae
b0b9b395ea [client] tests: cover mouse exit geometry 2026-08-06 13:43:33 +10:00
Geoffrey McRae
385de6a70e [client] tests: cover mouse exit sequencing 2026-08-06 13:40:29 +10:00
Geoffrey McRae
dbf44d9df2 [client] tests: cover Wayland motion ordering 2026-08-06 13:19:27 +10:00
Geoffrey McRae
e9a16ef523 [client] input: add cursor transition diagnostics
Add opt-in sequence-numbered tracing across the core and Wayland
mouse paths.
2026-08-06 13:19:27 +10:00
Geoffrey McRae
13a34b383d [client] egl: retain damage until texture is drawable
Treat a failed desktop texture bind as an incomplete render so full target
restoration remains latched until a frame can actually be drawn.

Carry retired damage into the pending record when the drawable texture does
not contain it, closing the publication gap between texture slots and their
matching damage metadata.
2026-08-05 18:04:26 +10:00
Geoffrey McRae
c7ed04412e [client/idd/obs] scheduler: isolate timing owner delivery 2026-08-05 15:45:30 +10:00
Geoffrey McRae
afb80e0ae4 [client] overlay: render splash fade from monotonic time
Move splash transitions onto the render thread and derive opacity from
elapsed monotonic time. Pace active animation at a display-compatible
minimum of 60 Hz while allowing incoming frames to satisfy that demand.

Reset the splash cleanly across reconnects and latch state changes with
the full-frame restoration decision.
2026-08-05 11:58:32 +10:00
Geoffrey McRae
12f6485e52 [client/obs] scheduler: correct phase feedback
Only report the client queue lead when JIT rendering provides a valid
measurement. Clamp linear phase errors instead of wrapping them into the
opposite direction at half of a refresh period.

Timestamp OBS frames after the shared framebuffer becomes ready.
2026-08-05 11:52:44 +10:00
Geoffrey McRae
2c74f4a0f9 [client] display: use trusted nominal cadence
Always track Wayland surface outputs alongside fractional scaling and use
RandR modes for X11 cadence. Remove render-derived feedback so a
throttled client cannot teach the producer to remain throttled.

Release scheduling after nominal output timing remains unavailable.
2026-08-05 11:50:48 +10:00
Geoffrey McRae
bca59df783 [client] wayland: use nominal refresh for frame demand
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Use the current wl_output mode for the requested producer cadence.
Presentation feedback can follow a slower VRR cadence, feeding that low
update rate back into the IDD. Select the fastest nominal mode when a
window spans multiple outputs.
2026-08-05 10:53:52 +10:00
Geoffrey McRae
d815ef87d5 [client] overlay: restore every splash fade frame
Mark the active fade as requiring a fully restored render target.
This also covers guest-driven renders between animation ticks so they
cannot blend over stale splash content.
2026-08-05 10:53:52 +10:00
Geoffrey McRae
606a06535e [client] overlay: keep the splash fade on fresh buffers
Fully invalidate the render target when the full-screen splash changes.
This restores the desktop before alpha blending and prevents stale fade
states from cycling between swapchain buffers when guest updates are
sparse.
2026-08-05 10:24:57 +10:00
Geoffrey McRae
5be46121a2 [client/idd] preserve frame timing across reconnects 2026-08-04 13:49:07 +10:00
Geoffrey McRae
5ebc208d43 [client/idd] harden demand-driven frame delivery 2026-08-04 13:49:07 +10:00
Geoffrey McRae
97e7f439c2 [client/idd] align frame delivery to presentation 2026-08-04 13:49:07 +10:00
Geoffrey McRae
b23430b9a8 [client] report presentation cadence over LGMP 2026-08-04 13:49:07 +10:00
Geoffrey McRae
5626cfa55b [common] add frame scheduling protocol 2026-08-04 13:49:07 +10:00
Geoffrey McRae
ad53a5e4ee [client] egl: stop aliasing damage tracking layouts
Pass damage rectangle arrays and counts explicitly to the EGL mesh
updater instead of casting DesktopDamage to DamageRects.
2026-08-04 10:54:45 +10:00
Geoffrey McRae
2aaf923e48 [client] preserve NaN timing plot gaps
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client-tests (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
Disable fast-math for the timing graph translation unit because its
bucket arrays use NaN values to break plot lines across empty intervals.

Keep fast-math enabled for remaining client sources while allowing
Clang's strict floating-point diagnostics to remain fatal.
2026-08-04 00:13:14 +10:00
Geoffrey McRae
9025653a24 [client] limit overlay swaps to minimum render rate
Treat every completed swap as satisfying the interactive overlay
refresh requirement. Only force a JIT overlay render after the 60 Hz
deadline, and rearm the timer-based deadline after frame-driven swaps.

This prevents interactive overlays from adding redundant swaps when
incoming frames already keep the client at or above the required rate.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
adf3101a1a [client] egl: fix non-DMA font atlas corruption
Unbind the streamed desktop pixel upload buffer before ImGui processes
CPU-backed font atlas updates.

This prevents atlas pointers from being interpreted as PBO offsets when
DMA is disabled, which caused newly requested glyphs to be missing.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
cb5b9ab292 [client] round overlay damage outward
Expand ImGui window damage to include its border and round both logical
window bounds and framebuffer-scaled bounds outward.

This prevents a one-pixel strip of stale desktop content when an
overlay window is resized at fractional positions or display scales.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
fbe08d00ce [client] expose EGL stages in frame latency
Correlate received frames with the texture update actually consumed by
the renderer and retain damage until its token becomes renderable.

Split client latency into dispatch, import, queue, preparation, setup,
effects, desktop, composition, and swap stages in FRAME LATENCY.
Exclude diagnostic overlay work from composition and preserve client
wait time when producer timing is unavailable.

Publish joined samples through a bounded token queue, avoid sleeping
while producer timing is finalized, and correct Wayland photon units.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
24be0a8869 [host] measure ready time at framebuffer publication
Exclude command queue reset and cleanup from the ready stage, and keep
the wall-clock residual only as the legacy timing fallback.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
aa289fa022 [client/host/idd] correct frame timing attribution
Use calibrated copy-queue timestamps to separate source and effect
waits from the actual framebuffer copy.

Exclude producer readiness waits from client import timing so the
same interval is not counted in both Copy and Import.
2026-08-03 23:53:33 +10:00