Commit Graph
67 Commits
Author SHA1 Message Date
donny 5e2fd18b5c common: align each display's atlas offset for direct scanout
build / module (push) Failing after 18s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 22s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
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 21s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 21s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / host-linux (push) Failing after 21s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 20s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
The alignment argument only rounded up the atlas width, so a display's X
offset was an arbitrary running sum of the widths before it. A consumer
pointing display hardware at one display's region needs that region's base
address 256 byte aligned, and with unaligned offsets some displays would
land on legal addresses and some would not — giving the fast path to only
some monitors, which is worse than uniform slowness because the difference
is hard to diagnose.

Each display's X offset is now aligned as well, and the candidate shelf
widths account for the padding so they still describe shelves that can
hold the set. Both capture backends pass an alignment derived from their
pixel size.

Costs nothing for common resolutions: 3840, 2560 and 1920 are all
multiples of 64. Only unusual widths pad at all — a 2160 wide portrait
display grows the atlas by 16 pixels.

Also documents the consumer contract: the alignment guarantee, frame
lifetime under the two deep queue and one second subscriber timeout, and
that damage is in packed frame coordinates.
2026-07-28 09:09:24 +00:00
donny 9331696db4 xcb: allow a manual monitor layout, and add a live demo
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / host-linux (push) Failing after 19s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
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 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 19s
build / module (push) Failing after 17s
build / host-windows-cross (push) Failing after 20s
build / obs (clang) (push) Failing after 20s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 20s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
Nested and virtual X servers accept xrandr --setmonitor but ignore it, so
there is no way to describe a multi-monitor desktop to Xvfb or Xephyr.
xcb:monitors lets a layout be given directly, which makes any X server
usable as a multi-monitor capture source.

demo-multimon.sh uses it to run the whole pipeline locally: a virtual
desktop with real applications on three monitors, captured by the host,
packed, and composed back by the real client, with the result captured to
a PNG.
2026-07-28 08:52:50 +00:00
donny faaf63bc93 common: make the atlas repack shared and testable
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
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 / 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 19s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 19s
build / host-linux (push) Failing after 18s
build / host-windows-cross (push) Failing after 18s
build / obs (clang) (push) Failing after 19s
build / docs (push) Failing after 3s
build / obs (gcc) (push) Failing after 19s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
Moves the per-display copy out of the XCB backend into common so it can
be unit tested directly and reused by other backends. The test uses a
unique value per source pixel, so a copy landing at the wrong offset
cannot pass by coincidence, and checks truncation against guard bytes.

Also adds a scripted end-to-end test and teaches the verification tool
to report a blank capture source as a skip rather than a failure.
2026-07-28 07:31:13 +00:00
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 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 420eaebb71 [cmake] all: update cmake_minimum_required version to 3.10 2025-03-05 12:27:23 +11:00
Geoffrey McRae 551298ed5b [doc] all: update copyright year 2025-03-05 12:24:38 +11:00
Geoffrey McRae 545e736389 [host] windows: handle graceful shutdown on user switch 2024-03-06 15:02:37 +11:00
Geoffrey McRae 57ac020c8c [host] linux: update to build again 2024-02-27 19:14:58 +11:00
Geoffrey McRae 0b210a280d [all] update the copyright to 2024 2024-02-01 17:16:31 +11:00
Geoffrey McRae 138a0aee53 [all] update cmake minimum version 2023-11-10 06:28:05 +11:00
Geoffrey McRae 7a30736ac4 [host] linux: fix compilation (untested) 2023-11-10 06:28:05 +11:00
Geoffrey McRae 5d7469d23e [host] linux: fix build with new HDR changes (untested) 2023-10-27 01:19:46 +11:00
Geoffrey McRae 2e515657dd [all] update/add license headers 2023-10-20 15:36:34 +11:00
Geoffrey McRae dab5618a6d [host] linux: fix compilation 2023-04-26 16:31:02 +10:00
Quantum a8521b821e [all] cmake: standardize indentation to 2 spaces 2022-05-29 11:16:16 +10:00
Geoffrey McRae 7ed18e24e2 [host] linux/pw: add missing include for min define 2022-05-04 12:28:20 +10:00
Geoffrey McRae 60834a5719 [host] xcb/pipewire/nfbc: use min and correct inverted logic 2022-05-04 12:23:20 +10:00
Geoffrey McRae 81f91caf0e [host] pw: fix build due to frame info structure changes 2022-05-04 10:59:44 +10:00
Geoffrey McRae 3d727a2254 [host] xcb: fix build due to frame info structure changes 2022-05-04 10:58:19 +10:00
vmfortress 6c76d6ada5 [host] xcb: fixed early start of pointer thread by adding xcb_start 2022-03-08 06:12:17 +11:00
Tudor Brindus eeefc15e46 [host] build with -Wstrict-prototypes 2022-02-25 20:38:44 +11:00
Quantum fc96b6691e [host] linux: remove useless libX11 dependency 2022-02-14 15:08:29 +11:00
Quantum 5a94f82f10 [host] linux: remove useless GL dependency 2022-02-14 15:08:29 +11:00
Quantum f01489720f [host] linux: build with PipeWire by default
Since the client already depends on PipeWire by default, there is no
reason why the host shouldn't.
2022-02-12 22:13:31 +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
Quantum d93510e9f2 [host] linux: allow getting system version
Result is something like:

    Debian GNU/Linux 11 (bullseye), kernel: Linux 5.14.0-0.bpo.2-amd64 on x86_64
2022-01-27 05:47:53 +11:00
Geoffrey McRae fdb38a227e [host] app: implement stubs for platform specific guest information 2022-01-05 21:04:57 +11:00
Geoffrey McRae 952ebea2c5 [all] refresh copyright dates 2022-01-05 19:42:46 +11:00
Quantum e7fdf7e77a [host] pipewire: report stream state
This should provide some useful debug information and report stream
errors.
2021-12-28 19:23:14 +11:00
Quantum a21e897bb5 [host] pipewire: use new format for 10-bit colour
I recently added little-endian 10-bit colour formats to PipeWire, which
is what we actually use. The old r210 format is big endian.
2021-12-28 18:50:29 +11:00
vmfortress 8ab130deba xcb: added basic cursor support via xcb_fixes
xcb interface now properly supports cursor integration through
a `pointerThread` similar to the nvfbc implementation.
2021-12-27 11:10:07 +11:00
vmfortress fbf294efd9 xcb: Fixed return value of xcb_deinit
`xcb_deinit` returns `true` to fit the capture interface standard.
2021-12-27 11:10:07 +11:00
vmfortress 2824238b4d xcb: added xcb_stop and xcb_initOptions support
Added basic functions and the necessary variables for the
`.initOptions` and `.stop` items in the capture interface.
2021-12-27 11:10:07 +11:00
Quantum 1e2caf4c9f [host] pipewire: implement basic capture
It works, with the following limitations:
1. user is forced to select the monitor through platform-specific mechanisms
   every time the client starts.
2. cursor is composed onto the screen, and no position can be reported.
2021-08-21 23:01:11 +10:00
Quantum 28eae3bd86 [host] linux: add skeleton pipewire capture backend 2021-08-21 23:01:11 +10:00
Quantum 4ecf749f7e [host] remove all casts around malloc 2021-08-16 16:26:58 +10:00
Quantum cdda89cef7 [host] use correct argument order for calloc 2021-08-16 16:25:59 +10:00
Tudor Brindus 982b4e6625 [host] use variable-relative sizeof where possible 2021-08-16 16:22:55 +10:00
Quantum 4f7ce91e7f [host] capture: switch all asserts to DEBUG_ASSERT 2021-08-14 12:19:07 +10:00
Geoffrey McRae 2856928b57 [host] windows: implement KVMFR_FEATURE_SETCURSORPOS 2021-08-05 22:35:22 +10:00
Quantum 51b9cd4e5a [all] copyright: use unicode copyright sign ©
This is done for consistency with the license strings in appstrings.c.
2021-08-04 21:16:35 +10:00
Quantum 9ab85fd0b8 [host] capture: stop sending DPI information
The client doesn't need DPI information anymore, so there is no point
fetching it.
2021-07-18 10:50:57 +10:00
Quantum 9ce4990793 [host] capture: pass frameIndex to capture backends
This allows capture backends to track damage made to each frame.
2021-07-18 10:41:50 +10:00
Geoffrey McRae e477663a7e [host] app: allow the capture interface to select async or sync mode
While it's correct for DXGI to use a asyncronous waitFrame model, other
capture interfaces such as NvFBC it is not correct. This change allows
the capture interface to specify which is more correct for it and moves
the waitFrame/post into the main thread if async is not desired.
2021-07-12 16:57:22 +10:00
Geoffrey McRae 1effd5fddc [common] debug: add color support to debug messages
People often miss the warnings about invalid arguments in their command
line, this last minute patch attempts to address this by making
warnings, errors, fixme's and fatal errors stand out if stdout is a TTY.
2021-07-07 23:05:46 +10:00