Skip to content

drm/apple: read the external monitor's EDID on the M3/M4 Air (27.x) and offer HDR there - #2783

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
j615-6/dpav-ep28-edid
Nov 22, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
j615-6/dpav-ep28-edid

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

An external monitor on the M3 Air (J615, external DCP on firmware 27.2) lights up, but the connector has no EDID. GNOME shows it as "Unknown 32-inch", and userspace gets no product name, colorimetry or HDR metadata. The firmware announces the EDID AV service (dcpav-service-epic / DCPDP13Service) on the classic DPAV endpoint 0x28 with EPICUnit 0 and a dynamic interface-id. The AFKV2 identity check only knew the H17P layout (endpoint 0x2a, unit == interface-id), so it refused the service (admission failed: -19). The M4 Air (J713) logs the same refusal on every boot.

Separately, a T8122 machine-compatible gate removed the BT.2020 Colorspace and HDR_OUTPUT_METADATA properties from every M3 Air Type-C connector. That limit is real only on the native26 route (XRGB8888-only primary). On 27.2 the external primary offers XR30/AR30/AB4H.

Change

  1. dpavservep: admit the AFKV2 AV service on endpoint 0x28 when it carries EPICUnit 0 and a nonzero, bounded interface-id (same class list). Endpoint 0x2a still requires unit == interface-id. Host regression added; the parent fails it.
  2. apple_drv: withhold the HDR properties only when a pipeline that can drive the Type-C connector is native26 (dcp_is_ext26(), the property plane setup already uses), instead of of_machine_is_compatible("apple,t8122").

Testing

J615 (M3 Air), monitor MSI MPG 325CQRXF on USB-C, default command line, kernel = 11-22 fleet test kernel f80j + this drm/apple module, Stage 2 with aura#437. Compared with macOS for the same monitor:

Criterion macOS Linux before Linux with this PR
EDID / product name MPG 325CQRXF (MSI) no EDID, "Unknown 32-inch" 384-byte EDID; GNOME: Vendor MSI, Product MPG 325CQRXF
Max refresh 2560x1440 @ 280 Hz 280 Hz 280 Hz (DisplayID 280.001)
VRR yes, 48-280 Hz vrr_capable 1 vrr_capable 1, GNOME min 48 Hz; KMS row below
Colourspaces BT.2020 RGB/YCC/cYCC no Colorspace property Colorspace {Default, BT2020_RGB}; EDID colorimetry block published
HDR PQ, static metadata type 1, 417.7 nits max no HDR_OUTPUT_METADATA GNOME offers bt2100; with it on: XR30 framebuffer, Colorspace BT2020_RGB, HDR blob, DCP set to 10 bpc / BT.2020 / PQ at 1440p280
  • VRR at the KMS level (compositor stopped, atomic client flipping at a fixed pace on DP-2 @ 280 Hz): with VRR_ENABLED=1 at 50 fps, 299/299 intervals land within 0.6 ms of 20.0 ms (stdev 0.06 ms). With VRR_ENABLED=0 it is 0/299, quantised to 17.86/21.43 ms. At 100 fps: 297/299 vs 59/299. At 280 fps: 3.571 ms.
  • s2idle x3 with the monitor attached (rtc0 wake): 3/3 resume, the AV service is re-admitted on new interface-ids (5 ... 33), and the EDID is back after each resume. 0 failed units, Enforcing, no new kernel errors (the "undeclared provider clock index 0" line and the dwc3 genpd -11 at suspend are present without this change too).
  • Host suite tools/testing/selftests/drivers/gpu/apple-dcp 92/92 on this branch. drm/apple builds W=1 with no new warnings.

Still to run

  • J713 (M4 Air) with a monitor attached: same 0x28 refusal today; needs the same row.
  • J613 / native26: no behaviour change expected (identity takes the ext26 branch; the HDR properties stay off because the pipeline is native26). A J613 boot row is welcome.
  • Endpoint 0x2a Macs (Neo, M4 Pro) and the legacy M1/M2 path are not affected; the host tests cover them.
Reviewer detail

Firmware announcements seen on the J615 at 27.2 (dmesg): AFK service DCPDP13Service admission failed: -19 (ep=0x28 interface=1 name=dcpav-service-epic unit=0), then interface 5 after the first reconnect. With the change: AFK[ep:28]: new service DCPDP13Service on channel 5/9/13/.../33 across modesets and three suspend cycles.

Identity after the change (wire_v2 only; native26 and legacy branches unchanged):

  • class must be AppleDCPDP2HDMI or DCPDP13Service, channel 1..U16_MAX;
  • endpoint 0x2a: unit == channel (H17P dynamic interface-id, as before);
  • endpoint 0x28: unit == 0;
  • anything else: refused.

HDR gate: apple_typec_port_rgb8_only() walks the candidate pipelines of the port (the fixed pipeline on fixed-CRTC parts) and returns true if any is native26. drvdata and hw.iomfb_method_profile are already valid there: apple_probe_per_dcp() calls dcp_is_ext26() for plane setup earlier in the same bind.

DCP output with GNOME bt2100: set_digital_out_mode() color mode depth:10 format:2 colorimetry:7 eotf:2 range:1 vrr:1. SDR default: depth:10 format:0 colorimetry:16 eotf:0 range:0 vrr:1.

macOS reference: our own ioreg captures of the same monitor (J616s macOS 27.0 over USB-C DP: 1440p280, VRR 48-280, HDR PQ; J473 macOS 27.2 DisplayAttributes: PQ yes, HLG no, static metadata type 1, BT.2020 RGB/YCC/cYCC, max luminance 417.7 nits). Evidence: traces/display/20261122-j615-extmon-edid/ (lab store), KMS client kits/test/20261122-j615-extmon-edid/kmsvrr.py.

Assisted-by: LLM (Claude:Opus 5.5)

… endpoint

On firmware 27.x the T8122 (M3 Air) and T8132 (M4 Air) external DCPs
announce the EDID AV service, dcpav-service-epic / DCPDP13Service, on
the classic DPAV endpoint 0x28 with EPICUnit 0 and a dynamic
interface-id (1 at boot, then 5, 9, 13, ... after every reconnect and
resume). The AFKV2 identity check only knew the H17P layout (endpoint
0x2a, unit equal to the interface-id), refused it with -ENODEV, and the
connector was left without an EDID source: an empty EDID blob, no
monitor name, no colorimetry and no HDR static metadata for userspace
(GNOME showed "Unknown 32-inch").

Admit the AFKV2 service on endpoint 0x28 when it carries EPICUnit 0 and
a nonzero bounded interface-id, with the same class list. Endpoint 0x2a
keeps requiring unit == interface-id. Generation, epoch and owner
fences are unchanged.

The host regression now admits EPICUnit 0 on 0x28 over interface-ids
1/5/9/13 for both providers and still rejects unit == interface-id on
0x28, unit 0 on 0x2a, other endpoints, compartments and classes. The
parent fails the new case.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Commit f5bf834 ("drm/apple: export an SDR sink contract for native26
RGB8 scanout") withheld the BT.2020 Colorspace and HDR_OUTPUT_METADATA
properties on every T8122 Type-C connector, because the native26 route's
primary plane accepts XRGB8888 only. That limit belongs to the native26
pipeline, not to the SoC: on firmware 27.2 the M3 Air's external DCP
offers XR30/AR30/AB4H on its primary plane and drives the sink at
10 bpc with the PQ transfer function.

Withhold the properties only when a pipeline that can drive the
connector is native26 (dcp_is_ext26(), the same property plane setup
already uses to restrict formats), and drop the machine-compatible gate.
Native26 routes keep the SDR contract.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

@DjDeveloperr DjDeveloperr 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.

Reviewed head c118328349bf2272106ed134623903d78fe20ff7 (78e59bdf + c1183283) against pre-pr-checklist.md (§1–§6).

Audit summary

  • §1 No model gating / regression safety:
    • drivers/gpu/drm/apple/epic/dpavservep.c:dcpavserv_identity() cleanly isolates the AFKV2 classic-endpoint (DPAVSERV_ENDPOINT 0x28) EPICUnit == 0 admission behind dcp_is_ext26() (native26 unchanged), !service->ep->wire_v2 (legacy M1/M2 & 14.7 unchanged), and DPAVSERV_ENDPOINT_V2 0x2a (H17P still requires unit == service->channel), enforcing the same class allowlist (AppleDCPDP2HDMI / DCPDP13Service) and bounded nonzero channel (1..U16_MAX). Generation, epoch, and quiescing fences in dcpavserv_prepare() / dcpavserv_revalidate() / dcpavserv_init() are untouched.
    • drivers/gpu/drm/apple/apple_drv.c:apple_typec_port_rgb8_only() removes the of_machine_is_compatible("apple,t8122") gate and instead checks dcp_is_ext26(d) across candidate pipelines for the port (platform_get_drvdata(dcp[i]) is already bound and initialized earlier in apple_drm_init_dcp() -> apple_probe_per_dcp()). Native26 routes keep the SDR-only contract; 27.x external pipelines gain Colorspace and HDR_OUTPUT_METADATA.
  • §2–§3 Production-ready & safety: Works on the default kernel command line, no new cmdline/module params or timing hacks, no hardcoded safety limits.
  • §4 Clean-room & attribution: Both commits carry human authorship (Ryan Murray <ryan@aurorasilicon.org>) and Signed-off-by: only, with no AI trailers in commit metadata; PR body discloses Assisted-by:.
  • §5 Evidence & CI: Strong J615 (M3 Air, 27.2, default cmdline, Stage 2 aura#437) evidence with MSI MPG 325CQRXF (384-byte EDID, 2560x1440@280 Hz, VRR KMS timing 299/299 at 50 fps & 297/299 at 100 fps, HDR bt2100 / XR30 / 10 bpc / BT.2020 / PQ, 3/3 s2idle resume with EDID re-admitted on new interface-ids, 0 failed units, SELinux Enforcing, 0 new kernel errors). tools/testing/selftests/drivers/gpu/apple-dcp/edid.py adds positive and negative regressions for ep 0x28, 0x2a, and 0x2c; CI host-tests is green.
  • §6 Naming: Clean.

Minor non-blocking notes

  • The comment above apple_typec_port_rgb8_only() ("Every other pipeline has a 10-bit primary.") slightly overstates it since dcp_fw_compat_is_14_7() and dcp_fw_compat_is_12_x() also restrict primary formats to 8-bit (apple_plane_init_v14_7 / dcp_primary_formats_12_x), though this PR intentionally preserves existing non-T8122 behavior.
  • J713 (M4 Air with monitor) and J613 (native26) confirmation rows remain welcome as noted in the PR body.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J713 (M4 Air 13", T8132, 27.2) row: PASS. Same MSI MPG 325CQRXF on Type-C (card1-DP-1), with the stock kernel command line and no params. A = the J713 default (fleet80c cut, which does not have this PR). B = the same tree plus the two commits of this PR (83b219b7 + f80df9b7, cherry-picked unchanged from 78e59bd + c118328) as a one-shot. Stage 2 and the DTB are identical between A and B.

A: without #2783 B: with #2783 macOS (this monitor)
ep 0x28 AV service admission failed: -19, falls back to firmware-derived EDID AFK[ep:28]: new service DCPDP13Service n/a
EDID 256 bytes, no Range Limits, no DisplayID block 384 bytes from the monitor full EDID
Name MSI / MPG 325CQRXF MSI / MPG 325CQRXF MPG 325CQRXF
Max refresh 2560x1440@280 2560x1440@280 (60 modes) 1440p 280 Hz
VRR range no min-refresh-rate in Mutter Range Limits 48-280 Hz, Mutter min-refresh-rate 48 48-280 Hz
Colourspaces BT2020RGB BT2020 RGB / YCC / cYCC, SMPTE ST2084 BT.2020 RGB/YCC/cYCC, PQ
HDR (Mutter bt2100) works Colorspace=BT2020_RGB, HDR_OUTPUT_METADATA set, DCP 10 bpc, BT.2020, PQ; back to SDR cleanly HDR PQ

On the M4 Air, HDR was already offered before this PR, because the old T8122-only gate never matched the J713. So on the J713 the visible change is the real EDID, and with it the 48 Hz VRR floor that the synthesized EDID lacked.

VRR timing, sleep and state numbers

KMS-level VRR row (gdm stopped, paced page flips, 300 flips each, count = flips landing within 0.6 ms of the pace):

pace B VRR on B VRR off A VRR on A VRR off
50 fps 297/299 0/299 299/299 0/299
100 fps 299/299 64/299 299/299 60/299
280 fps 299/299 299/299 299/299 299/299

0 commit errors on either kernel. With VRR off, fixed 280 Hz quantises 50/100 fps onto the 3.571 ms grid, as expected.

  • Sleep on B: 3 deep sleeps of 20 s (apple-pmu-rtc wake), 3/3. DP-1 comes back connected with the 384-byte EDID after each one, and the ep 0x28 service is re-admitted on a new interface id each time.
  • State on B: Enforcing, 0 failed units, no oops / DART fault / DCP crash.
  • macOS reference: our own macOS ioreg captures of this monitor (1440p280, VRR 48-280, HDR PQ, static metadata type 1, BT.2020 RGB/YCC/cYCC). The monitor-side facts match the J615 row above.
  • Kernel: 7.3.0-aurora-f80c2783+ = the fleet80c cut + this PR, fleet80c config.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merge-train adversarial review (MERGETRAIN-LINUX3) at c118328: NO BLOCKERS. This change removes a model gate and adds none. Both commits merge cleanly onto integration b21dcc6.

Points for the body and the rows. None of them blocks:

  1. "Endpoint 0x2a Macs (Neo, M4 Pro) are not affected" is not right for the M4 Pro. Only the T8140 external sets DCP_IOMFB_METHODS_H17P_EXTERNAL, so the J616s dcpext (27.2) runs dpavservep on 0x28 with wire_v2. It now admits the AV service there, which means its external EDID comes from a live firmware call instead of being firmware-derived. If that call fails, iomfb falls back to the derived EDID, so the screen shouldn't go dark. We still owe a J616s external row (USB-C + HDMI). The train will take it on the exact-tip fleet boot.
  2. The comment "Every other pipeline has a 10-bit primary" (apple_drv.c:1269) is not true for the Neo external pipeline: H17P outside H17G has no XRGB2101010. That is not a regression, because the old gate never matched the Neo either. Consider keying the helper on the plane capability instead of dcp_is_ext26().
  3. On the newly admitted 27.x path, physical_edid is false, so a cached EDID is only invalidated when the service epoch changes. Please add one line to a row: swap two different monitors on one port.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Regression on the M4 MacBook Air (J713): with this PR's AV-service admission (78e59bd) the Mac resets about 0.6 s after a DPMS off while an external monitor is driven. Reverting only 78e59bd gives DPMS off/on 3/3 with the monitor on. The revert, with the A/B rows, is #2857. The M3 Air has not been checked yet: no monitor was attached.

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.

2 participants