Commit Graph

3773 Commits

Author SHA1 Message Date
Quantum
a394ce612d [idd] installer: make multiline strings more readable
Some checks are pending
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Waiting to run
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Waiting to run
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Waiting to run
build / module (push) Waiting to run
build / host-linux (push) Waiting to run
build / host-windows-cross (push) Waiting to run
build / host-windows-native (push) Waiting to run
build / idd (push) Waiting to run
build / obs (clang) (push) Waiting to run
build / obs (gcc) (push) Waiting to run
build / docs (push) Waiting to run
2026-07-23 09:59:56 +10:00
Quantum
16dca76228 [host] installer: add new page suggesting IDD usage 2026-07-23 09:59:56 +10:00
Quantum
cc65c44e68 [host] installer: make multiline strings more readable 2026-07-23 09:59:56 +10:00
Quantum
e5fc21a7b6 [host] installer: offer the option of uninstalling IDD if detected 2026-07-23 09:59:56 +10:00
Geoffrey McRae
fe4088797c [github] workflow: fix random clang build errors due to runner issue
Ref: https://github.com/actions/runner-images/issues/14296
2026-07-23 09:44:00 +10:00
Geoffrey McRae
0e113d9d83 [client] wayland: use the locally configured white level for SDR 2026-07-23 09:44:00 +10:00
Geoffrey McRae
34af6e6f8f [idd] hdr: correct virtual monitor capabilities 2026-07-23 09:44:00 +10:00
Geoffrey McRae
9376ac10b6 [client] wayland: separate mastering metadata validation
Validate mastering primaries and luminance independently so one
unsupported component does not discard the other.

Trust content chromaticities when extended target volumes are supported,
and report the exact values and reason when metadata must be omitted.
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
1b0e1cf74b [client] egl: correct CAS processing for HDR
Convert HDR scRGB input to normalized linear Rec.2020 before CAS, then
convert the filtered result back to scRGB. Use the content metadata to
select an appropriate normalization peak while leaving SDR unchanged.

This follows AMD's documented recommendation for applying CAS to HDR
content and prevents HDR highlights from being clamped and dimmed.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
697bbc6601 [client] egl: restore effects for PQ frames
PQ sources excluded every external filter from the post-process chain.
Decode PQ/BT.2020 into FP16 linear scRGB before active effects and pass
the resulting transfer state to the desktop shader.

Keep the raw PQ path when no effect is active. This avoids adding a
conversion pass or per-frame latency to the common case.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
719ffeaa60 [client] wayland: separate PQ and mastering volumes
Describe PQ pixels with the protocol-defined primary luminance range and
keep mastering luminance in the target volume. Track extended target-volume
support and omit unsupported metadata instead of creating an invalid image
description.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
dbc5ca104e [client] wayland: retain coherent HDR state on failure
Keep the reference white associated with the active PQ description until
a replacement is ready. If asynchronous description creation fails, the
renderer now retains the complete previous HDR state instead of combining
new white-level values with stale compositor metadata.
2026-07-23 09:44:00 +10: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
b7e56244c1 [obs] hdr: correct logical and color cursor composition
Keep masked-color XOR operands on the untransformed logical path rather
than applying the color cursor shader. Preserve the white level delivered
with cursor updates instead of replacing it with frame SDR white during
format changes.

This keeps inverse-destination blending intact and ensures HDR cursor
brightness follows QueryHardwareCursor3.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
0b9603d398 [client] egl: compose native PQ output in linear light
Decode PQ/BT.2020 desktop pixels into an FP16 linear scRGB target before
compositing the color cursor, ImGui, damage overlay, and letterboxing.
Encode the damaged result to PQ once at the surface boundary. Keep logical
AND/XOR cursor masks in the encoded domain.

This preserves premultiplied cursor edges, prevents encoded-domain
blending, uses the Wayland output reference white for local overlays, and
keeps guest cursor white and display calibration independent from frame
SDR white. It also corrects HDR-to-SDR absolute luminance scaling, gamut
matrices, black handling, and buffer-age repair for the extra pass.

Suppress overlays when their conversion framebuffer is unavailable rather
than allowing unconverted sRGB draws into an HDR target.

Use named transfer constants for cursor shader state. Convert clipped
surface rectangles explicitly before using the frame-damage merge helper,
which avoids mixing its unsigned type with the EGL surface rectangle type.

Only advertise native PQ when the FP16 composition target is available.
SDR and native scRGB retain their direct single-pass paths.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
672b6c0d8a [client] hdr: serialize surface format transitions
Queue the display-server surface format while the renderer lock still
serializes the matching onFrameFormat update. This prevents the render
thread from presenting a frame in a new HDR encoding before the Wayland
image description transition has been queued.
2026-07-23 09:44:00 +10:00
Quantum
28f18188c4 [idd] helper: use common/array.h instead of custom macros 2026-07-23 09:44:00 +10:00
Quantum
0da56a67bb [host] delete redundant / sizeof(char)
`sizeof(char) == 1` always per standard, so this is redundant.
2026-07-23 09:44:00 +10:00
Quantum
7cb6c9057c [client] clean up manual versions of ARRAY_LENGTH macro 2026-07-23 09:44:00 +10:00
Geoffrey McRae
3dd41f242e [client] egl: fix SPICE video rendering to a HDR surface
If the last state had HDR enabled, the spice video surface was being
rendered as HDR even though the SPICE video content is SDR. This
corrects this.
2026-07-23 09:44:00 +10:00
Quantum
90271b936e [idd] helper: clean up exclusive monitor timer and respect setting 2026-07-23 09:44:00 +10:00
Quantum
cc6a64c4fc [idd] helper: hook up exclusive monitor toggle to registry 2026-07-23 09:44:00 +10:00
Quantum
017c2bfa54 [idd] helper: add UI to toggle exclusive monitor setting 2026-07-23 09:44:00 +10:00
Quantum
db1182da43 [idd] helper: add setting for exclusive monitor (default: yes) 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
Geoffrey McRae
d3e05a7958 [idd] disable HDR and post-processing when in software mode 2026-07-23 09:44:00 +10:00
Geoffrey McRae
cd09c080b8 [obs] hdr: apply the complete HDR cursor transform
Keep transform-only cursor messages independent from visibility and use
the cursor-specific SDR white level reported by IddCx.

Apply the Windows XYZ matrix, scalar, and transfer-domain LUT before
compositing colour and masked-colour cursors into OBS scRGB. Preserve
premultiplied alpha and leave monochrome logical masks unchanged.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
4c7b5b2531 [client] wayland: harden native HDR colour state
Serialize asynchronous image-description state and publish compositor
capabilities safely across the Wayland and render threads.

Use the predefined Windows-scRGB description, query each output image
description for its configured reference white, and reapply HDR when the
surface moves to an output with different colour settings.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
0e14e9c357 [client] egl: make native HDR encoding-safe
Request true floating-point EGL configs for scRGB and expose the native
encodings supported by the selected surface. Fall back to software HDR
mapping when the surface cannot represent the incoming wire format.

Resample PQ in linear light, keep SDR-only effects out of native PQ
chains, and consume the cursor-specific white level without changing
binary monochrome cursor mask operations.
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
a047b7d68a egl: follow active native HDR state
Keep software HDR mapping enabled until the display server activates the
requested image description. Re-evaluate the state while rendering so
asynchronous readiness or failure updates the desktop, cursor, and overlay
together with a full redraw.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
2d4f0dbf00 wayland: make HDR descriptions asynchronous
Publish HDR metadata through a locked request snapshot and wait for
image-description readiness before using it. Commit encoding changes with
matching content, preserve the active description during same-format
metadata replacements, and handle creation failures without protocol
errors.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
c0b0aa0566 [all] fix copyright headers 2026-07-23 09:44:00 +10:00
Geoffrey McRae
74f3b426e1 [idd/client] apply the Windows display color transform
Honor the IddCx 3x4 XYZ matrix and post-transfer LUT in the IDD
conversion pipeline. Carry transform changes to the client so EGL applies
the same calibration to hardware cursors, and invalidate the full frame
whenever calibration changes.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
c234866055 [client] wayland: forward HDR mastering metadata
Propagate valid ST 2086 mastering primaries and luminance data, MaxCLL,
and MaxFALL to the Wayland compositor using the protocol's expected
units.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
5dbaf42b7c [idd] hdr: propagate per-frame HDR metadata
Handle DEFAULT, NEW, and UNCHANGED IDDCX HDR10 metadata states and
publish valid mastering metadata through KVMFR. Preserve the metadata
across post-processing without reallocating resources for
metadata-only changes.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
e7e156dc69 [client] egl: correct surface damage reporting
Apply the same sampling margin to swap damage as buffer-age repair and
clip reported rectangles to the EGL surface. This ensures compositors
update every pixel affected by scaling or filtering.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
09acb0153b [client] main: validate damage metadata 2026-07-23 09:44:00 +10:00
Geoffrey McRae
9b02742934 [idd] rgb24: fix packed-texel damage endpoints 2026-07-23 09:44:00 +10:00
Geoffrey McRae
f8b50e741c [idd] accumulate damage from dropped frames 2026-07-23 09:44:00 +10:00
Geoffrey McRae
3e67052cb4 [idd] cancel stale swap chain assignments
Invalidate in-progress swap chain setup when IddCx unassigns the
monitor, and serialize replacement assignments so workers are
never started on abandoned handles.

Also initialize all worker dependencies before starting the processing
thread and treat teardown during SetDevice as normal cancellation.
2026-07-23 09:44:00 +10:00
Geoffrey McRae
d316bcdd22 [idd] helper: fix dependency cycle issue on windows 10 2026-07-23 09:44:00 +10:00
Geoffrey McRae
7707decc57 [idd] debug: add additional logging 2026-07-23 09:44:00 +10:00
Geoffrey McRae
6f2a81edf8 [idd] ensure the only active monitor is the IDD 2026-07-23 09:44:00 +10:00
Quantum
58e0cf340d [idd] helper: implement deferred mode save and revert 2026-07-23 09:44:00 +10:00
Quantum
df861e6a15 [idd] helper: add buttons for deferred mode save and revert 2026-07-23 09:44:00 +10:00
Quantum
a23614d371 [idd] helper: rearrange UI in preparation for deferred saves 2026-07-23 09:44:00 +10:00
Geoffrey McRae
9e4de870fc [client] egl: fix messy white level default definition 2026-07-23 09:44:00 +10:00