Skip to content

drm/apple: dpavservep: no EDID discovery wait without a sink - #3127

Open
RyanTheTide wants to merge 5 commits into
mainfrom
fix/m2mdf-r1812
Open

RyanTheTide wants to merge 5 commits into
mainfrom
fix/m2mdf-r1812

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: dpavservep_init() waits up to 1 s for a legacy EDID service announcement. On processors whose firmware never sends one (the J616s dcpexts, desktop 26.x firmware), every start ends on that timeout and appledrm registers late. Now the wait happens only when a sink is present at startup (a Type-C route or cable, or HDMI HPD high). Without one, the start is marked, and the first announcement, if any, re-probes a connected sink. Later legacy announcements (resume) still do not probe. Replaces #1812: the same change rebased onto main 40d1e1a with the trailer removed, plus a second commit for the host test the review found.

Tested: bda02d4 host AFKv2 selftests (run-afkv2-tests.sh) pass, 917 assertions; KUnit (drm/apple audio set) 224 passed, 1 skipped; checkpatch --strict clean. No hardware row at this head yet (see Not yet).

Risk: two-way · Macs with legacy external display processors (M1 Pro/Max, M2, M4 Pro J616s): EDID read and hotplug on external outputs.

Not yet: rows at this head on a J616s and an M1 Pro or M2: no sink at boot (no 1 s wait), then a display hotplugged and lit with its EDID. No legacy-path Mac has a monitor attached right now, so the hotplug needs someone at the bench.

Details
  • The guard moved to the caller. dcpavserv_notify_edid() used to refuse legacy endpoints. Legacy firmware now reaches it only from dcpavserv_init(), for an announcement after a sinkless start (late_notify). So the helper queues the probe for a ready connector on either wire. The host test apple-afkv2/extract-notify.py asserted the old refusal; the second commit updates it to the new contract and keeps the quiesce, routing, registration and connection guards.
  • Earlier measurements are in drm/apple: dpavservep: no EDID discovery wait without a sink #1812 (older bases, not this head).

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.

Signed-off-by: Ryan Murray <[email protected]>
…ouncements

dcpavserv_notify_edid() no longer refuses a legacy endpoint: legacy
firmware calls it only for an EDID service announced after a start
without a sink, which dcpavserv_init() decides. Expect it to queue the
probe for a ready connector on either wire, and keep the quiesce,
routing, registration and connection guards.

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 16b9d765: not ready yet

Check Detail
CI at head no failing: host-tests, kunit, apple-build, host-tests, KUnit ane-boot, KUnit ane-pm
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head no no line with the head SHA 16b9d765, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · Macs with legacy external display processors (M1 Pro/Max, M2, M4 Pro J616s): EDID read and hotplug on external outputs.

Areas: area:display

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

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 25, 2026
DjDeveloperr
DjDeveloperr previously approved these changes Nov 26, 2026

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

Verdict: FINISH, then merge at bda02d4c87: the code is ready; it needs only rows at this head.

Blockers: none in the code. Missing rows, as your Not yet says:

  • one J616s and one M1 Pro/Max or M2 at this head;
  • on each, a boot with no sink, confirming there is no 1 s discovery wait;
  • then a display hotplugged, lit, and with its EDID read.

Checked: the wait now runs only when a Type-C route, a cable or HDMI HPD is present at start. A sinkless start sets late_notify under the lock and only while the service is not yet enabled, so the first late announcement re-probes once and later ones (resume) don't. Taking the v2-only check out of dcpavserv_notify_edid() is safe, because legacy endpoints now reach it only through that path, and the host test covers the new contract. No Apple material, no board gates, no new parameters.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Nov 26, 2026
dpavservep_init() now asks dpavserv_sink_at_startup() whether to wait
and sets dcpavserv.late_notify under dcpavserv.lock, and
dcpavserv_init() clears it, so the harnesses that extract them no
longer compiled: the mocks had no late_notify, lock or sink inputs.

Add them, extract dpavserv_sink_at_startup() from the driver, and check
the contract: legacy firmware waits for the announcement only with a
sink at startup (Type-C route, Type-C cable or HDMI HPD high); without
one it does not wait and arms late_notify. In service-rebind the first
legacy announcement after such a start re-probes the connector once and
a later one (resume) does not.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

RyanTheTide commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Pushed two commits, new head 3118a5d (no force push): a forward merge of main (ca86173, clean) and 3118a5d, which fixes the host-test failure this PR caused. The apple-dcp harnesses that extract `dpavservep_init()` and `dcpavserv_init()` stopped compiling because their mock `dcpavserv` structs had no `late_notify`, no lock, and no sink inputs. The mocks now have them and `dpavserv_sink_at_startup()` is extracted from the driver. dpavserv-start now checks that legacy firmware waits only with a sink at startup (Type-C route, cable or HDMI HPD high), and that without one it does not wait and arms `late_notify`. service-rebind checks that the first legacy announcement after a sinkless start re-probes the connector once and a later one (resume) does not. The driver code is unchanged.
Tests on the merge: apple-dcp `run.py` 99/99 passed, with the 120 s compile timeout raised because the buildbox is overloaded. apple-afkv2 `run-afkv2-tests.sh` passed.
Still needed: App review at 3118a5d, and DjDeveloperr's approval again since the push made it stale. Rows at this head: J616s sinkless boot plus one of J316s/J473/J413, each a no-sink boot followed by a hotplug that lights and reads EDID. If there is no bench time, the sinkless rows plus the J473 cold-attach row, with hotplug filed as a known gap.

@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 3118a5d after remaining integration requirements.

Checked: The host fixtures now model the sink predicate and lock-protected late-notification state. They cover the no-sink wait skip and one-time legacy re-probe without changing the production path in the follow-up.

CI and the J616s and M1/M2 sinkless boot plus EDID hotplug cases remain.

@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed ci-failing A check failed at the PR head (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 3118a5d in combined candidate cedaeff9ee2fe5396733351bb571d0a6049bd7fc on main aa76613: boot with no HDMI sink (HDMI-A-1 disconnected), together with #3126 -> PASS (0 dcp/dpav/dptx EDID discovery 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.

Conflicts were mechanical: main added linux/slab.h and the match-data
DPAVSERV endpoint (hw.dpavserv_endpoint, T6050 dcpext0 case) next to
this branch's gpio include, dcpavserv lock/late_notify mock fields and
the sinkless start cases. Both kept.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Forward-merged main into this branch (merge commit only, no rebase), new head 16b9d76.

Conflicts were mechanical. In dpavservep.c, main added <linux/slab.h> next to this branch's <linux/gpio/consumer.h>, and I kept both. In edid.py's dpavserv-start harness, main (#3609) added hw.dpavserv_endpoint and a T6050 match-data endpoint case next to this branch's lock/late_notify mock fields and sinkless cases, and I kept both and merged the PASS line. dpavservep_init() auto-merged: main's match-data endpoint selection sits before the wire_v2 return, and this PR's sink check and late re-probe are unchanged after it.

Tests at the merge: apple-dcp host tests (run.py via run-host-tests.py) 98/99. dpavserv-start, service-rebind, provider-admission, publication-hpd and panel-dimensions all pass. The one failure, probe-transaction-rollback (cd321x_replug_kept_attach undeclared in the harness), fails the same way on plain main 94104a6 (#3587), so it is not from this PR. afkv2 host tests 2/2. W=1 arm64 LLVM=1 build of drivers/gpu/drm/apple/epic/dpavservep.o (defconfig + asahi.config): clean.

The merge changed none of this PR's code, so rows at 3118a5d would carry over. Still needed: the rows the triage lists (sinkless and with-sink legacy start, second legacy family) and App verdict at head.

@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: HOLD at 16b9d765 for hosted checks and the remaining hardware evidence.

Checked: The include resolution retains GPIO and allocation declarations. The startup fixture retains the match-data endpoint case alongside the sinkless legacy and one-shot late notification cases. The pending hardware coverage is a sinkless boot followed by display hotplug and EDID read on J616s and an M1 Pro/Max or M2 peer.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) ci-failing A check failed at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Nov 30, 2026

@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 16b9d765db9d

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: The include resolution retains GPIO and allocation declarations. The startup fixture retains the match-data endpoint case alongside the sinkless legacy and one-shot late notification cases. The pending hardware coverage is a sinkless boot followed by display hotplug and EDID read on J616s and an M1 Pro/Max or M2 peer.

Follow-ups (not blocking): hosted checks; sinkless boot + hotplug EDID row on J616s

This branch has not been deployed

No deployments
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-hw-row No hardware row at the PR head (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