Skip to content

drm: apple: t8132: publish the sink's EDID on external outputs - #2166

Merged
niteria merged 1 commit into
aurora-silicon:integration/aurorafrom
niteria:j713/ext-edid
Nov 22, 2026
Merged

niteria merged 1 commit into
aurora-silicon:integration/aurorafrom
niteria:j713/ext-edid

Conversation

@niteria

@niteria niteria commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The M4 (T8132) external DCP builds its modes from the firmware's timing catalog and never read the sink's EDID, so the connector had no EDID property: compositors saw no monitor name, serial or physical size and guessed the scale (Hyprland put a 1080p monitor at scale 2).

This tracks the dcpav-service-epic the firmware announces on EP 0x28 for each sink, reads its EDID with the generic path's inline/legacy reader (new dcpavserv_read_edid()), and passes its SDR view (dcp_edid_sdr(), as native26 does) to drm_edid_connector_update() from get_modes. The modes stay the firmware catalog's; with the raw EDID, the probe helper would prune the catalog modes the sink lists as 4:2:0 only.

The EDID is kept for the sink's link and read once per announcement of the AV service, which the firmware repeats after a relink or a resume: a failed read no longer blanks it, and probes no longer cost a firmware call. As on the Neo it probes again when the service is announced, and, with the generic path's bounds (DCPAVSERV_EDID_RETRIES/DCPAVSERV_EDID_RETRY_MS in epic/dpavservep.h: 5 times, 500 ms apart), while the firmware answers without EDID bytes because it has not read the sink yet. Nothing is read from a stopped or failed session, and the service announced before a deep sleep goes with the stop.

Tested on a J713 (MacBook Air M4) over USB-C HDMI adapters on both ports, with a Samsung LS28AG700N (4K, 512-byte EDID, 256 bytes in its SDR view) and a Samsung S24F350:

  • Hyprland shows each one's name, serial and size, picks scale 1 for 1080p, and applies a per-monitor rule (4K@30, scale 2) to the 4K after a boot with it attached and after a replug.
  • One EDID read per service announcement; later probes reuse it.
  • The firmware drops the 4K's link about 10 s into boot and announces the service again: the EDID stays published throughout (the first version of this PR blanked it while the monitor was still connected; A/B boot).
  • Replug, moving to the other port, and both monitors at once: the right EDID on each output.
  • Deep sleep, with drm: apple: t8132: keep an external display across a deep sleep #2200: three PMU-RTC-woken deep sleeps with the 4K attached. After each wake the display came back at 3840x2160@30, the firmware announced the AV service again, and the same 256-byte EDID was published; Hyprland kept the monitor's make, model and serial. No warnings or errors from the display stack, 0 failed units; the only kernel errors were the 4 lines every sleep on this Air logs (its USB Ethernet adapter, the sleep controller). SELinux is not enabled on this NixOS install.

The first version was also tested with an HP HDMI-VGA adapter. DjDeveloperr tested it on a J773g (Mac mini M4) with #1192: HDMI to a G81SF, the 256-byte SDR view published on 5 boots and across suspend-to-idle, KWin warning only about the zeroed colorimetry.

Host tests (tools/asahi/run-host-tests.py, full run): 425/425 on both this branch and its base 432f175816e9.

Overlap checked against open PR heads: #1812 also edits epic/dpavservep.c (the generic discovery wait), with no functional overlap; #1192 and #1940 touch iomfb_m4.c / t8132_ext_drm.c but not EDID.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Works on a J773g (Mac mini M4) with #1192: HDMI to a G81SF, EDID published (256 bytes, the SDR view). KWin reads it; it warns only about the zeroed colorimetry, as intended. The EDID was published on every boot of the mini's new default kernel (this PR + #1192 + #2296), 5 boots, and it stays across suspend-to-idle.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

  1. Commit 6b8638a carries Assisted-by: LLM. Drop it and keep the Signed-off-by; the PR body ends with "Generated with Claude Code" and its last line should be Assisted-by: LLM (Claude:Opus 5.5) instead.

The lifetimes and locking hold up. The service is pinned with afk_service_get() under state_lock and released after the read. The kept EDID is replaced under ext_modes_lock, and the old one is freed outside the lock. A link-generation change during the read discards the result (iomfb_m4.c:3400-3404). quiesce cancels the retry after dcp_m4_failed(), so a late get_modes cannot queue it again: a failed DCP takes no service (3363). The SDR view keeps the probe helper from pruning catalog modes.

Nit: iomfb_m4.c:3298-3299 repeats the generic path's DCPAVSERV_EDID_RETRIES/_RETRY_MS (epic/dpavservep.c:613-614). Share one definition so the two bounds cannot drift.

HW row: J713 on this head, plus suspend and resume with the external display attached, once the M4 external DCP sleep fix is in (deep sleep has not been tested). The EDID should still be published after the wake with no extra read failures logged, 0 SELinux denials, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

The M4 external DCP builds its modes from the firmware's timing catalog
and never read the sink's EDID: the connector had no EDID property, so
compositors saw no monitor name, serial or physical size, and guessed
the scale (Hyprland put a 1080p monitor at scale 2).

Track the dcpav-service-epic the firmware announces on EP 0x28 for each
sink, read its EDID with the inline/legacy reader of the generic path
(new dcpavserv_read_edid()), and pass its SDR view (dcp_edid_sdr(), as
native26 does) to drm_edid_connector_update() from get_modes. The modes
stay the firmware catalog's: with the raw EDID, the probe helper would
prune the catalog modes the sink lists as 4:2:0 only, as the connector
does not allow 4:2:0.

Keep the EDID for the sink's link and read it once per announcement of
the AV service, which the firmware repeats after a relink or a resume:
a failed read no longer takes the EDID from the connector, and a probe
no longer costs a firmware call. As on the Neo, probe again when the
service is announced, as get_modes may already have run without it,
and, up to 5 times 500 ms apart, while the firmware answers without
EDID bytes because it has not read the sink yet. Nothing is read from
a stopped or failed session, and the service announced before a deep
sleep goes with the stop.

Tested on a J713 over USB-C HDMI adapters on both ports with a Samsung
LS28AG700N (4K, 512-byte EDID, 256 bytes in its SDR view) and a Samsung
S24F350: Hyprland shows each one's name, serial and size, picks scale 1
for 1080p, and applies a per-monitor rule (4K@30, scale 2) to the
LS28AG700N after a boot with it attached and after a replug. The EDID
is read once per announcement and stays published through the
firmware's relink about 10 s into boot.

Signed-off-by: Bartosz Nitka <niteria@gmail.com>
@niteria

niteria commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Done in 9da0aef:

  1. The commit carries no agent trailer, only my Signed-off-by, and the PR body's last line is Assisted-by: LLM (Claude:Opus 5.5).

Nit: DCPAVSERV_EDID_RETRIES/DCPAVSERV_EDID_RETRY_MS are in epic/dpavservep.h now and the M4 path uses them, so there is one definition (5 retries, 500 ms apart, as before). iomfb_m4.o, epic/dpavservep.o and t8132_ext_drm.o build W=1-clean, with the same .text as 6b8638a.

HW row, J713 (MacBook Air M4) with #2200, the Samsung LS28AG700N (4K) on a USB-C HDMI adapter, three deep sleeps woken by the PMU RTC:

  • Each wake: the display came back at 3840x2160@30 ("display restored"), the firmware announced the AV service again, and the same 256-byte EDID was published (same hash before and after every sleep). Hyprland kept the monitor's make, model and serial.
  • No warnings or errors from the display stack or the EDID read; 0 failed units.
  • Kernel errors: only the 4 lines every sleep on this Air logs (its USB Ethernet adapter as the USB host goes down, the sleep controller's DMA binding), also logged by a sleep before the display was attached.
  • SELinux is not enabled on this NixOS install, so there were no denials to count.

The kernel was the Air's: a7dd26e with this PR's patch, #2200 as reviewed and #2205. This head compiles to the same code, and #2200's current head differs only by the chip term you asked to drop, which is always true on T8132.

Host tests (full run): 425/425 on this branch and its base.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of 9da0aef: No blockers.

  1. Agent trailer in the commit: resolved. 9da0aef carries only the author's Signed-off-by, and the PR body's last line is Assisted-by: LLM (Claude:Opus 5.5).
  2. Duplicate retry bounds (nit): resolved. DCPAVSERV_EDID_RETRIES/DCPAVSERV_EDID_RETRY_MS are now defined once in epic/dpavservep.h:60-61 and used by both the generic path (epic/dpavservep.c:656,660) and the M4 path (iomfb_m4.c:3391,3394), which already includes the header (iomfb_m4.c:54).

Against 6b8638a, on the same base 432f175, the only code change is that move. The EDID lifetime and locking are unchanged from what was checked before. The deep-sleep row asked for is in the PR: J713 with #2200, the 4K sink on a USB-C HDMI adapter, three RTC-woken deep sleeps. The same 256-byte EDID was published after each wake, with no display-stack warnings or errors, 0 failed units, and only the 4 kernel error lines this Air logs on every sleep (also logged without the display attached). SELinux is not enabled on that install, so there are no denials to count.

Assisted-by: LLM (Claude:Opus 5.5)

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

Review of 9da0aefd against the pre-PR checklist (§1–§6): looks good, ready to merge.

  • Lifetimes, locking, and bounds (§1–§3): Clean and property-driven (no board/model/firmware-version gates added). Tracks dcpav-service-epic on DPAVSERV_ENDPOINT (0x28) for adopted external DCPs (iomfb_m4.c), pins service with afk_service_get()/put() under state_lock only while !dcp->error && !READ_ONCE(dcp->gated), caches and swaps ext_edid under ext_modes_lock keyed on ext_link_gen (freeing the old EDID outside the lock and discarding reads if ext_link_gen changed), clears ext_avserv in iomfb_m4_ext_stop(), and cancels ext_edid_retry after dcp_m4_failed() in iomfb_m4_quiesce(). Shares dcpavserv_read_edid() and DCPAVSERV_EDID_RETRIES/DCPAVSERV_EDID_RETRY_MS via epic/dpavservep.h. The dcp_edid_sdr() copy length (raw->extensions + 1) * EDID_LENGTH is bounds-checked by dcpavserv_read_edid_legacy() and drm_edid_valid().
  • Overlap / superseded check: Not superseded on integration/aurora (iomfb_m4.c / t8132_ext_drm.c still have no EDID read). Checked against open aurora-silicon/linux#2783 (c1183283): no conflict or functional overlap — #2783 updates dcpavserv_identity() (epic/dpavservep.c:44-78) and apple_drv.c for the generic dpavservep firmware-27.x path, while #2166 adds dcpavserv_read_edid() (epic/dpavservep.c:581) and wires up the iomfb_m4 / t8132_ext_drm (T8132 26.6.2) external output path. Compatible with merged #2200 (118b39f5f7).
  • Attribution & naming (§4, §6): Single commit 9da0aefd carries human author/committer and human Signed-off-by: only (zero agent trailers); PR body carries Assisted-by:.
  • Evidence & CI (§5): Covered on J713 (both USB-C ports, 4K + 1080p sinks, relink retention, replug, dual monitors, and 3 PMU-RTC deep sleeps with #2200: 0 failed units, 0 display warnings/errors, 0 new kernel errors vs baseline) and J773g (5 boots + s2idle with #1192). CI host-tests is green on 9da0aefd.

Assisted-by: LLM (Gemini 4 Neon)

@niteria
niteria merged commit a99fc40 into aurora-silicon:integration/aurora Nov 22, 2026
1 check passed
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.

3 participants