Skip to content

drm/apple: say when the 180 Hz probe runs out; document the T8140 refused-idle retry - #2365

Closed
RyanTheTide wants to merge 2 commits into
mainfrom
hack/drm-connect-retry-b
Closed

RyanTheTide wants to merge 2 commits into
mainfrom
hack/drm-connect-retry-b

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Two bounded retries in drivers/gpu/drm/apple run on assumptions nothing has shown yet:

  • dcp_180hz_retry() (dcp-180hz.c, from a7a7e2f) re-probes the connector up to 8 times, 300 ms apart, while a 1920x1080 at 180 Hz exception mode is pending but not yet proven on an H17P Type-C connection. Each input of the proof already has an event that probes again, so this is a poll, and when it ran out it stopped silently: the mode was just not offered.
  • dcp_s2r_quiesce() (dcp.c, T8140 suspend-to-RAM from d9b438c by Diljit Singh) retries a refused RTKit idle once after a mailbox poll and a fixed 30 ms sleep, assuming queued messages were the cause. The one recorded refusal on a J700 was refused again.

Change

Testing

  • arm64 LLVM build of drivers/gpu/drm/apple/dcp.o and dcp-180hz.o with W=1 on the release config: 0 warnings.
  • tools/testing/selftests/drivers/gpu/apple-dcp host suite: 88/88 ok, including the updated bounded-retry.
  • KUnit not run: the apple DRM KUnit suites run on target only.

Still to run

Hardware rows
  • Neo (T8140 J700) with a 180 Hz capable DP sink: plug and 3 replugs; dmesg | grep -c "180 Hz exception mode still not offered" = 0 when 1920x1080@180 is listed in modetest/kscreen-doctor; if the mode is missing, exactly 1 such line per connection, naming which fact is missing.
  • Neo with a 60 Hz-only monitor: 0 such lines (the path only runs for a pending exception mode).
  • J616s, M1 Pro, M2: not H17P external; dcp_180hz_init() returns early there. Boot plus external display up as a no-regression check, 0 such lines.
  • s2r comment: no row needed.
Hardware rows (combined test kernel, 2026-11-20)

This change was booted in a combined test kernel: integration/aurora 0abc2f3 plus the open gate-sweep drafts plus this and the related drafts (7.3.0-aurora-hk2/pwr1/hk3). It ran once on each lab Mac (M1 Pro J316s, M2 J413, J616s, Neo J700) and was compared against the production kernel on the same Mac, using the same silent row script:

  • kernel errors, failed units and SELinux denials;
  • microphone capture byte counts;
  • camera frame counts;
  • USB speeds;
  • panel brightness steps;
  • every retry/refusal message these drafts touch;
  • 2 s2idle cycles on M1 Pro, M2 and J616s.

M1 Pro, M2 and J616s matched production on every row, apart from the new counters and lines the drafts add. The Neo row found the old-DTB display regression that #2358's follow-up commit fixes.

This PR: "180 Hz exception mode still not offered": 0 on all four Macs (no 180 Hz sink attached).

While a 1920x1080 at 180 Hz exception mode is pending on an H17P
Type-C connection but not yet proven, get_modes calls
dcp_180hz_retry(), which probes the connector again up to 8 times,
300 ms apart. After the 8th probe it stopped without a word, and the
mode was simply not offered.

Each input of the proof already has an event that probes again (the
link rate and lane facts and the firmware announcement through
dcp_180hz_notify(), the AV service through its publication, a new
catalog through dcp_180hz_catalog_changed()), so the re-probe is a poll.
It is kept until every order of arrival is shown to be covered by one
of those events, tracked in
#2346.

Name its bound and delay, and warn once when it runs out, with whether
the current connection's link rate and lane facts are proven, so a
missing 180 Hz mode can be told from a missing event. The count goes to
DCP_180HZ_PROBE_RETRIES + 1 to mark the warning as given; a new
connection or proof resets it as before. The host selftest checks the
bound, the single warning and the reset.

Signed-off-by: Ryan Murray <[email protected]>
dcp_s2r_quiesce() retries a refused RTKit idle once, after polling the
mailbox and a fixed 30 ms sleep, on the assumption that the firmware
still had messages queued. Nothing shows that assumption: the one
recorded refusal on a J700 (-62 after 1137 ms) was refused again and
went down the undo path.

Say so at the retry and point at
#2347, which tracks
counting both outcomes and then either removing the retry or waiting on
the condition the sleep stands for. No functional change.

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

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. drivers/gpu/drm/apple/dcp-180hz.c:312-324 warns when the probes run out, but nothing checks whether the proof has actually finished, and finished as no. dcp_180hz_pending() (:249) doesn't look at dcp_180hz_payload(). So when the link rate and lane count are both current but the trained link can't carry the 414 MHz mode (:141, :174), for example a lower-rate cable or sink, the mode stays "pending": get_modes retries 8 times and then prints "still not offered ... (link rate proven, lane count proven)". That's a kernel warning on every connection of a working setup that simply can't do 180 Hz, and it reads like a missing event. Before scheduling a retry or warning, return without either when both facts are current and the payload check fails, so the warning only fires when a fact is really missing. Then cover the proven-but-too-slow case in rate.py's retry() (the stub dcp_180hz_fact_current() already lets you set both facts).

The rest is fine:

  • The count reaches DCP_180HZ_PROBE_RETRIES + 1 only once per generation, so the warning is once per connection, and the selftest shows the reset.
  • The facts are read under metadata.lock, as at :135-141.
  • The dcp.c hunk is comment-only.

HW row: the combined-kernel row had no 180 Hz sink, so the new path never ran. Neo (J700) on this head with a 180 Hz DP sink over Type-C: 1920x1080@180 listed and 0 warning lines over a plug and 3 replugs. Then with a lower-rate cable or adapter: the mode not listed and 0 warning lines. 0 AVC, 0 failed units, no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Folded into #2387, which now carries this PR's commits unchanged (merge commit); review continues there.

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.

1 participant