Repository navigation
drm/apple: read the external monitor's EDID on the M3/M4 Air (27.x) and offer HDR there - #2783
Conversation
… 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
left a comment
There was a problem hiding this comment.
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_ENDPOINT0x28)EPICUnit == 0admission behinddcp_is_ext26()(native26 unchanged),!service->ep->wire_v2(legacy M1/M2 & 14.7 unchanged), andDPAVSERV_ENDPOINT_V20x2a(H17P still requiresunit == service->channel), enforcing the same class allowlist (AppleDCPDP2HDMI/DCPDP13Service) and bounded nonzero channel (1..U16_MAX). Generation, epoch, and quiescing fences indcpavserv_prepare()/dcpavserv_revalidate()/dcpavserv_init()are untouched.drivers/gpu/drm/apple/apple_drv.c:apple_typec_port_rgb8_only()removes theof_machine_is_compatible("apple,t8122")gate and instead checksdcp_is_ext26(d)across candidate pipelines for the port (platform_get_drvdata(dcp[i])is already bound and initialized earlier inapple_drm_init_dcp()->apple_probe_per_dcp()). Native26 routes keep the SDR-only contract; 27.x external pipelines gainColorspaceandHDR_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>) andSigned-off-by:only, with no AI trailers in commit metadata; PR body disclosesAssisted-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, HDRbt2100/ 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.pyadds positive and negative regressions for ep0x28,0x2a, and0x2c; CIhost-testsis 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 sincedcp_fw_compat_is_14_7()anddcp_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)
|
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.
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 numbersKMS-level VRR row (gdm stopped, paced page flips, 300 flips each, count = flips landing within 0.6 ms of the pace):
0 commit errors on either kernel. With VRR off, fixed 280 Hz quantises 50/100 fps onto the 3.571 ms grid, as expected.
|
|
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:
|
|
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. |
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
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.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 ofof_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:
vrr_capable1vrr_capable1, GNOME min 48 Hz; KMS row belowbt2100; with it on: XR30 framebuffer, Colorspace BT2020_RGB, HDR blob, DCP set to 10 bpc / BT.2020 / PQ at 1440p280tools/testing/selftests/drivers/gpu/apple-dcp92/92 on this branch. drm/apple builds W=1 with no new warnings.Still to run
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/.../33across modesets and three suspend cycles.Identity after the change (wire_v2 only; native26 and legacy branches unchanged):
AppleDCPDP2HDMIorDCPDP13Service, channel 1..U16_MAX;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 andhw.iomfb_method_profileare already valid there:apple_probe_per_dcp()callsdcp_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)