Commit Graph

4194 Commits

Author SHA1 Message Date
Geoffrey McRae
4f695b93d6 [idd] helper: coalesce no-GPU notifications 2026-08-17 02:47:06 +10:00
Geoffrey McRae
66b9f18cb6 [idd] helper: scroll refresh rate input 2026-08-17 02:39:15 +10:00
Geoffrey McRae
c6bd370e3e [client] config: reject recursive resize options 2026-08-17 02:22:52 +10:00
Geoffrey McRae
94754051a8 [idd] helper: wait for display mode enumeration 2026-08-17 02:21:53 +10:00
Geoffrey McRae
9d074519b2 [idd] config: retain four-decimal refresh rates 2026-08-17 02:09:58 +10:00
Geoffrey McRae
c0de47b1e1 [idd] wcwrite: gate SIMD stores on SSE2 2026-08-17 02:08:29 +10:00
Geoffrey McRae
26cafbe3df [idd] lgmp: stream staged copies to WC memory 2026-08-17 01:27:38 +10:00
Geoffrey McRae
636e55db0d [client] egl: drop incomplete frames 2026-08-17 01:27:26 +10:00
Geoffrey McRae
86b83f3e23 [idd] lgmp: reject invalid frame layouts 2026-08-17 00:59:27 +10:00
Geoffrey McRae
e08e03bec0 [idd] postprocess: normalize downsample layout 2026-08-17 00:59:20 +10:00
Geoffrey McRae
10c4366594 [client] shutdown: silence expected transport teardown 2026-08-16 22:35:41 +10:00
Geoffrey McRae
056be1242a [client] spice: add fail-fast connection option 2026-08-16 22:35:41 +10:00
Geoffrey McRae
209ac4d749 [client] spice: gate USB reconnect on MAIN health 2026-08-16 22:09:15 +10:00
Geoffrey McRae
d26e73f615 [client] transport: exit after SPICE session loss 2026-08-16 21:56:33 +10:00
Geoffrey McRae
da36a5c4c2 [client] transport: report loss before provider cleanup
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-08-16 21:42:36 +10:00
Geoffrey McRae
eaafc52f10 [lgmp] client: cancel queue waits after session loss 2026-08-16 21:42:36 +10:00
Quantum
4cee75dab5 [common] linux/proctitle: fix off-by-one bug
0884d14bde introduces an off-by-one bug: if
`strlen(title) == totalSize`, then no space will be left for a null terminator.
2026-08-16 19:56:07 +10:00
Quantum
0884d14bde [common] linux/proctitle: zero out entire usable memory block
This avoids additional arguments showing up when their memory hasn't been
touched at all.
2026-08-16 16:03:27 +10:00
Geoffrey McRae
90c898f9c7 [client] lgmp: skip release after session loss
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
Heartbeat expiry does not change the LGMP session ID. Queue operations
can therefore accept ownership releases into stale shared memory after
a guest reboot, where no host remains to advance the acknowledgement
serial.

Skip graceful clipboard and input ownership release when the session is
already invalid. Keep the existing timeout and warning for a live host
that fails to process the release.
2026-08-16 05:03:58 +10:00
Geoffrey McRae
20b2225c69 [client] overlay: limit splash fade to startup
The splash state machine reset its fade whenever a transport handoff
restored the logo. Each replacement source therefore started another
one-second fade when it became ready.

Retain one startup fade allowance and consume it on the first hide.
Later source changes can still show the unavailable-video splash, but
hide it immediately when video returns.
2026-08-16 02:59:23 +10:00
Geoffrey McRae
358171ff8b [client] main: preserve restart after primary video loss
Primary frame and pointer workers can still be unwinding an abandoned
payload when another thread detects that the primary transport has
disconnected. Their fatal paths previously stored SHUTDOWN
unconditionally, allowing a stale renderer or transport failure to
overwrite RESTART and terminate the client instead of activating the
SPICE fallback.

Publish RESTART at the beginning of primary-loss handling, before
transport bookkeeping, and make worker-local fatal paths transition to
SHUTDOWN only while the application is still RUNNING. Global failures
and the case where both primary and fallback sessions are lost remain
terminal.
2026-08-16 02:50:46 +10:00
Geoffrey McRae
3b5bbb8467 [client] tests: cover Caja clipboard MIME handling
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
Teach the X11 fixture about the MATE atom and verify import
preference, source target advertisement, and copied-files delivery.

Cover the same Wayland offer and source behavior. Assert that MATE
reuses the single GNOME-style payload instead of fetching a duplicate
representation.

Exercise the core parser and generator with the MATE copied-files MIME,
including invalid operation handling and byte-identical remote output.
2026-08-15 20:49:40 +10:00
Geoffrey McRae
3e9491dbea [client] wayland: fix MATE clipboard MIME handling
Treat either GNOME or MATE copied-files data as preferred over the URI
list fallback. The previous pair of strcmp conditions could never both
be false, so a MATE offer could not replace an earlier URI list.

GNOME and MATE use the same copied-files representation. Generate that
payload once and serve it under both advertised MIME names instead of
overwriting and leaking the first allocation.
2026-08-15 20:43:56 +10:00
Geoffrey McRae
52d9ab10a0 [client] clipboard: add support for Caja 2026-08-15 20:29:08 +10:00
Geoffrey McRae
946e0f4945 [idd] capture: copy partial linear damage by byte range
Retained native candidates and framebuffer targets are both linear
buffers with the same pitched layout. Publish partial damage using
CopyBufferRegion with byte offsets instead of encoding the ranges as
texture-footprint copies.

Collapse full-width rectangles into one command. Fall back to a full
copy when the partial path would exceed 256 commands, copy at least a
full frame of data, or receive invalid damage coordinates.

This removes the native-only command path introduced by 650636cc that
can fault the D3D12 copy queue after RGB24 benchmarking selects native.
2026-08-15 20:19:54 +10:00
Geoffrey McRae
edeff3cce1 [idd] install: keep captured output in one encoding
nsExec merges stdout and stderr into one pipe and detects its
encoding once. Emit UTF-16LE on both streams so error output cannot
reinterpret progress messages as CJK text.

Disable CRT buffering on both streams so progress is visible while
service and SetupAPI operations are running.
2026-08-15 19:12:14 +10:00
Geoffrey McRae
5d51567fd5 [idd] install: let SetupAPI manage device updates
Remove the separate ConfigMgr disable and enable transaction. It
bypassed device class/co-installers, failed before DiInstallDriverW,
and could add two 30-second waits to every update.

Keep LGIddHelper stopped across both DiInstallDriverW calls and let
SetupAPI own PnP stop/start and report any required restart.
2026-08-15 19:11:48 +10:00
Geoffrey McRae
d23a7a3cf2 [idd] helper: release authority during device removal
Register the retained LGIdd authority handle for service device
notifications. Close the exact handle before granting query-remove.

Use cancellable overlapped control requests so the SCM handler never
waits for driver I/O while Plug and Play is removing the device.

Keep authority publication, host liveness, and child activation under
one synchronized state machine to prevent activation after removal.

Retire device notifications on the service thread and keep polling for
the interface so a manual re-enable recovers without a service restart.
2026-08-15 18:53:33 +10:00
Geoffrey McRae
a1f11bcc3e [idd] install: quiesce devices during driver updates
Stop LGIddHelper before updating either UMDF stack. Disable LGInput
before LGIdd, update both packages while quiesced, then restore the
provider before its dependent and start the service last.

Use in-use replacement for UMDF binaries and prevent the INF from
restarting the Helper during package installation. Report each
SetupAPI restart result and propagate it through NSIS.

Roll back transaction-owned devices, packages, and service state on
fresh-install failure. Preserve dependency order during removal and
select the package actually installed on each devnode.
2026-08-15 18:50:44 +10:00
Geoffrey McRae
fd2357565a [idd] input: purge report reads asynchronously
WDF forbids WdfIoQueuePurgeSynchronously from an I/O callback.
Keep HID deactivation pending while the report queue is purged
asynchronously, then complete it from the queue-state callback.

Reject activation during the transition. Complete any remaining
deactivation request during queue cleanup.
2026-08-15 18:00:23 +10:00
Geoffrey McRae
066d64393d [idd] clipboard: pipeline remote file reads
Add two protocol-sized read-ahead buffers to each active clipboard
file stream. Fetch the next remote block on a worker while the caller
or CopyTo destination consumes the current block.

Serialize stream operations and invalidate queued work on seeks and
failures. Join the worker before releasing the remote dataset lease.
2026-08-15 16:32:59 +10:00
Geoffrey McRae
94d5f3729e [idd] clipboard: batch helper stream delivery
Extend the clipboard target boundary with ordered prefix delivery.
Pass up to four queued LGMP stream records to the Helper ring in one
operation, apply state only to the accepted prefix, and retain the
remaining suffix for exact retries.

The channel holds its write lock across the prefix and emits one pipe
doorbell per stream window instead of one per record.
2026-08-15 16:32:43 +10:00
Geoffrey McRae
5bdfc0fe80 [idd] clipboard: remove stream payload restaging
Keep inbound stream payloads in the bounded stream-target window while
the Helper channel is busy and publish directly from those buffers.
Retain the pending target only for LGMP queue controls. Their credits
remain outstanding across retries.

This removes one full payload copy per client-to-Helper record without
changing delivery order, backpressure, or reset behavior.
2026-08-15 16:17:39 +10:00
Geoffrey McRae
4477ac0de1 [idd] clipboard: optimize write-combined reads
Add a reusable copy path for moving data from write-combined mappings
into normal cacheable memory. Dispatch to MOVNTDQA-based SSE4.1 or AVX2
loads when the processor and OS support them, with a fenced fallback.

Use the optimized path when staging inbound clipboard stream records from
the IVSHMEM mapping.
2026-08-15 16:09:28 +10:00
Geoffrey McRae
9e9bf6b88c [idd] lgmp: use precise clipboard polling
Drive adaptive clipboard stream polling with a high-resolution waitable
timer instead of rounding microsecond delays into coarse wait-function
timeouts.

Preserve the explicit stop and local wake events while avoiding a clock-tick
stall at each file-transfer window.
2026-08-15 16:03:43 +10:00
Geoffrey McRae
6a590e343a [idd] win32: use wait result constants
Use the documented Win32 wait constants throughout the pipe, clipboard,
and input workers instead of local numeric aliases.

Select the WDK NT-status definitions before including Windows headers.
Include wudfwdm.h privately in the affected translation units so UMDF 2
provides NTSTATUS without exposing WDF headers through LGCommon's public
interface to the desktop Helper.
2026-08-15 15:07:38 +10:00
Geoffrey McRae
cecd4b6f48 [client] tests: exercise mandatory LGMP streams
Replace legacy clipboard grant and queued input fixtures with bound SPSC
stream endpoints. Verify stream-only payload delivery, credit recovery,
release completion, and four 256 KiB records for a 1 MiB response.

Keep queue assertions for status, discovery, ownership, and control.
2026-08-15 14:51:24 +10:00
Geoffrey McRae
be4bb19fa4 [clipboard] lgmp: make payload streams mandatory
Carry DATA and FILE_DATA only through the duplex SPSC streams. Keep LGMP
queues for control and status. Remove grants, commits, ACKs, and
queue-payload transport negotiation.

Poll adaptively while ownership or release is active. Preserve FIFO
release and graceful draining. Quarantine payloads crossed by a newer
OFFER or CLEAR, and retire data-plane state on detach.
2026-08-15 14:51:24 +10:00
Geoffrey McRae
12801df353 [input] lgmp: make report streams mandatory
Carry every input activation and report through its client-bound SPSC
stream. Keep the LGMP queue only for status publication and subscriber
discovery, removing transport selection and the queue-report fallback.

Retain graceful endpoint draining when a subscriber disappears and use
bounded adaptive polling while streams are active. The IDD polling setup
remains compatible with the project’s current C++ language mode.
2026-08-15 14:51:24 +10:00
Geoffrey McRae
89b1ced8fc [idd] clipboard: pipeline helper channel
Publish ordered four-record prefixes through the Helper mapping and ring
once per accepted burst. Wake blocked producers when the peer returns
credits while retaining the bounded polling fallback.

Move received payload ownership into manager work items and place remote
file-read data directly into the waiting caller’s bounded output buffer.
This removes avoidable 256 KiB copies without changing record ordering,
timeouts, cancellation, or reset semantics.
2026-08-15 14:51:16 +10:00
Geoffrey McRae
b353b5ef06 [lgmp] core: add adaptive stream polling
Advance LGMP to the stream polling fallback implementation.

The new API combines short spins with bounded exponential backoff and
resets on observed progress. Notification callbacks remain advisory, so
plain shared-memory transports keep making progress without doorbells.
2026-08-15 14:38:32 +10:00
Geoffrey McRae
a2dd4c246d [client] input: publish reports through streams
Select the endpoint bound to this LGMP client and send each complete
input activation through its reliable fixed-slot stream.

Track the transport with every pending and published record so CLAIM,
reports, KEEPALIVE, RESET, and RELEASE cannot cross data planes.

Latch queue fallback for the connection after it is selected, avoiding
cross-generation reordering if a stream appears later. Preserve motion
coalescing and the existing queue retry behavior.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
aea73cd2b3 [idd] input: consume per-client LGMP streams
Create and advertise one reliable input stream for each possible LGMP
client, then bind endpoints to active input subscribers.

Drain endpoints fairly while prioritizing the current owner's lane so
its RELEASE remains the ordering barrier. Reject transport changes
within an activation generation.

Gracefully retire missing or stalled subscribers without reusing an
active reservation. Keep excess clients on the queue and release HID
ownership from the input worker when its stream retires.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
b3e9bc2e7f [common] input: define per-client streams
Extend input status with eight exported client-to-host stream
endpoints, matching the maximum number of LGMP clients.

Publish each endpoint descriptor, client binding, epoch, and lifecycle
flags. Require every input activation to keep its ordered records on a
single transport.

Retain the queue transport as a fallback and bump the input and
KVMFR protocol versions for the expanded status layout.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
d28f576145 [client] clipboard: use LGMP payload streams
Attach the advertised clipboard lanes before claiming ownership, prefer
the stream transport, and activate only the acknowledged client and
epoch binding.

Move representation and file payloads through fixed-slot reservations
while status and lifecycle control remain on the LGMP queue. Retain a
legacy v4 fallback for other hosts.

Hold each host-to-client reservation until the consumer accepts its
record, return credits in order, and drain queued traffic in bounded
bursts before sleeping.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
72522dadb8 [idd] clipboard: carry payloads over streams
Create one reliable four-slot lane in each direction and advertise the
stream data plane for clipboard protocol v4.

Bind both lanes to the accepted owner generation, stage incoming data
within a fixed window, and apply backpressure when Helper delivery is
full.

Drain reliable records before releasing an owner. Force stale or
unresponsive bindings after a bounded deadline while preserving the
existing cancellation and clipboard-clear cleanup.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
10b32cb883 [common] clipboard: define stream transport
Replace the single 1 MiB clipboard slot with a four-record 256 KiB
window while retaining a 1 MiB logical file-read limit.

Advertise transport capabilities and duplex stream descriptors in the
clipboard status. Make each claim select one data plane for its entire
owner generation so control and payload ordering cannot be mixed.

Bump the clipboard, KVMFR, and Helper mapping versions for the new
wire layouts and shared-memory geometry.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
6c412e0307 [idd] lgmp: expose stream allocation
Expose LGMP stream creation through the existing IDD host wrapper so
subsystem transports do not reach through its ownership boundary.

Keep stream lifetime and binding under each transport while the host
continues to own the underlying shared-memory allocator.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
5ddaa98ea9 [common] protocol: define stream descriptors
Add a transport-neutral wire copy of the LGMP stream descriptor for
embedding in KVMFR subsystem status records.

Keep the common protocol independent of LGMP headers and assert the
field offsets and total size at both C and C++ integration points.
2026-08-15 14:38:16 +10:00
Geoffrey McRae
ca5593b139 [lgmp] core: add fixed-slot SPSC streams
Advance LGMP to the new separately versioned stream transport. This
provides fixed-slot, epoch-bound SPSC lanes without changing the
existing broadcast queue ABI.

Use reliable draining for clipboard and input payloads, and retain
transport-neutral notification hooks for a later doorbell backend.
2026-08-15 14:38:06 +10:00