feat: hdr:2 monitor rule value — read HDR mastering data from EDID - #1163
Open
m8l8th814n-eng wants to merge 1 commit into
Open
feat: hdr:2 monitor rule value — read HDR mastering data from EDID#1163m8l8th814n-eng wants to merge 1 commit into
m8l8th814n-eng wants to merge 1 commit into
Conversation
hdr:1 sends an image description with BT2020 primaries and PQ transfer function but no mastering luminance or primaries, so the compositor tone-maps against generic defaults instead of the panel's real limits. hdr:2 keeps the same behavior but additionally parses the output's EDID via libdisplay-info and fills in the mastering display luminance (min/max), max CLL, max FALL, and color primaries from the panel's HDR static metadata block. This matches Hyprland's cm=hdredid mode. Adds a libdisplay-info dependency. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DreamMaoMao
force-pushed
the
main
branch
2 times, most recently
from
July 19, 2026 06:16
4689bc2 to
90c12e8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a new value for the
hdrmonitor rule:hdr:2.hdr:1sends an image description with BT2020 primaries and PQ transfer function, but leaves the mastering luminance, max CLL/FALL, and mastering primaries unset — so tone mapping runs against generic defaults rather than what the panel can actually do.hdr:2does everythinghdr:1does, and additionally parses the output's EDID (via libdisplay-info) to fill the image description with the panel's real HDR static metadata:This is equivalent to Hyprland's
cm = hdredidmode. On panels whose peak luminance differs a lot from the defaults (e.g. laptop OLEDs), this makes highlights and overall brightness track the display's actual capabilities.Implementation
output_fill_edid_hdr_caps()insrc/ext-protocol/hdr.hreads/sys/class/drm/card*-<name>/edidand extracts the metadata with libdisplay-info. If the EDID can't be read or has no HDR metadata block, it silently falls back to plainhdr:1behavior.Monitor.hdr_enablewidened frombooltoint32_t; config clamp changed from0..1to0..2.hdr:1behavior is unchanged.libdisplay-info(added tomeson.buildandnix/default.nix).docs/configuration/monitors.mdupdated.Testing
Running daily on a Samsung ATNA56YX03 OLED (eDP-1, max 617 nits per EDID) with
monitorrule=...,hdr:2.drm_infoshows Colorspace=BT2020_RGB and the HDR_OUTPUT_METADATA blob populated; the debug log prints the parsed EDID values (max 617, avg 400, min 0.0050). Builds clean against wlroots 0.20 + scenefx 0.5.