Skip to content

drm/apple: m4: publish the internal panel's EDID - #3261

Open
themartiano wants to merge 1 commit into
aurora-silicon:mainfrom
themartiano:feat/m4-panel-edid
Open

themartiano wants to merge 1 commit into
aurora-silicon:mainfrom
themartiano:feat/m4-panel-edid

Conversation

@themartiano

@themartiano themartiano commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: The M4 internal panel is the only internal panel without an EDID: its DCP node describes the panel itself, with no panel child, so no identity is allocated, and the M4 get_modes returns before the EDID. A compositor sees a nameless display without primaries. Allocate the identity for an M4 DCP node that has the panel's size and publish the EDID; give the descriptor the sync polarity this firmware leaves out (without it the EDID was refused with -ERANGE).
Tested: J713 (13-inch M4 MacBook Air, firmware 26.6.2) at e4f16a33d7f5, 2026-11-25: PASS. eDP-1 publishes an EDID: manufacturer APP, "Apple Panel", 29x19 cm, Display P3 primaries (red 0.6797,0.3203, green 0.2646,0.6904, blue 0.1504,0.0596, white 0.3125,0.3291); Hyprland 0.57.2 uses it with cm = edid. The kernel (7.3.0-0.next2) was main ba29027e1580 merged with all our M4 display and other branches and #2814, #2797, #2807, #2672, not this branch alone; there get_modes is #2814's (notch-free mode, 2560x1600) with this EDID call. This commit's tree is identical to the one booted (cf096a6adf8b; only the Signed-off-by was added). Regression on that kernel: 0 failed units, no oops, crash or stall, 10/10 deep sleeps without kernel errors (no SELinux on this image). Host: KUnit, new parser_panel_timing_polarity passes (566 run, 564 pass, 1 skip, 1 fail that main has too: apple-dcpaud-no-sio); apple-dcp host suite 95/95; W=1 build.
Rebased onto main 9177b2d474f8 on 2026-12-02; head now 90b27b8a52c8. One conflict in dcp_get_modes() with #2814's notch modes: the panel EDID is published after #2814's mode block, from the panel's full timing, as main does for the other panels (their EDID lists the panel's timings, not the notch-free twins). The J713 kernel in Tested already combined the two this way. Host checks re-run at the new head: W=1 arm64 build of drivers/gpu/drm/apple/, 0 warnings; checkpatch --strict clean; KUnit dcp-fabric, dcp-topology, dcp-display (the suites CI picks for these files) on arm64 QEMU: no failures (one case skips in each of two suites); apple-dcp host suite, no new failures (14 cases fail to compile with this container's newer compiler on main itself, and the same 14 here). The hardware rows above are from before the rebase.

Risk: two-way door · M4 panels on firmware 26.6.2 (J713, J715, J604: the boards whose DCP node has apple,panel-width-mm). Other Macs: the identity is allocated only on the M4 path, by that property, so no other Mac gets a new EDID from it; the iMac and Mac mini have no such property. The polarity is filled in dcp_panel_identity_timing(), shared by every internal panel's EDID, but only where the firmware's timing has none: a panel whose timing states a polarity gets the same bytes as before (code reading, not run on another Mac). On the J604 dcp_panel_read_adt() now also reads the EDR headroom; dcp_panel_edr() stays false without an EDR-capable swap, so no HDR is offered there.
Not yet: a row on a non-M4 Mac for the shared polarity line; this branch alone on main (without #2814's get_modes); a J604 or J715.

Details
Evidence

J713 test run of 2026-11-25 on 7.3.0-0.next2:

panel        connected, modes 2560x1600
panel-edid   published  mfg APP, name "Apple Panel", size 29x19 cm, 1 block, primaries not zeroed, Display P3
panel-edid   chroma     r 0.6797,0.3203  g 0.2646,0.6904  b 0.1504,0.0596  w 0.3125,0.3291
panel-edid   hyprland   preset edid, 290x181 mm
panel-edid   kernel     no warning line

Host, at the old head cf096a6adf8b (same tree): KUnit apple* on arm64 QEMU 566 run, 564 pass, 1 skip, 1 fail (apple-dcpaud-no-sio, fails on main too); apple-dcp host suite 95/95; W=1 build clean; checkpatch --strict only asked for the Signed-off-by (now added).

Every internal panel has an EDID built from its identity, the colour
target the ADT names and the firmware's timing. The M4 backend publishes
none: its DCP node describes the panel itself, with no panel child, so
the identity is never allocated, and its get_modes returns before the
EDID. A compositor sees a nameless display without primaries.

Allocate the identity for an M4 DCP whose node has the panel's size, fill
it at bind as for the other panels, and publish the EDID with the one
mode. The mode itself and the connector's size in millimetres stay as
they were.

The 26.6.2 timing carries no sync polarity, which a detailed timing must
state, so the EDID was refused with -ERANGE (seen on a J713). Give the
descriptor one, as the external firmware-derived EDIDs do; it is never
programmed.

Signed-off-by: Eduardo <git@martiano.me>
@themartiano
themartiano marked this pull request as ready for review December 2, 2026 16:15
@themartiano
themartiano requested review from a team as code owners December 2, 2026 16:15
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 90b27b8a: not ready yet

Check Detail
CI at head ok 9 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 90b27b8a, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M4 panels on firmware 26.6.2 (J713, J715, J604: the boards whose DCP node has apple,panel-width-mm). Other Macs: the identity is allocated only on the M4 path, by that property, so no other Mac gets a new EDID from it; the iMac and Mac mini have no such property. The polarity is filled in dcppanelidentitytiming(), shared by every internal panel's EDID, but only where the firmware's timing has none: a panel whose timing states a polarity gets the same bytes as before (code reading, not run on another Mac). On the J604 dcppanelreadadt() now also reads the EDR headroom; dcppaneledr() stays false without an EDR-capable swap, so no HDR is offered there.

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed 90b27b8a52c8 (drm/apple: m4: publish the internal panel's EDID):

  • Property-driven apple,panel-width-mm allocation of dcp->panel_identity, dcp_metadata_timing_polarity(&summary) in dcp_panel_identity_timing() (filling sync polarity only when absent without mutating the firmware mode, covered by parser_panel_timing_polarity), and dcp_m4_panel_edid() after the notch-twin mode block (with apple,panel-width-mm/height-mm restored afterward) all look clean.
  • DCO and Risk: are present, and the J713 M4 (firmware 26.6.2) EDID/P3 verification is documented.
  • Approved the pending fork workflow runs (pr-text, Host tests, Apple build and KUnit); holding approval for CI to finish green at 90b27b8a52c8.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at 90b27b8a52c8

Blockers:

  1. drivers/gpu/drm/apple/iomfb.c:2997: the J713 row predates the rebase (e4f16a33d7f5 in a combined kernel); the rebase onto 9177b2d474f8 conflicted in dcp_get_modes(), and iomfb.c on main has moved since. Please post a J713 row at 90b27b8a52c8 (or a batched M4 candidate containing it unchanged): panel EDID published with name, size and Display P3 chromaticities, 0 failed units, 0 new kernel errors.
  2. drivers/gpu/drm/apple/dcp-display-metadata.c:442: dcp_panel_identity_timing() is shared by every internal panel's EDID, so please add one non-M4 laptop regression row at this head comparing /sys/class/drm/card*-eDP-1/edid sha256 against main (identical, 0 new kernel errors).

Once those rows are posted (and Host tests completes on a fresh run — run 46878188687 is stuck queued in GitHub Actions with 0 jobs and cannot be cancelled/re-run via API; if this merges after #3926 and #3260, resolving the trivial dcp.c + parser-test.c merge with main will also trigger a fresh Host tests run), this is ready to approve and merge without a full re-review.

Checked: code is clean with no blockers; no Apple material, no new chip/board/firmware gates, no new parameters, DCO matches author; probe/bind scoping, J604 EDR inertness, dcp_get_modes() ordering, shared polarity fallback, and KUnit coverage verified; Apple build and KUnit (including parser_panel_timing_polarity) and pr-text are green at 90b27b8a52c8.

Evidence
  • drivers/gpu/drm/apple/dcp.c:8907-8913: panel_identity allocation sits in the else if of if (!iomfb_is_m4(dcp)) gated on apple,panel-width-mm; non-M4 Macs keep the panel-child path, and dcp_is_internal_panel_only() (dcp.c:7256) is only called on firmware 27.
  • drivers/gpu/drm/apple/dcp.c:7608-7614: reads DT dimensions and calls dcp_panel_read_adt() before iomfb_m4_start(). On J604, edr_ceiling stays inert (dcp_panel_edr() requires dcp_fw_swap_has_edr(), and peak_nits is only set on firmware 27), so no HDR/CTA block is emitted.
  • drivers/gpu/drm/apple/iomfb.c:2997-3009: dcp_m4_panel_edid() publishes the full-timing EDID after #2814's notch mode block and before restoring exact DT mm and notch-free height (necessary because drm_edid_connector_update() resets display_info to whole centimetres).
  • drivers/gpu/drm/apple/dcp-display-metadata.c:442: dcp_metadata_timing_polarity(&summary) modifies only the stack copy and fills sync polarity only when absent, leaving panels with explicit sync polarity byte-identical.
  • Hosted CI at 90b27b8a52c8: Apple build and KUnit pass (apple-display-parser 49/49 including parser_panel_timing_polarity), pr-text pass; Host tests run 46878188687 is stuck queued with 0 jobs since 2026-12-03 02:37 AEST (cancel/force-cancel returns HTTP 409, rerun returns HTTP 403).
  • Merge check against current main (6ee70d49c228): clean. Note this overlaps #3926 in dcp.c (dcp_comp_bind_pipe()) and #3260 in parser-test.c; merging #3926 and [#3259](https://github.com/aurora-silicon/linux/pull/3259) -> [#3260](https://github.com/aurora-silicon/linux/pull/3260) first means only #3261 needs a single conflict merge (placing dcp_read_notch(dcp) before if (dcp->panel_identity) to match non-M4 bind order, and keeping both KUnit cases).
  • Non-blocking notes:
    • parser-test.c:1572: DRM_EDID_PT_SEPARATE_SYNC is clearer than 0x18, and a negative-polarity case (NHSYNC|NVSYNC -> 0x18) would pin the "unchanged when stated" contract.
    • Note on Risk wording: if any non-M4 panel's firmware omits SyncPolarity, parser.c:1249-1255 leaves flags 0 and line 442 would give it an EDID too; the non-M4 row settles this.

@aurora-silicon-review aurora-silicon-review Bot 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.

Verdict: MERGE at 90b27b8

Checked: The panel identity is allocated when the DCP node describes its dimensions. Missing sync polarity is filled only on the EDID's copied timing, leaving the firmware mode unchanged. The M4 path publishes the single real timing as EDID, keeps the notch-free virtual mode in its existing list, and restores millimetre dimensions after the EDID update. The current-head apple-build and DCP KUnit checks passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants