Skip to content

drm/apple: publish an identity EDID for every internal panel - #1016

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
fix/internal-panel-edid
Nov 6, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
fix/internal-panel-edid

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Only the desktop 26.x (J616s) internal panel published a firmware-derived EDID. Every other internal panel (Neo H17P, M1/M2 laptops) exposed none (/sys/class/drm/card*-eDP-1/edid is 0 bytes), so its connector has no vendor/product/serial.

User impact on the Neo (GNOME 51):

  • gnome-shell's brightness manager throws JS ERROR: Error: Argument string may not be null (brightnessManager.js _setState) on every brightness change, so the panel brightness is never saved across logins.
  • colord: failed to get edid data: EDID length is too small, no display profile.

Change:

  • New struct dcp_panel_identity (metadata, ADT fallback, generation, raw EDID), allocated at bind by any DCP with an internal panel, instead of living in the desktop-only state.
  • dcp_panel_adt_identity() now runs for every internal panel (not M4 IOMFB). The Neo's ADT carries /product raw-panel-serial-number, the same source the J616s uses.
  • dcp_get_modes() and the DisplayAttributes ProductAttributes path key on the panel identity, not on DCP_FIRMWARE_V_26_6_DESKTOP.
  • Modes still come only from the firmware TimingElements; dimensions still come from OF/ADT (exact mm).
  • The J616s keeps product code 0x0616 (so existing per-display settings keep matching); other panels report 0 rather than borrow it. EDR headroom stays desktop-only.

Tests:

  • KUnit apple-display-parser 38/38: the J616s publication test now also runs for H17P and 13.5 (no desktop state), plus a DCP without a panel identity publishes nothing.
  • Neo boot test and M2 regression: results to follow in comments.

🤖 Generated with Claude Code

Only the desktop 26.x (J616s) panel published a firmware-derived EDID.
Every other internal panel (the Neo's H17P, and the M1/M2 laptops) had
none, so its connector reported no vendor, product or serial.  GNOME
keys per-display state on those: on the Neo gnome-shell's brightness
manager threw "Argument string may not be null" on every brightness
change and never saved the level, and colord could not profile the
panel ("EDID length is too small").

Move the panel identity out of the desktop-only state into a
dcp_panel_identity that any processor with an internal panel allocates
at bind, filled from the boot loader's ADT exactly as on the J616s.
Firmware ProductAttributes and a raw panel EDID still replace the ADT
fallback where the firmware reports them.  The identity EDID keeps the
firmware's TimingElements as the only enumerated modes and the
connector's exact OF/ADT dimensions, as before.

The J616s keeps its published product code; other panels report 0
rather than borrow it.

KUnit: the J616s publication test now runs for H17P and 13.5 too, and a
DCP without a panel identity publishes nothing.

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

Copy link
Copy Markdown
Contributor Author

Neo (J700, H17P) one-shot test boot of 7.3.0-aurora-gapsneo1 (this branch, e44b8b9, fleet recipe), enforcing:

  • eDP-1 EDID 0 -> 128 bytes: APP, "Apple Panel", serial 200cf90d (hashed from ADT /product raw-panel-serial-number), 279x175 mm, range 59-60 Hz. Modes unchanged (2408x1506 from TimingElements).
  • dmesg: panel identity fallback: ADT parsed ... 279x175 mm, using firmware-derived EDID metadata for connection 0. No new warnings, 0 AVC, no failed units, aurora-diag identical to fleet16.
  • GNOME 51: brightness keys now persist (brightnesses file rewritten on each press, entry APP/Apple Panel/200cf90d/eDP-1), 0 Argument string may not be null (fleet16: error on every change, file last written Oct 15).
  • colord: device "Apple Panel" vendor Apple serial 200cf90d; the EDID length is too small error is gone.
  • Camera, GPU (Vulkan), Wi-Fi unaffected. Restored to fleet16 afterwards.

M2 (13.5 template path) regression still to come before merge.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J616s (desktop 26.x, the path this PR refactors) one-shot of the same 7.3.0-aurora-gapsneo1, enforcing:

  • eDP-1 EDID byte-identical to fleet17 (256 B, sha256 fd13a64f37f13a5e...): APP 0x0616, "Apple Panel", serial 544655bb, PQ CTA block. So existing per-display GNOME state keeps matching.
  • panel identity fallback: ADT parsed, panel node absent, dimensions 345x223 mm and using firmware-derived EDID metadata for connection 0 unchanged; EDR headroom 16.000 (from 43f112d on the base).
  • 0 AVC, same warning set, aurora-diag 141/3/0 = fleet17. Restored to fleet17.
  • External DP not rechecked: the dock was unplugged. The external path (dcp_firmware_edid, panel == false) is unchanged by this diff.

M2 (13.5 template, the other newly enabled path) is stranded until someone presses its power button. KUnit parser_panel_v13_5_publication covers that path through dcp_get_modes. Merging on Neo + J616s hardware proof plus KUnit; I'll run the M2 check when it's back.

…eight

The panel identity was allocated with devm in dcp_comp_bind_pipe().
Component bind runs inside a devres group on the DCP device that is
released when the bind fails (an M1/M2 internal pipe can return
-EPROBE_DEFER after it) or the component is unbound, but the pointer
in struct apple_dcp survived it: the next bind reused freed memory.
Allocate it at probe, like the desktop state, for any DCP with an
internal panel node except the M4 IOMFB, and only fill in the ADT
identity at bind.

With the notch hidden the published modes are trimmed, so an ADT
/panel height-mm must not replace OF's adj-height-mm.  No current ADT
we read has one (the Neo and J616s have no /panel node), but the
M1/M2 notched laptops now reach this path.

On the newly covered firmwares the ADT identity is replaced only by
DisplayAttributes ProductAttributes; a raw panel EDID is still read
on desktop 26.x only.

Host selftests: the desktop panel, colorimetry and J616s identity
fixtures model struct dcp_panel_identity (taken from the header), and
the external rate fixtures carry a NULL identity.

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

Copy link
Copy Markdown
Contributor Author

Adversarial review found a use-after-free; fixed in 0492d3a (new commit, no history rewrite):

  • The identity was devm_kzalloc'd in dcp_comp_bind_pipe(). Component bind runs in a devres group that is released on bind failure (e.g. -EPROBE_DEFER on an M1/M2 internal pipe) or unbind, while dcp->panel_identity kept pointing at it. It is now allocated at probe (like dcp->desktop) for any DCP with an apple,panel* child except the M4 IOMFB; bind only fills ->adt.
  • With the notch hidden, an ADT /panel height-mm no longer replaces OF adj-height-mm (no ADT we read has one today; M1/M2 notched laptops newly reach this path).
  • Host selftests (tools/testing/selftests/drivers/gpu/apple-dcp/run.py) updated for struct dcp_panel_identity: 86/86, same as the base (the first commit alone broke 5 fixtures). KUnit apple-display-parser 38/38.

Hardware: the Neo and J616s boots above ran the first commit; a rebuild with both commits (gapsneo2) is under way for a re-boot before merge.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Final code (both commits, 7.3.0-aurora-gapsneo2 = 1345aa9 on integration 0943983) on the J616s, two one-shot boots, enforcing:

  • eDP-1 EDID byte-identical to fleet17 on both boots (sha256 fd13a64f37f13a5e..., APP 0x0616 / Apple Panel / 544655bb + HDR block); ADT identity and EDR headroom lines unchanged.
  • External DP-2 (dock replugged, Acer QG270 S3) EDID published through the external path (firmware-derived EDID metadata for connection 3).
  • 0 AVC, no new warnings. Boot 1 hit the known intermittent H16 ANE startup stall (t-4541; quarantine error -110, different driver, the 4 previous boots on other kernels were clean). Boot 2: ANE up, aurora-diag 142/3/0.
  • Restored to fleet17.

With the Neo boot of the first commit (Neo now on a Touch ID hold), host selftests 86/86 and KUnit 38/38 on the head, merging. M2 (13.5) check follows when the M2 is powered back on.

@RyanTheTide
RyanTheTide merged commit 1207cd2 into integration/aurora Nov 6, 2026
@RyanTheTide
RyanTheTide deleted the fix/internal-panel-edid branch November 6, 2026 10:48
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Post-merge M2 (MacBook Air M2, 13.5 template path) one-shot of the same gapsneo2, enforcing: eDP-1 EDID 0 -> 128 B (APP, "Apple Panel", serial 267f6426 from the ADT, 290x189 mm, 60-61 Hz), panel identity fallback: ADT parsed, modes unchanged (2560x1664), 0 AVC, no new warnings, aurora-diag 4 warn all pre-existing (TB PCIe nodes, ANE telemetry). Restored to fleet17. All three panel paths (H17P, 13.5, desktop 26.x) now proven on hardware.

RyanTheTide added a commit that referenced this pull request Nov 6, 2026
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