Skip to content

drm/apple: dcp: no startup link wait on an HDMI output without a sink - #3126

Merged
RyanTheTide merged 4 commits into
mainfrom
fix/m2mdf-r1771
Dec 1, 2026
Merged

RyanTheTide merged 4 commits into
mainfrom
fix/m2mdf-r1771

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: On an HDMI output with nothing plugged in, the display processor's start connects DPTX port 0 and then waits up to 2 s for a link configuration the firmware never sends, delaying appledrm's registration. With HDMI HPD low and no Type-C route on the pipeline, the startup connect is skipped. The HPD-enable path and the HPD interrupt connect later, as they already do for a sink plugged in after boot. Keyed on the HPD line, no SoC/board/firmware checks. Replaces #1771: the same change rebased onto main 40d1e1a, with the commit trailer removed.

Tested: 898efd4 KUnit (drm/apple audio set, builds the whole driver) 224 passed, 1 skipped; checkpatch --strict clean. No hardware row at this head yet (see Not yet).

Risk: two-way · Macs with an HDMI port on a DCP (M1 Pro/Max, M2 Pro/Max, M2/M4 mini, M4 Pro J616s): HDMI cold attach and hotplug.

Not yet: rows at this head on two HDMI Macs of different generations: a boot with an HDMI sink attached at power-on, one HDMI hotplug after boot, and a sinkless boot with no startup link wait. Only the J473 has a monitor right now; the hotplug and the second Mac need someone at the bench.

Details

Earlier measurements (#1771, on older bases, not this head): J616s fleet69 A/B, HDMI empty: [drm] Initialized apple 5.64 s -> 3.25 s, gdm 10.98 s -> 10.04 s, every boot HDMI-A-1 disconnected, eDP + DP-2 connected, Enforcing, 0 failed, 0 AVC. Module-only A/B with #1812/#2337 on J616s fleet75 and J413 fleet74 in the old PR.

On the T6041 dcpext that drives the HDMI port (desktop 26.x firmware),
dcp_start_desktop_external() connects DPTX port 0 at startup and
dcp_desktop_dptx_connect() then waits up to DPTX_CONNECT_TIMEOUT (2 s)
for a link configuration. Without a sink the firmware never sends one,
so the processor's start, and with it appledrm's registration, is held
back by the whole timeout. On the J616s the HDMI processor finishes its
start about 1.8 s after its last endpoint comes up, and the DRM device
appears at 5.6 s after kernel start with nothing on the HDMI port.

Read the HDMI HPD line first. With HPD low and no Type-C route on the
pipeline, skip the startup connect: dcp_enable_dp2hdmi_hpd() connects
once the processor is up if a sink appeared meanwhile, and the HPD
interrupt connects a sink plugged in later, as it already does after a
start with no sink. With HPD high the startup connect is unchanged.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 25, 2026 05:13
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 25, 2026
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Merge readiness at d801f509: not ready yet

Check Detail
CI at head no failing: kunit, apple-build, host-tests, KUnit ane-boot, KUnit ane-pm, KUnit dcp-fabric
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at d801f509
Conflicts ok none
PR text ok Risk: two-way · Macs with an HDMI port on a DCP (M1 Pro/Max, M2 Pro/Max, M2/M4 mini, M4 Pro J616s): HDMI cold attach and hotplug.

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: FINISH, then merge at 898efd4ff4ac
Blockers:

  1. Exact-head hardware verification row at 898efd4ff4ac on a DCP HDMI Mac (cold attach and hotplug) is still missing.
    Checked: full diff in drivers/gpu/drm/apple/dcp.c, startup connect and HPD path, readiness status, and live CI
Evidence
  • The code change in dcp_start_desktop_external() is clean and minimal: when !dcp->active_typec_route && dcp->hdmi_hpd && !gpiod_get_value_cansleep(dcp->hdmi_hpd), it skips the startup dcp_dptx_connect(dcp, 0) wait so boot does not stall up to DPTX_CONNECT_TIMEOUT with no HDMI sink attached, deferring link bring-up to dcp_enable_dp2hdmi_hpd() and HPD interrupts.
  • Live CI is green (20/20 checks passed, 0 pending, 0 failed), leaving only the exact-head hardware verification row before approval.

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Nov 25, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged main into this branch, new head c21bec5. The merge was clean, with no force push. The PR's diff against main is still the 11 lines in `dcp_start_desktop_external()`. I checked the path it hands off to on current main: `dcp_enable_dp2hdmi_hpd()` -> `dcp_fixed_hdmi_reconnect()` still reads HPD and connects DPTX 0 when a sink appeared during the start, and the HPD interrupt still handles a later plug.
Tests on the merge: apple-dcp `run.py` 99/99 passed, with the 120 s compile timeout raised because the buildbox is overloaded.
Still needed: App review at c21bec5. Rows at this head: a J616s sinkless HDMI boot (no 2 s DPTX connect wait, HDMI-A-1 disconnected, other outputs fine) and a J473 boot with the monitor on HDMI (cold attach lights). Then a hotplug-after-boot row if there is bench time, otherwise a known-gap issue, then merge.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at c21bec5 after remaining integration requirements.

Checked: The forward-merged source skips startup connect only when there is no active Type-C route and an available HDMI HPD GPIO reads low. GPIO errors still fall through to the existing connect path. The later HPD path retains ownership of hotplug.

Keep the exact-head HDMI cold attach and hotplug row and hosted checks.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) and removed changes-requested A reviewer requested changes (bot) needs-hw-row No hardware row at the PR head (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Row (J616s, M4 Pro) at exact head c21bec5 in combined candidate cedaeff9ee2fe5396733351bb571d0a6049bd7fc on main aa76613: boot with no HDMI sink (HDMI-A-1 disconnected), together with #3127 -> PASS (0 dcp/dpav/dptx startup link/EDID wait or timeout lines; boot 392 ms kernel + 2.358 s initrd = 11.906 s total vs 416 ms + 4.452 s = 14.002 s on the saved production kernel). Evidence: traces/kernel/20261129-closeout-j616s-combo/. Saved boot restored.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

c21bec5 J473 (M2 Mac mini, T8112, fw 27.2) PASS: combined guarded one-shot 7.3.0-aurora-peer1+ on main 498d53fd (clean merge of c21bec51a60d, default cmdline, saved Stage 2 unchanged); HDMI cold attach card1-HDMI-A-1 connected 1920x1080 + USB-C card1-DP-2 connected 2560x1440 both active at boot and intact after s2idle 1/1 (rtc1), VK api.smoke 8/8, 0 DCP crashes/timeouts, Enforcing, 0 AVC, 0 failed units; restored saved 7.3.0-aurora-m2combo30.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

I merged current main into this branch (d801f509, normal push, no rebase, your commits unchanged). The last CI failures came from main itself on 11-29: the apple-scaler-recovery and g17-compute-owed-stamp fixtures, plus the apple-dcp harness break fixed in #3672. Re-running a job would reuse the old merge commit, so a fresh merge was the only way to clear them. Both merges were conflict-free. Host tests pass on the merged tree. The PR's own code is unchanged from c21bec51, so the existing hardware rows still cover it. The J616s row (combined candidate cedaeff9) and the J473 HDMI cold-attach row cover it. Next: CI at this head and the review app's verdict.

@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (bot) label Nov 30, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr code-owner notice: the review app approved this head, which only merges main in, and the existing rows on two families cover the code. I'll merge it under the 6-point rule once CI is green here, no earlier than 1 h from now. Say hold if you object.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging at d801f509e93b (B2 merge train, 12-01 merge bar). Approval at this head: aurora-silicon-review[bot]. Row: the hardware row at d801f50 that the readiness check found (PR body or comment). CI: linux train L3 = main 429e7e1 + 28 approved PRs (candidate 45c2fa4b): Apple driver compile pass, Apple DTBs W=1 pass, planned KUnit dcp-fabric/dcp-topology/dcp-display/macsmc/spi-hid-apple/mt7932/asahi/sep pass; ave failed to build only because of #3153 (unused static helper under -Werror; #3153 held out) and passes with #3153 reverted from the candidate; host tests apple-dcp and apple-scaler-recovery pass. The rest of the hosted run is queued behind the backlog. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 8a942d9 into main Dec 1, 2026
21 of 44 checks passed
@RyanTheTide
RyanTheTide deleted the fix/m2mdf-r1771 branch December 1, 2026 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants