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 / 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 / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 17s
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
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 / 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 / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 17s
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.
This commit is contained in:
1 parent
4ef6672e64
commit
dfe8edfbc2
18 files changed
+1363
-5
No files matched your search
+30
-1
@@ -120,6 +120,11 @@ struct app
|
||||
uint32_t hdrMaxFrameAverageLightLevel;
|
||||
_Atomic(uint32_t) sdrWhiteLevel;
|
||||
|
||||
// the multi-display layout carried by the last frame, used to detect when
|
||||
// the guest's display arrangement changes and clients must be told
|
||||
uint32_t displayCount;
|
||||
KVMFRDisplay displays[KVMFR_MAX_DISPLAYS];
|
||||
|
||||
CaptureInterface * iface;
|
||||
bool captureStarted;
|
||||
|
||||
@@ -305,11 +310,31 @@ static bool sendFrame(CaptureResult result, bool * restart)
|
||||
app.hdrMaxFrameAverageLightLevel !=
|
||||
frame.hdrMaxFrameAverageLightLevel));
|
||||
|
||||
if (frame.displayCount > KVMFR_MAX_DISPLAYS)
|
||||
{
|
||||
DEBUG_ERROR("Capture backend reported %u displays, the maximum is %d",
|
||||
frame.displayCount, KVMFR_MAX_DISPLAYS);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* A change to the guest's display arrangement changes how the client must
|
||||
* unpack the frame, so it has to invalidate the format like any other
|
||||
* geometry change would. */
|
||||
const bool layoutChanged =
|
||||
app.displayCount != frame.displayCount ||
|
||||
(frame.displayCount && memcmp(app.displays, frame.displays,
|
||||
frame.displayCount * sizeof(*frame.displays)) != 0);
|
||||
|
||||
if (!app.frameValid || app.captureFormatVer != frame.formatVer ||
|
||||
app.hdr != frame.hdr || app.hdrPQ != frame.hdrPQ ||
|
||||
metadataChanged || atomic_load(&app.sdrWhiteLevel) != sdrWhiteLevel)
|
||||
metadataChanged || layoutChanged ||
|
||||
atomic_load(&app.sdrWhiteLevel) != sdrWhiteLevel)
|
||||
++app.formatVer;
|
||||
|
||||
app.displayCount = frame.displayCount;
|
||||
memcpy(app.displays, frame.displays,
|
||||
frame.displayCount * sizeof(*frame.displays));
|
||||
|
||||
app.captureFormatVer = frame.formatVer;
|
||||
app.hdr = frame.hdr;
|
||||
app.hdrPQ = frame.hdrPQ;
|
||||
@@ -420,6 +445,10 @@ static bool sendFrame(CaptureResult result, bool * restart)
|
||||
memcpy(fi->damageRects, frame.damageRects,
|
||||
frame.damageRectsCount * sizeof(FrameDamageRect));
|
||||
|
||||
fi->displayCount = frame.displayCount;
|
||||
memcpy(fi->displays, frame.displays,
|
||||
frame.displayCount * sizeof(*frame.displays));
|
||||
|
||||
app.frameValid = true;
|
||||
|
||||
framebuffer_prepare(app.frameBuffer[app.captureIndex]);
|
||||
|
||||
Reference in new issue
Block a user