Commit Graph
114 Commits
Author SHA1 Message Date
donny ba32d48a6a host: fix pre-existing XCB/shm crashes and add an atlas verification tool
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 16s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 19s
build / docs (push) Failing after 2s
build / obs (gcc) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
captureStop never called the capture interface's stop(), so a backend
running its own threads was torn down while those threads were still
using it. The XCB pointer thread also ran before the host had allocated
the pointer buffers.

The verification tool subscribes as a real client and checks the
published multi-display frame for consistency.
2026-07-28 07:21:48 +00:00
donny dfe8edfbc2 Add multi-monitor support via packed atlas frames
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 27s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 28s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 28s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / module (push) Failing after 16s
build / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 17s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / obs (clang) (push) Failing after 18s
build / docs (push) Failing after 7s
build / obs (gcc) (push) Failing after 20s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
Capture every guest display into a single frame and compose it back into
the guest's desktop on the client, so one Looking Glass session can carry
a multi-monitor guest instead of one instance per display.

KVMFR gains a per-frame display layout (version 24). A frame with
displayCount == 0 is a conventional single-display frame and behaves
exactly as before, so existing capture backends are unaffected.

- common: shared display layout and a shelf packer that minimises atlas
  area, plus atlas/desktop coordinate mapping helpers and unit tests
- host: capture interface and host app carry the layout; a layout change
  invalidates the format so clients re-read it
- host/XCB: enumerate RandR monitors and repack the root window into the
  atlas directly in shared memory
- client/EGL: compose the atlas into the presented view as its own pass,
  leaving post processing, HDR, cursor and damage handling unchanged

Also fixes the XCB backend writing a single row per frame instead of the
whole image.
2026-07-28 07:06:32 +00:00
Geoffrey McRae 068362b816 [host] hdr: encode legacy captures as HDR10
Convert FP16 scRGB captures to BT.2020 PQ before storing them in the
10-bit wire format. Preserve linear-light downsampling, publish the real
SDR white level and display metadata, and advance the format version when
those properties change.
2026-07-23 09:44:00 +10:00
Geoffrey McRae cdc8ed96bf [idd] hdr: complete HDR display and cursor metadata
Publish BT.2020 chromaticities in the virtual monitor EDID so
Windows receives a valid HDR colour volume.

Extend cursor messages with their IddCx SDR white level and an
explicit visibility-valid flag. Consumers can then calibrate cursors
without treating colour-transform-only messages as cursor hides.
2026-07-23 09:44:00 +10:00
Geoffrey McRae 845c612d0f [idd/client/obs] hdr: wire up the SdrWhiteLevel from the capture 2026-07-23 09:43:59 +10:00
Geoffrey McRae 69f44a003d [all] refresh copyright 2026-05-31 15:13:57 +10:00
Geoffrey McRae e9b7bdfea1 Revert "[all] refresh copyright"
Corrupted IDD sources due to lack of UTF-8 with BOM support in the
script.
2026-05-31 15:10:44 +10:00
Geoffrey McRae 98602fb95e [all] refresh copyright 2026-05-31 15:03:37 +10:00
Geoffrey McRae a421329d9a [all] general: fix possible memory leaks with realloc usage 2025-03-09 02:56:20 +11:00
Geoffrey McRae f6b7ea11c8 [host] app: fix complation on windows with mingw 2025-03-05 16:34:07 +11:00
Geoffrey McRae 551298ed5b [doc] all: update copyright year 2025-03-05 12:24:38 +11:00
Justin Gatzen 661efd107e [host] app: fix app state race in lgmpTimer thread
While resuming from hibernation lgmpTimer may transition app.state to
APP_STATE_REINIT_LGMP. Sometimes the transition is lost if the app_main
processing loop also changes app.state simultaneously. This seems to
occur frequently with the hibernation use case.

Separate lgmp timer state into its own enum. Move resulting app.state
transitions to the app_main loop so they are serialized.
2025-03-05 10:56:39 +11:00
Geoffrey McRae 90398bc04f [host] app: do not try to use deprecated interfaces automatically 2024-03-11 14:16:12 +11:00
Geoffrey McRae da820769e8 [host] windows: fix crash on failure to init a capture interface 2024-03-09 11:30:35 +11:00
Geoffrey McRae 545e736389 [host] windows: handle graceful shutdown on user switch 2024-03-06 15:02:37 +11:00
Geoffrey McRae bfadf0a427 [host] app: print list of valid capture interfaces 2024-03-04 21:09:39 +11:00
Geoffrey McRae 0b210a280d [all] update the copyright to 2024 2024-02-01 17:16:31 +11:00
Geoffrey McRae 72b25b99bc [host] add new D12 capture interface
Note, this capture interface is not yet feature complete but does seem
to be stable.
2024-01-31 00:29:55 +11:00
Geoffrey McRae e376e6fb53 [host] app: revert unintended change from last commit 2024-01-27 23:19:42 +11:00
Geoffrey McRae 34e8a2255e [host] dxgi: d3d12 now writes direclty into ivshmem
This is still incomplete as d3d12 doesn't have any proper sync with the
captured frame and as such is still not suggested for general usage. This
change though is monumental for this project as it removes a full memory
copy reducing bandwidth consumption enormously.
2024-01-27 22:57:13 +11:00
Geoffrey McRae 5d4c1d348c [all] refactor cpuInfo function names 2023-11-19 01:22:09 +11:00
Geoffrey McRae 929e88b9d3 [all] provide conditional path optimization hints to the compiler 2023-11-12 18:26:08 +11:00
Geoffrey McRae 96b5892c31 [host] app: prevent possible null deref and resource leak 2023-11-12 06:44:20 +11:00
Geoffrey McRae cd6485f2ed [host] downsample: fix resource leak on failure 2023-11-12 05:59:47 +11:00
Geoffrey McRae ba8075a9fd [host] app: fix unchecked return value 2023-11-11 20:50:42 +11:00
Geoffrey McRae d592f13f88 [host] all: don't combine the downsampler rules 2023-11-10 06:28:05 +11:00
Geoffrey McRae 86e8e99107 [all] add initial support for RGB24-bpp support 2023-11-10 06:28:05 +11:00
Geoffrey McRae 30c577beeb [host] all: make the downsample rule matching common 2023-11-10 06:28:05 +11:00
Geoffrey McRae 6c7f3c4197 [host] nvfbc: make the downsampleParser available outside of NvFBC 2023-11-10 06:28:05 +11:00
Geoffrey McRae 578d98fd22 [host] DXGI: initial implementation of RGB24 support
This commit breaks damage tracking and the dx12 backend and is not in
a state where it should be used by the general public.
2023-11-10 06:28:05 +11:00
Geoffrey McRae b41840b010 [host] all: tell the client if HDR PQ is in use or not 2023-10-27 01:11:57 +11:00
Geoffrey McRae ad65561511 [host] app: cleanup local variables during init. 2023-10-21 22:03:22 +11:00
Geoffrey McRae 2e515657dd [all] update/add license headers 2023-10-20 15:36:34 +11:00
Geoffrey McRae f84165ac66 [host] app: report to the client if the frame is actually HDR 2023-04-26 15:48:01 +10:00
Quantum f519904c38 [host] app: clarify that config file not found is not fatal
This prevents users from thinking this is the problem they are facing.
2022-12-08 21:08:07 +11:00
Geoffrey McRae 875242fe15 [host] app: improve throttleFPS logic 2022-11-07 22:56:20 +11:00
Geoffrey McRae 697bbcd6d4 [host] app: correct timer restart on lgmp corruption recovery 2022-11-07 13:36:57 +11:00
Geoffrey McRae ecca5720a9 [host] app: ensure that rand will be random 2022-11-07 13:26:52 +11:00
Geoffrey McRae 8e706636d3 [host] app: don't stop the lgmpTimer on session recovery 2022-11-07 12:20:25 +11:00
matthewjmc 53c843d9dd [common] Update framebuffer metadata + references 2022-05-16 20:01:09 +10:00
Geoffrey McRae 3134ec84de [host] dxgi: add support for downsampling the capture before sending
This is an experimental & incomplete feature for those using
supersampling. Anything > 1200p will be downsampled by 50% before
copying out of the GPU to save on memory bandwidth.

Unfinished! Has issues with damage tracking and currently can not
be configured. Only dx11 has been tested at this point, everything
else will likely have problems/crash.
2022-05-01 19:45:44 +10:00
Geoffrey McRae 8b4551c39c [all] convert KVMFR frame bools to flags in a bitfield
This will allow us to add additional flags in the future while remaining
backwards compatible with the host.
2022-02-10 20:32:38 +11:00
Tudor Brindus 9ddfa585ec [host] cleanup some missing (void) parameters 2022-02-08 16:37:17 +11:00
Tudor Brindus 809e1095bd [host] windows: plumb guest activation request to host 2022-02-08 15:27:27 +11:00
Tudor Brindus fd28d0604e [host/client] kvmfr: request activation based on guest state 2022-02-08 15:27:27 +11:00
Quantum f247d7f0da [host] app: don't read from UUID if none is returned
This allows the Linux host to start.
2022-01-26 23:05:31 +11:00
Geoffrey McRae ccdf7b7c0e [host] app: report the full capture name to the client 2022-01-26 19:32:55 +11:00
Geoffrey McRae fd12d9901a [host] app: dont use pointers when realloc may have changed them
This code was completely broken and corrupts the stack, replace it with
something that is actually safe.
2022-01-09 21:19:17 +11:00
Quantum bf059a6eda [host] app: send CPU socket count information 2022-01-07 21:03:20 +11:00
Quantum 194241c5a3 [common] cpuinfo: add sockets to interface 2022-01-07 21:03:20 +11:00