Skip to content

drm/apple: describe an internal panel without a known gamut as Display P3 - #2320

Closed
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
isw/panel-p3-default
Closed

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
isw/panel-p3-default

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2060

This is the first commit of #2087, by @chrisohearn and under his authorship, on its own and on the current integration/aurora. It fixes the zero-primaries EDID without the second commit's EDR peak cap, so the fix can land while the cap is discussed in #2087.

Problem

The EDID synthesised for an internal panel takes its primaries from the firmware or, without a complete set, from the colour target named by the ADT's /product artwork-display-gamut. dcp_adt_gamut() knows P3 and sRGB; any other string leaves no target, and the EDID carries zero red, green and blue primaries with only the D65 white. The K114s (M5 Pro OLED, firmware 27.2) says Rec2020. Compositors that build a conversion matrix from the EDID primaries (Hyprland's colour management, edid preset) get a singular matrix and render black frames.

Change

dcp_panel_color_target(): the space the ADT names, or else Display P3, the space every untagged RGB surface on an internal panel is already tagged with (iomfb_template.c). The EDID and the surface tag then agree. Rec2020 is deliberately not mapped to BT.2020 primaries, since the pixels are shown as P3. A dev_info names the fallback. The choice depends only on the ADT string, so it applies to every internal panel on every SoC.

Testing

  • Author, on a K114s (firmware 27.2), see drm/apple: Display P3 for an internal panel without a known gamut; cap the panel peak firmware 27 EDR may use #2087: log panel ADT: no known colour gamut, EDID primaries default to Display P3; edid-decode red 0.6796/0.3203, green 0.2646/0.6904, blue 0.1503/0.0595, white 0.3125/0.3291; Hyprland 0.57.2 colour management with the edid, dp3 and srgb presets keeps the panel lit with normal colours (black frames before).
  • KUnit: parser_panel_adt_color_target covers a Rec2020 ADT (Display P3 primaries, D65, gamma 2.2) and a known gamut keeping its own space. Compile check on integration/aurora 0abc2f385e + this change: every touched file built for arm64 (gcc, kernel warning flags, -Werror) with no warnings. The full KUnit run is still to do.

Assisted-by: LLM (Claude:Opus 5.5)

…y P3

The EDID built for an internal panel takes its primaries from the
firmware or, without a complete set, from the colour target the ADT's
/product artwork-display-gamut names. A gamut string the driver does
not know leaves no target, and the EDID then carries zero red, green
and blue primaries with only the D65 white.

The K114s (MacBook Pro 14-inch OLED, M5 Pro, firmware 27.2) is such a
panel: its ADT says "Rec2020", with a valid version-1
primary-calibration-matrix. Compositors take the zero primaries at
face value. Hyprland's colour management builds its conversion matrix
from them, the matrix is singular, and every frame comes out black
while the firmware completes each swap.

Every untagged RGB surface on an internal panel is already tagged
P3-D65 (iomfb_template.c: "the panel's own primaries (P3-D65, as its
EDID reports)"). Describe a panel whose ADT names no known space in
that same space, so the EDID and the surface tag agree, and log it.
The Rec2020 string is not mapped to BT.2020 primaries: the firmware is
handed P3-tagged surfaces, so BT.2020 primaries in the EDID would make
compositors encode for a wider space than the one the pixels are
shown in. dcp_panel_edid() keeps its contract (no target, white only)
for its other callers and tests.

KUnit: parser_panel_adt_color_target covers a "Rec2020" ADT (no target
of its own, Display P3 primaries, D65 and gamma 2.2 in the EDID) and a
known gamut keeping its own space.

Not booted: built, and the Apple display KUnit suites pass in QEMU.

Closes: #2060
Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: chrisohearn <137103567+chrisohearn@users.noreply.github.com>
[ryan: taken alone from #2087, onto the current integration/aurora; booted
 on a K114s by the author, see #2087]
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. Commit f40039f carries Assisted-by: LLM and Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. The commit has already been changed from the original (the [ryan: ...] note), so drop those two trailers and keep the author's and your Signed-off-by lines.

The code is right. dcp_panel_color_target() (drivers/gpu/drm/apple/dcp-display-metadata.c:209-212) leaves known gamuts alone and returns Display P3 only when the ADT names none that the driver knows. Firmware chromaticities still take precedence in dcp_panel_edid(), so panels that report their own are unaffected. The fallback matches the P3-D65 tag that internal-panel surfaces already carry, and keeping Rec2020 out of the primaries is the correct reading. The new case in parser_panel_adt_color_target and the switch to the helper in parser_panel_publication cover both branches. One behaviour change goes beyond the PR text: when no adt phram node is found at all (dcp.c:1293-1296, ret != 0), the EDID now also carries P3 primaries instead of white only. That is consistent with the surface tag and fine.

Nit: the dev_info at dcp.c:1294 repeats on every bind. dev_info_once or dev_dbg would be enough.

HW row: the K114s run in #2087 used this code on a 7.3.0-17 base. Before this merges, it needs one boot of this head on the K114s (EDID primaries P3, Hyprland edid preset lit) and a no-change boot on a panel with a known gamut (J616s or M1 Pro: edid-decode primaries identical to the previous kernel's), with 0 AVC, 0 failed units and no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #2798: the same changes with the commit trailers fixed, on the current integration/aurora.

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.

drm/apple: K114s (T6050, fw 27.2) internal panel EDID has zero primaries; compositor colour management renders black

2 participants