Skip to content

Content-driven HDR output and Legion Go 2 display script - #2148

Open
matte-schwartz wants to merge 6 commits into
ValveSoftware:masterfrom
matte-schwartz:matts/go2-workarounds
Open

Content-driven HDR output and Legion Go 2 display script#2148
matte-schwartz wants to merge 6 commits into
ValveSoftware:masterfrom
matte-schwartz:matts/go2-workarounds

Conversation

@matte-schwartz

@matte-schwartz matte-schwartz commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Some HDR panels (e.g. Legion Go 2) bypass sysfs backlight control while running in PQ mode, leaving the Steam brightness slider non-functional for SDR content and non-linear for HDR content. As a workaround, add an opt-in content-driven HDR mode that switches the panel to HDR only while an app is actively submitting HDR content.

This doesn't fix the underlying issue so the slider will still be non-linear for HDR content, but it makes the device more usable for SDR content and the Steam UI until there's proper brightness-control support for internal HDR panels that cannot blend hardware and gamma brightness control together.

@pastaq pastaq left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matte-schwartz
matte-schwartz force-pushed the matts/go2-workarounds branch from 8faaee5 to a1cab34 Compare August 4, 2026 19:43
This uses the current content being displayed to determine whether or
not to engage an HDR colorspace. Any live window with an HDR commit
keeps the output in HDR, with no hysteresis by design, so browsing the
Steam UI over a running HDR game does not bounce the panel through PQ
modesets on focus changes. --hdr-debug-force-output overrides the
content check and forces HDR output unconditionally.
… omit it

Display scripts may now omit any of the HDR luminance fields and pick
them up from the panel's EDID HDR static metadata block instead of
hardcoding values in Lua. Values a script does provide still win field
by field. If neither the script nor the EDID supplies a value, the
BackendConnectorHDRInfo defaults apply rather than the old get_or
defaults, which no in-tree script relies on.
Add VFP timings for the non-VRR frame limiter, and enable content_driven
HDR mode to workaround lack of Steam support for backlight control while
the Go 2's panel is outputting PQ content.

This can be re-assessed when Steam supports internal panels with HDR
that behave less like the Steam Deck OLED when it comes to brightness
adjustment.
sysfs attribute change notifications arrive as EPOLLPRI, which
HandleEvents previously dropped. Add an OnPollPri hook so a waitable can
watch a sysfs file.
…t is in PQ

Some panels ignore hardware backlight control while receiving PQ, which
leaves Steam's brightness slider dead in HDR sessions.

Watch the sysfs backlight and reapply the fraction as a luminance gain
baked into the shaper and 3D LUTs, so direct scanout keeps working. The
muted look of very deep dims is the panel's own PQ near-black behavior
and reproduces under other compositors doing signal-side dimming.

This should be generalized in Steam, but for now we can enable it in
individual panel configurations.
The panel claims AUX backlight control works in HDR mode over DPCD, but
its firmware ignores those writes while the output is in PQ, along with
the VESA luminance control registers it also advertises. Follow the
slider in software instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants