Commit Graph

173 Commits

Author SHA1 Message Date
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
983cf588e3 [idd] scheduler: skip expired publication slots
Advance past cadence deadlines whose publication targets have already
expired after a completed periodic frame.

Use the same slack, work, and safety lead as target selection so the next
publisher wait cannot immediately expire again.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
f65ecdaf5d [idd] capture: recover final desktop updates
Request one static-desktop re-encode and inspect repeated presentation
numbers for its empty dirty-rectangle marker.

Prepare every marker in a free candidate without superseding retained
damage, so the last desktop update survives a late copy failure.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
909271bfe1 [idd] scheduler: preserve concurrent force requests
Replace the shared force and republish booleans with request tickets.
A completed publication now acknowledges only requests captured when it
began, so a concurrent immediate or cadence-break request survives.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
f6c72b0bc5 [idd] capture: replay only completed frames
Track the newest submitted and completed frame independently. Only
retain or replay a frame after its copy callback succeeds.

Keep the prior completed frame when a newer copy fails, and compare
publication sequences so out-of-order callbacks cannot move backward.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
160c5fd1fa [idd] scheduler: fold late forces into cadence
Treat a forced publication as periodic once the normal pre-deadline
send point is due. This prevents an immediate forced copy from being
followed by another copy for the same cadence slot.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
babfe9b1e2 [idd] d3d12: harvest completed command slots
Check a busy slot fence before waiting for its thread-pool callback.
This lets the caller complete finished GPU work inline and avoids a
scheduler delay before the allocator and command list can be reused.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
6bb5c039cd [idd] capture: keep preparing during publication
Do not freeze the spare retained candidate while a frame is copied to
IVSHMEM. Allow newer source frames to replace that candidate and retain
any frame prepared after the published sequence for the next deadline.

Take the pipeline lock before selecting the publication candidate so its
transport copy is submitted before any newly admitted preparation.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
f04775823d [idd] capture: retire damage before copy submission
Retire candidate damage before submitting its publication copy. A fast
completion callback can otherwise release and reuse the candidate while
the publisher is still reading its fields and damage tail.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
c56b10b194 [idd] scheduler: detect high-rate cadence breaks
Keep the client schedule floor at 2 ms while accepting shorter guest
frame intervals for cadence tracking. This lets sources above 500 Hz
trigger immediate final-frame delivery when their cadence breaks.
2026-08-06 18:02:08 +10:00
Geoffrey McRae
da7d6b4011 [idd] capture: defer interop synchronization
Signal the shared D3D11 source only after a retained candidate and its
command slots have been acquired. Superseded source frames no longer queue
a fence that no Direct3D 12 work will consume.
2026-08-06 18:02:07 +10:00
Geoffrey McRae
0a04dc4964 [idd] d3d12: signal reusable command slots
Signal a per-slot event after callbacks finish and the command slot has
returned to the free state. This removes the one millisecond polling delay
when candidate state becomes visible just before its slot is reusable.
2026-08-06 18:02:07 +10:00
Geoffrey McRae
3e6c9197f1 [idd] capture: never wait on superseded frames
Drop an acquired frame immediately when both retained candidate slots are
unavailable. Waiting for up to 2 ms held the IddCx surface and
backpressured sources whose frame period was shorter than the wait.
2026-08-06 18:02:07 +10:00
Geoffrey McRae
4c1722feac [idd] scheduler: report actual acquired frame rate
Derive the source rate from unique frames observed over the actual log
interval. The old EWMA discarded intervals below 2 ms, capping the
reported rate at 500 Hz and understating high-rate sources.
2026-08-06 18:02:07 +10:00
Geoffrey McRae
49341a240d [idd] scheduler: pipeline timing owner deliveries
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
Allow the timing owner to keep one delivery pending on each independent
owner queue instead of waiting for the client to release every frame.

Count shared fallback deliveries against the same two-frame limit and
match republished frames across all active lanes. This hides the client
release round trip without allowing a third delivery for the owner.
2026-08-06 10:18:14 +10:00
Geoffrey McRae
3add7d066f [idd] logging: remove misleading swapchain noise 2026-08-06 05:58:28 +10:00
Geoffrey McRae
057fb4d40a [idd] swapchain: bind device before pipeline setup 2026-08-06 05:43:29 +10:00
Geoffrey McRae
770bce4ec0 [idd] adapter: defer render selection until initialization
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
2026-08-06 05:04:22 +10:00
Geoffrey McRae
650636ccee [idd] capture: retain frames in linear buffers
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
Store retained frame candidates in the final linear transport layout.
Prepare texture output in local DEFAULT buffers before cadence holding.
Then publish full frames with a single buffer copy.

Keep partial damage on matching pitched layouts and leave effect-owned
buffer copies unchanged. This moves detiling out of the
deadline-critical IVSHMEM or readback transfer.
2026-08-05 22:08:38 +10:00
Geoffrey McRae
ab25601a61 [idd] rgb24: compare stable candidate timings
Ignore allocation alignment when matching retained candidate resources.
D3D12 may resolve automatic alignment requests in GetDesc.
Comparing that value recreated the candidate for every benchmark sample.

Measure native and packed over matching wall-clock intervals.
Use preparation and publication intervals, excluding the cadence hold.
This avoids mixing GPU timestamps with fallback timing. The CPU IVSHMEM
copy is included only on indirect systems.
2026-08-05 21:45:45 +10:00
Geoffrey McRae
f073099950 [idd] capture: retire published pending damage
Track damage received after each retained candidate snapshot. When a
candidate is submitted successfully, replace the global pending set
with its trailing damage instead of requiring the source generation
to remain unchanged.

This lets published full-frame damage retire while preserving newer
partial or full updates.
2026-08-05 20:58:02 +10:00
Geoffrey McRae
ff5b43173a [idd] rgb24: isolate benchmark samples from cadence
Run effect timing samples only when the retained candidate pipeline is idle
and force each completed sample to publish immediately. This prevents work
from superseded candidates from being charged to a surviving sample.

Include the indirect CPU copy to IVSHMEM in the measured copy stage while
preserving the wall-clock fallback when GPU timestamps are unavailable.
2026-08-05 20:48:50 +10:00
Geoffrey McRae
f95c8f0660 [idd] scheduler: pace secondary frame delivery 2026-08-05 17:10:35 +10:00
Geoffrey McRae
c7ed04412e [client/idd/obs] scheduler: isolate timing owner delivery 2026-08-05 15:45:30 +10:00
Geoffrey McRae
0b9b805530 [idd] scheduler: retain frames for publication deadlines
Prepare each acquired content frame into one of two private GPU
candidates so the IddCx frame can be released without copying it to
IVSHMEM immediately.

Wake a high-resolution publisher at the client deadline and send the
newest completed candidate. Preserve accumulated damage across
superseded candidates, include the scheduling hold in end-to-end timing,
and keep transport work on the existing physical copy queue.
2026-08-05 12:38:07 +10:00
Geoffrey McRae
d0fa4a8ddd [idd] scheduler: publish frames after guest cadence breaks
Discard the learned guest arrival period when a frame follows a gap
much larger than expected. Force that frame through and relearn the
arrival rate so sparse updates are not held for a frame that never
arrives.
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
32ced2f24a [idd] publish the latest frame before its deadline 2026-08-04 13:49:07 +10:00
Geoffrey McRae
1176e78a7f [idd] elect the fastest frame timing client 2026-08-04 13:49:07 +10:00
Geoffrey McRae
84d1427cab [idd] make mode filtering rebuilds thread safe 2026-08-04 13:49:07 +10:00
Geoffrey McRae
f0696e079f [idd] filter modes that exceed IVSHMEM capacity 2026-08-04 11:29:18 +10:00
Geoffrey McRae
6109501eed [idd] select linear RGB24 packing automatically
Replace the texture-shaped RGB24 output with a linear raw buffer and
keep its packing, damage translation, and buffer copies inside the
RGB24 effect.

Benchmark full-frame native and packed processing and retain the faster
path for each source format. Preserve logical damage rectangles for
client updates and alternating framebuffer repair.

Return compute outputs to COMMON for COPY queue handoff and refresh
cached framebuffer sizes when switching packed and native layouts.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
fa2769b332 [idd] isolate post-processing by framebuffer slot
Give each in-flight framebuffer a complete post-processing chain and
its own COMPUTE recording slot while retaining one physical queue.

Claim framebuffer ownership before submitting compute work, and use
the frame index for both COMPUTE and COPY recording state. Drain
in-flight work before reconfiguring either chain so COPY never
references replaced effect resources.

Require both chains to contain the same effects, preserve pending
damage, and release ownership on every pre-copy failure path.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
ff4ca7d786 [idd] serialize framebuffer copies on one queue
Replace the rotating D3D12 copy queues with two framebuffer-bound
recording slots on one physical COPY queue. Keep allocator, command
list, query range, callback state, and fence target independent per
slot.

Submit source waits, execution, and signaling on the shared timeline.
Track framebuffer ownership through completion and serialize LGMP
publication around the last successfully published frame.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
843207c628 [idd] coalesce framebuffer copy damage
Combine the previous and current frame damage before recording copy
commands. Remove contained regions, merge beneficial overlaps, and use
one full-frame copy when partial work reaches the full surface size.

This prevents a previous full-frame update from being copied again
alongside the current damage.
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
Geoffrey McRae
c8e4b97c3c [idd] skip copies for static frames
Treat IddCx's single empty dirty rectangle as no image update instead
of promoting it to full damage.

Preserve pending damage and format changes, and fall back to full damage
when legacy move regions are present.
2026-08-03 23:53:33 +10:00
Geoffrey McRae
7533c855c2 [client/host/idd/lgmp] add additional timing metrics 2026-08-03 23:53:33 +10:00
Geoffrey McRae
82ced18015 [idd] driver: initialize messages to zero 2026-08-01 16:29:18 +10:00
Geoffrey McRae
c5459dec5b [idd] driver/helper: dont allow resolutions that wont fit in ram 2026-08-01 16:28:24 +10:00
Geoffrey McRae
98bde6cf36 [idd] edid: ensure the edid mode list is static 2026-08-01 16:03:07 +10:00
Geoffrey McRae
d4b3506e6c [common] lgmp: separate transport configuration
Move LGMP queue tunables into LGMPConfig.h and keep compatibility
aliases in KVMFR.h. Promote color-transform, SDR white-level, and
damage-limit definitions to transport-neutral common types so non-LGMP
transports do not depend on the KVMFR wire format.
2026-07-29 13:32:58 +10:00
Quantum
6a0526fc1e [idd] driver: report IVSHMEM size
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
2026-07-26 22:17:28 +10:00
Geoffrey McRae
34af6e6f8f [idd] hdr: correct virtual monitor capabilities 2026-07-23 09:44:00 +10:00
Geoffrey McRae
e716435617 [idd] edid: advertise the full PQ luminance range
The virtual display transports HDR pixels rather than emitting light.
Advertise approximately 10,000 nits for both peak and frame-average
luminance, and leave the physical black level unspecified.

This prevents Windows from mapping HDR into an arbitrary virtual
display limit before the frame reaches the real host display.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
21a0fc08fb [idd] hdr: publish only per-content metadata
Monitor-default HDR metadata describes the virtual display rather than
the captured content. Do not expose it through KVMFR or use it to select
downstream processing limits.

Only publish explicit NEW frame metadata and otherwise use the complete
PQ range internally.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
786f52e8ea [idd] fix failure to detect GPU acceleration is available 2026-07-23 09:44:00 +10:00