Repository navigation
drm/apple: dpavservep: no EDID discovery wait without a sink - #1812
RyanTheTide wants to merge 1 commit into
Conversation
dpavservep_init() waits up to 1 s for a legacy EDID service announcement so that an early one can precede get_modes. On the J616s dcpexts (desktop 26.x firmware) the announcement never comes, with or without a sink, so each external processor's start ends on that timeout: "DCPAVSERV: no legacy EDID service within 1 s" 1.03 s after the firmware endpoints are known, and appledrm registers only then. Wait only when a sink is present at startup (a Type-C route or cable, or HDMI HPD high). Without one there is no EDID to read yet; mark the start so that the first announcement, if one arrives, re-probes a connected sink through dcpavserv_notify_edid(), as the AFKV2 path already does. With a sink present at startup nothing changes, and later legacy announcements (resume) still do not trigger a probe. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
|
Checked against the current integration/aurora (0abc2f3): this PR and #1771 merge cleanly on top of it, so no rebase is needed. Since this PR was opened, integration returns before the discovery wait for every AFKV2 endpoint ( The legacy discovery wait is also reached through the Build: integration 0abc2f3 + #1771 + #1812, fleet75 config, LLVM=1 (clang 22.1.6), The distro pre-pivot waits are dropped in fedora-aurora#418, alarm-aurora#346 and nixos-aurora#327, which depend on this PR. |
|
Changes needed at 2c21581.
Rows still owed at this head: J616s HDMI plug after a sinkless boot; M1 Pro with HDMI attached at boot; M2 with a USB-C display attached at boot (EDID modes and properties unchanged). Assisted-by: LLM (Claude:Opus 5.5) |
RyanTheTide
left a comment
There was a problem hiding this comment.
Review at 2c21581f02b8. A legacy service that arrives after an empty-link boot is published normally and consumes late_notify under the same lock. Please add an attach-between-sink-check-and-announcement row and verify EDID with the monitor already present at startup. The held connector checks can suppress the rescan before modes or registration exist, so the first later hotplug must still pick up the service. The J413 timing row has the other display-start patches applied.
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist review at 2c21581f024d9c9e5c0e388e15a3019152b307df:
- §1 No model gating, §3 Safety, §6 Naming: Pass — sink detection checks hardware/route state (
active_typec_route,typec_cable_connected,hdmi_hpd) rather than chip/board IDs.
Blockers
-
CI failure (
host-tests/apple-afkv2):host-testsfails withnotify.c:42: Assertion 'queued==1' failed(exit 134). Removing!service->ep->wire_v2fromdcpavserv_notify_edid()(drivers/gpu/drm/apple/epic/dpavservep.c:28) breakstools/testing/selftests/drivers/gpu/apple-afkv2/extract-notify.py:45, which enforces that legacy non-AFKV2 endpoints do not queue a re-probe throughdcpavserv_notify_edid().- Either keep the
wire_v2guard for normal callers and explicitly bypass it only for the one-shotlate_notifypath, or update the selftest and contract together sohost-testspasses.
-
§4 Clean-room & attribution (hard rule) — forbidden AI trailer in commit message:
- Commit
2c21581f024dcontainsAssisted-by: LLMin its commit trailers. Commits must carry human identity and humanSigned-off-by:only (zero AI trailers in commits; keepAssisted-by:in the PR body only).
- Commit
-
§2 / Correctness — stale
late_notifyacross resume/teardown and GPIO error polarity:dcp->dcpavserv.late_notifyis only cleared insidedcpavserv_init()when an announcement arrives. It is never cleared whendpavservep_init()takes the wait path, indcpavserv_teardown(), or indpavservep_detach(). On firmware that never announces at boot (such as J616s desktop 26.x),late_notifystaystrue, so a later announcement after resume/re-init will spuriously calldcpavserv_notify_edid()— contradicting the commit message's claim that later legacy announcements on resume do not trigger a probe.- In
dpavserv_sink_at_startup()(dpavservep.c:774),gpiod_get_value_cansleep(dcp->hdmi_hpd) > 0treats a negative GPIO read error as "no sink" and skips the discovery wait. Use!= 0so a read error conservatively preserves the discovery wait (consistent with #1771). - Also verify the startup race on Type-C-only dcpexts where Type-C cable/route state lands after
dpavserv_sink_at_startup()and a legacy announcement arrives before connector registration /nr_modes > 0, consuminglate_notifywhiledcpavserv_notify_edid()returns early.
-
§5 Evidence — all sink hardware rows still pending:
- None of the sink rows listed under "Still to run" have been executed: J616s HDMI hotplug after a sinkless boot, M1 Pro with HDMI attached at boot, and M2 with a USB-C display attached at boot (verifying real EDID modes rather than fallback timings, with 0 kernel errors, 0 AVC denials, and 0 failed units).
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 2c21581f024d
Blockers:
- CI is red:
host-testsfails atnotify.c:42: Assertion 'queued==1'. Removing!service->ep->wire_v2fromdcpavserv_notify_edid()(epic/dpavservep.c:28) breaksapple-afkv2/extract-notify.py:45, which checks that legacy endpoints don't queue a notification. Fix: keep the legacy case, or update the selftest if the new behaviour is intended. - The commit carries an
Assisted-by: LLMtrailer; the snippet below drops it.
git fetch origin
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch -f --msg-filter "grep -viE '^(assisted-by:|(co-authored-by|signed-off-by):.*(claude|copilot|codex|gemini|cursor|openai|anthropic)|[^a-z]*generated with)' | git stripspace" origin/main..HEAD
git push --force-with-leaseRows before merging: one boot at the new head on a J616s and one on an M1 Pro or M2 (both have legacy external processors): no sink at boot, then a display hotplugged.
Checked: no Apple material, no gates.
Evidence
Read 2c21581f and the failing host-tests run.
Superseded by the review at 2c21581
|
Replaced by #3127: the same change on current main with the commit trailers removed (authorship kept), so no force push here. |
Problem.
dpavservep_init()waits up to 1 s for a legacy EDID service announcement on every display processor without a panel, so that an early announcement can come beforeget_modes. Without a sink attached the announcement does not come in that window, so each such processor's start ends on the timeout. appledrm registers only after every processor is up, and the boot waits for that device in the initramfs. This affects every Mac whose external processors run legacy (non-AFKV2) firmware: the two J616s dcpexts (desktop 26.x firmware), and the dcpexts of the M1 Pro and M2.Change. Wait only when a sink is present at startup: a Type-C route or cable, or HDMI HPD high. Without one there is no EDID to read yet. The start is marked so that the first announcement, if one arrives later, re-probes a connected sink through
dcpavserv_notify_edid(), as the AFKV2 path already does. With a sink present at startup nothing changes, and later legacy announcements (after resume) still do not trigger a probe. The sink check reads hardware state (route, cable, HPD line), not the board or chip.Testing. J616s, no sink on either dcpext at startup, 3 boots each (kernel monotonic):
[drm] Initialized appleEvery boot: SELinux enforcing, 0 failed units, 0 AVC. Rebased check on the current integration tip (0abc2f3): merges without conflicts, and the wait is unchanged there (
epic/dpavservep.c:806). The T8122 native26 path added since uses AFKV2 and is not affected.Testing (J616s, hardware, together with #1771, #1812 and #2337). J616s (T6040), HDMI empty, no external display, production kernel 7.3.0-aurora-fleet75. Only the appledrm module changes: A is the production source rebuilt the same way, B is the same plus #1771, #1812 and #2337. Each arm boots a one-shot test initramfs entry; 5 boots each, alternating, kernel monotonic, median (min-max):
[drm] Initialized apple(s)All ten boots: SELinux enforcing, no failed units, no AVC denials, no kernel errors.
Testing (M2, hardware, together with #1771, #1812 and #2337). M2 (T8112, J413), no external display, production kernel 7.3.0-aurora-fleet74, same module-only A/B (A production source rebuilt, B plus the three changes), one-shot test initramfs entries, 3 boots each, alternating, median (min-max):
[drm] Initialized apple2.089 (2.082-2.095) -> 0.960 (0.943-0.980) s; last "DCP booted" to registration 0.126 -> 0.032 s; switch root 2.394 -> 1.734 s; gdm started 6.393 (6.369-6.415) -> 5.662 (5.661-5.736) s. All six boots: SELinux enforcing, no failed units, no AVC denials, no kernel errors.Testing (M1 Pro, hardware, together with #1771, #1812 and #2337). M1 Pro (T6000, J316s), no external display, production kernel 7.3.0-aurora-fleet74. Only the appledrm module changes: A is the production source rebuilt the same way, B is the same plus #1771, #1812 and #2337. Each arm boots a one-shot test initramfs entry; 3 boots each, alternating, kernel monotonic:
[drm] Initialized apple(s)gdm started at 5.42-5.53 s in all three B boots. All six boots: SELinux enforcing, no failed units, no AVC denials, no kernel errors. The rows measure the three changes together; the split per change is what the logs above predict (the 1 s EDID-service wait on each dcpext, the 100 ms sleep).
Still to run. The sink rows:
None of the lab Macs has an HDMI sink attached right now, so the sink rows need someone at the machine. A ready-to-run row script is prepared.
M1 Pro and M2: the same 1 s wait in their logs (without this change)
The non-desktop start calls
dpavservep_init()for every processor without a panel (dcp.c:4654) before the IBOOT and DPTX endpoints start, so the gap shows between the system endpoint coming up and the next endpoint:[drm] Initialized apple2.100 s. The internal panel's DCP booted at 0.914 s.[drm] Initialized apple1.954 s. The panel's DCP booted at 0.829 s; appledrm's module init took 1.14 s (initcall_debug).Expected with this change: the dcpexts are up about 1 s earlier on both, so appledrm registers right after the panel's DCP instead.
J616s timeline detail
The gap from "firmware endpoints listed" to "endpoints started" drops from about 1.03 s to about 0.05 s on each dcpext. The "no sink at startup" message fired on both dcpexts every boot (
appledrm.dyndbg=+p).Why a sink plugged in after boot still gets its EDID
Without a sink at startup the state after this change is the state the 1 s timeout already left: no EDID service published yet. The J616s firmware never sent the announcement within the window in any boot, with or without a sink, so for it the hotplug path after boot is the one that runs today. If an announcement does arrive later,
dcpavserv_init()publishes the service as before and, because the start was marked, callsdcpavserv_notify_edid(), which re-probes only a registered, connected connector with modes. A connector that is not connected yet reads the EDID through the published service on its firstget_modes, as it would after a late announcement today.