Skip to content

drm/apple: report the internal panel colour gamut (Display P3 on M4 Pro/Max) in the EDID - #1021

Merged
RyanTheTide merged 4 commits into
integration/aurorafrom
fix/panel-colour-target-dt
Nov 6, 2026
Merged

RyanTheTide merged 4 commits into
integration/aurorafrom
fix/panel-colour-target-dt

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On the J616s the DCP firmware publishes no chromaticities for the internal panel. The EDID that drm/apple builds for it therefore has zero RGB primaries and only a nominal D65 white. GNOME logs "EDID ... contains bogus Color Characteristics" and builds no colour profile, so a P3 wide-gamut panel is handled as an unknown display.

Change

  1. dt-bindings: an optional apple,color-gamut string on the DCP panel node, enum "srgb" or "display-p3". It names the standard colour space the panel is calibrated to by default. Each name maps to published primaries (IEC 61966-2-1, SMPTE EG 432-1), a D65 white and nominal gamma 2.2, so the device tree holds no hand-tuned coordinates. Per-unit factory calibration is applied inside the DCP and is not described or reported.
  2. drm/apple: the panel EDID uses complete, valid firmware chromaticities when present; otherwise the DT target; otherwise today's white-only block (gamma stays 0xff). Unknown or malformed values are ignored with a warning. Shared logic, no per-machine table, no module parameter.
  3. arm64: dts: apple,color-gamut = "display-p3" on the J614s, J616s and J616c panels. Apple's technical specifications list "Wide color (P3)" for both machines:

Interaction with #1016 (merge this after it)

#1016 moves the panel identity into struct dcp_panel_identity and builds the panel EDID for every internal panel, not only on desktop 26.x firmware. This PR keeps the colour target in struct dcp_panel (next to the dimensions), reads apple,color-gamut for every panel node whichever firmware drives it, and passes it to dcp_panel_edid() from dcp_panel_edid_snapshot(). Once #1016 is in, the target therefore applies to every internal panel with no further change.

Merge order: #1016 first, then this PR. #1016 is now merged. integration/aurora (1207cd2) was merged into this branch as fc62523. The only conflict was in the host fixture apple-dcp/desktop.py: I took the dcp_panel_identity stub from integration and added color_target to the fixture's panel struct and NULL as the colour target argument of one dcp_panel_edid() call. On the merged result: KUnit 256 run, 255 passed, 1 skipped (apple_g17_rx_util_min_test, needs CONFIG_UCLAMP_TASK); host suite 86/86 ok.

Until then only the desktop 26.x path (T6041) synthesises a panel EDID, so the property is set only on the M4 Pro/Max laptops. Other internal panels (for example the MacBook Neo, sRGB per https://www.apple.com/macbook-neo/specs/) can get it in a follow-up.

Resulting EDID colour on the J616s: red 0.680/0.320, green 0.265/0.690, blue 0.150/0.060, white 0.3127/0.3290, gamma 2.2 (EDID byte 120).

Testing

  • KUnit (arm64, apple* suites): 253 run, 252 passed, 1 skipped (apple_g17_rx_util_min_test, which needs CONFIG_UCLAMP_TASK), including the new parser_panel_color_target (firmware primaries win; absent, partial or rejected firmware colour falls back to the DT target; no target keeps the white-only block and gamma 0xff) and parser_panel_of_color_target (no property, display-p3, srgb, unknown value and unterminated string).
  • KUnit on this branch merged onto drm/apple: publish an identity EDID for every internal panel #1016: 256 run, 255 passed, 1 skipped.
  • Host suite tools/testing/selftests/drivers/gpu/apple-dcp: 86/86 ok. panel-colorimetry now checks that the DT targets equal the standard sRGB and P3 fixture coordinates, that the target gives the same EDID colour bytes as firmware-published P3/sRGB, that firmware wins, and that every absent or invalid firmware case falls back.
  • make dt_binding_check DT_SCHEMA_FILES=display/apple,dcp.yaml: clean for this change. A hand-edited DTB with "adobe-rgb" or an integer value is rejected by dt-validate.
  • make CHECK_DTBS=y for t6040-j616s, t6040-j614s, t6041-j616c and t6040-j616s-tether: no new warnings (only the existing ANE schema warnings).
  • W=1 build of drivers/gpu/drm/apple: 0 warnings. checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks on all 3 patches.
  • Full arm64 Image, modules and DTBs built with the fleet17 config (0 config differences), release 7.3.0-gapscol1.

Hardware results on the J616s are posted in the PR comments.

🤖 Generated with Claude Code

Internal panels are calibrated by the factory to a standard colour space,
and the display coprocessor applies that calibration itself. On the M4
Pro and M4 Max MacBook Pros the firmware does not publish the panel's
primaries, so the OS cannot learn the gamut from the hardware.

Add an optional apple,color-gamut string to the panel node naming that
target: "srgb" or "display-p3". Each name stands for a published colour
space (primaries, D65 white, nominal gamma 2.2), so the device tree
carries no hand-tuned coordinates and no per-unit calibration. A named
enum is used instead of raw chromaticity cells because the panels are
specified by the colour space they target, the schema can check the
value, and a new panel only needs a known name.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The EDID built for a desktop 26.x internal panel carries only a nominal
D65 white when the firmware does not publish chromaticities, which is
always the case on the J616s. Compositors read the zero primaries as
bogus colour characteristics and build no colour profile, so the P3
panel is treated as an unknown display.

Read the optional apple,color-gamut property of the panel node and map
it to the standard primaries, D65 white and nominal gamma 2.2 of sRGB or
Display P3. When building the panel EDID, complete and valid firmware
chromaticities still win; otherwise the device tree target is used;
without either the EDID keeps the white-only description, so boards
without the property are unchanged. An unknown or malformed value is
ignored with a warning. Per-unit factory calibration is applied by the
DCP and is never reported.

The property is read for every internal panel, whichever firmware drives
it, and kept with the panel dimensions, so the target applies wherever a
panel EDID is synthesised.

Cover the precedence, the fallback for absent, partial and rejected
firmware colour, the unchanged output without a target and the rejected
property values in KUnit and the host colorimetry test.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Apple's technical specifications for the MacBook Pro (14-inch, M4 Pro
or M4 Max, 2024) and the MacBook Pro (16-inch, 2024) list "Wide color
(P3)" for the built-in display:

  https://support.apple.com/en-us/121553
  https://support.apple.com/en-us/121554

Set apple,color-gamut = "display-p3" on the J614s, J616s and J616c
panel nodes so the synthesised EDID reports P3 primaries, a D65 white
and gamma 2.2 instead of a white point alone.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Hardware result on the J616s (MacBook Pro 16" M4 Pro).

Setup: kernel 7.3.0-gapscol1 (this branch, fleet17 config) as a one-shot boot entry, plus a one-shot aura-try Stage 2 whose embedded DTB differs from the live one by a single line, apple,color-gamut = "display-p3" on /dcp@402e00000/panel. The J616s gets its device tree from Stage 2, so the DTS change only reaches the kernel through Stage 2. The live stage2.bin was never changed.

Before (fleet17): eDP-1 EDID primaries all 0.0000, gamma undefined, gnome-shell logs "EDID ... contains bogus Color Characteristics", no colord profile for the panel.

After (gapscol1 + trial Stage 2):

  • edid-decode: Red 0.6796/0.3203, Green 0.2646/0.6904, Blue 0.1503/0.0595, White 0.3125/0.3291, Gamma 2.20 (the white point keeps the existing 10-bit EDID rounding).
  • no "bogus Color Characteristics" line, colord now lists a profile for the Apple Panel.
  • 0 AVCs. The one -p3 line on that boot was AVD failing to find its per-release firmware, because the test kit skipped the AVD firmware step for the throwaway release; it is unrelated to this change.

Then rebooted back to fleet17 and the untouched Stage 2, test kernel removed.

Note for rollout: the property only takes effect once a Stage 2 built with the new DTB ships.

Bring in #1016, which keeps the internal panel identity in struct
dcp_panel_identity and builds the panel EDID for every internal panel.
The colour target needs no change: it is kept with the panel dimensions
and passed to dcp_panel_edid() from dcp_panel_edid_snapshot().

Resolve the host fixture conflict in apple-dcp/desktop.py by taking the
dcp_panel_identity stub from integration/aurora and adding the panel
color_target field and the NULL colour target argument to
dcp_panel_edid().

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
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.

1 participant