Skip to content

drm: apple: interim: refuse external modes beyond the v27 provider clock - #3457

Merged
RyanTheTide merged 4 commits into
mainfrom
fix/dcp-v27-provider-clock-ceiling
Nov 28, 2026
Merged

RyanTheTide merged 4 commits into
mainfrom
fix/dcp-v27-provider-clock-ceiling

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What

On an M2 mini (J473, firmware 27.2) an external 2560x1440 monitor on USB-C shows only a thin strip at the top of the picture at 240 and 280 Hz; 144 Hz is whole. It happens on either display processor, SDR and HDR.

The firmware's mode set matches macOS line for line. The difference is the display clock:

  • Firmware 27 compares a mode's video clock (half the pixel clock) with the provider clock it reads with getClockFrequency(0), 360 MHz here. Above it, the firmware logs getClockFrequency(0) (360000000) < videoClock 484700000! Giving up on frequencies and leaves raising the display clock to the SoC power manager (PMP), which acts on the pipe's bandwidth vote ("RTBandwidth: Using Dashboard").
  • On T8112 the display clock is a PMP DVFS domain (the PMP's dvfs-domain lists DISP with 4 states). Linux does not run the T8112 PMP: its ASC CPU control reads 0 under Linux. On a J616s, which drives the same monitor at 280 Hz on Linux, it reads 0x10 (running).
  • 1440p at 280 Hz needs about 4.3 GB/s; with the PMP off, T8112 memory already gives 42-60 GB/s (T8112: run the PMP with the CPU and ANE memory and fabric floors (opt-in) #1637), so memory bandwidth is not the limit.

This change offers an external display on firmware 27 only the modes its provider clock scans: dcp_mode_valid() returns MODE_CLOCK_HIGH when the pixel clock is more than twice the provider clock. GNOME then picks the best remaining mode (1440p165) instead of a mode that shows a strip.

Scope comes from the device tree, not a SoC list: a firmware-27 DCP with a provider clock table, on a non-eDP connector, while the processor has no PMP display request in the device tree (apple,pmp-report; mode validation reads only the device tree and never starts or waits on the PMP). Today that means the T8112 external ports. T8142 external processors also carry provider clocks (firmware-0/1) and are covered once enabled (same firmware-27 give-up path). Processors without a provider clock table (T6041/T8122 dcpext), the M4 path and internal panels are unchanged.

The real fix is running the T8112 PMP with a display vote, as the J713 has (pmp-display bridge). The limit steps aside for a processor once its device tree carries a PMP display request (its display then starts only after the PMP acknowledges it). That work is tracked separately.

Tested

  • Build: arm64 LLVM, checkpatch --strict clean.
  • J473 (M2 mini, T8112, 27.2), one-shot boot of this change on main 30dd09b: the MSI on USB-C offers 2560x1440 at 165/144/120/60 Hz (180/240/280 withdrawn), 1920x1080@240 kept; the Acer on HDMI keeps its full list (1080p180 live). The boot mode set is 2560x1440@164, then GNOME's saved 144. No "Giving up on frequencies" line in the whole boot. Restored to the saved kernel.
  • Regression, same kernel, one-shot boots: J616s (T6041) internal panel and Neo (T8140) internal panel: Mutter mode lists identical to production, DCP firmware log lines identical to production. Neither has a provider clock table, so the guard is inert there.
  • Production J473 at 143/164/179/239 Hz: the firmware's "videoClock" is pixel clock / 2 at each rate (333.2 MHz at 164 Hz, 363.5 at 179, 484.7 at 239); the clock line first appears at 179 Hz.

Risk

Risk: two-way · M2 (T8112) external displays on firmware 27.

A mode the monitor could actually show is hidden on T8112 externals: every pixel clock above 720 MHz (2x the 360 MHz provider clock): 2560x1440 above 165 Hz, single-stream 4K above about 75 Hz, 5K at 60 Hz. That is the set that shows the strip today. A mode userspace forces (custom modeline) still reaches the commit path, as before.

Not yet

An eye check of the MSI at 164 vs 179 Hz on production (queued) to pin the visible threshold to the provider clock. The proper fix (T8112 PMP with a display vote) is separate work.

Firmware 27 compares a mode's video clock (half the pixel clock) with
the provider clock it reads with getClockFrequency(0). When the video
clock is higher it gives up scaling and leaves raising the display
clock to the SoC power manager, which acts on the pipe's bandwidth
vote. Linux runs no power manager that does that, so the pipe stays at
the provider clock: on an M2 mini (T8112) an external 2560x1440
display shows only a strip at the top at 240 and 280 Hz (video clock
485 and 565 MHz against a 360 MHz provider clock), while 144 Hz is
whole.

Offer an external display on firmware 27 only the modes its provider
clock scans. Internal panels and processors without a provider clock
table are not affected.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 28, 2026 02:39
@RyanTheTide
RyanTheTide requested review from a team as code owners November 28, 2026 02:39

@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: FINISH, then merge at 52bda7ae

Blockers: none in the code as it stands. Three items to finish before it leaves draft:

  1. drivers/gpu/drm/apple/iomfb.c dcp_mode_beyond_provider_clock(): the guard is keyed on "firmware 27 + provider clock table + not eDP". The cause the commit names is that nothing acts on the pipe's bandwidth vote. Key the guard on that too: apply it only when this DCP has no PMP display path (no apple,pmp-report link, or the report is not ready), next to the existing checks. Then the limit steps aside by itself once a T8112 PMP display vote lands, as the PR says it should, instead of needing someone to remember to remove it. Today the result is the same: T8112 has no apple,pmp-report.
  2. Scope note: M2-COMBINE's DTB scan (traces/kernel/20261128-peer-m2combo25/m2strip-3457-provider-coverage.txt) shows that the four T8142 external DCP nodes (J813/J815) carry firmware-0/1 provider clocks, so the guard applies to them once they are enabled. That is right if their PMP doesn't vote under Linux either, because it is the same firmware 27 give-up path. Say so in the commit message and Risk ("today T8112 externals; also T8142 externals when enabled") rather than "only T8112".
  3. Rows: the block is on both T8112 boards, so add a J413 external-display row (mode list before and after, no "Giving up on frequencies" line), next to J473 and the inert J616s/Neo regressions.

Checked: The arithmetic matches the firmware's comparison: it gives up when videoClock > getClockFrequency(0) with videoClock = pixel/2, and the guard is clock_kHz * 1000 > 2 * rate, in u64 with no overflow. rate is the same clock the driver answers getClockFrequency(0) with, so they cannot disagree. A zero rate, a missing table, the T6041/T8122 dcpext early return, explicitly empty tables (T602x) and eDP all fall through to the old path. clk_get_rate() can sleep, which is fine here: .mode_valid is called only from the connector probe helpers and KUnit. No SoC or board gate, no new parameter.

Evidence and notes
  • Read at 52bda7ae: the diff, dcp.c dcp_firmware_clocks_v27() (the internal-panel disp0 fallback, the T6041/T8122 dcpext early return, empty tables, the firmware-N named clocks for T8142), the dcp_mode_valid() callers (apple_drv.c:1201 connector helper, parser-test.c KUnit), and the apple,pmp-report users in the device trees (t6031, t8122, t8132, t8140; none for t8112 or t8142).
  • Not blocking:
    • The connector .mode_valid only filters the probed list. A mode that userspace forces (a custom modeline) still reaches the commit path and would still show the strip. That is no worse than today.
    • Risk lists only 1440p above 165 Hz. With a 360 MHz provider clock, the cut is a pixel clock above 720 MHz, so single-stream 4K above about 75-80 Hz and 5K60 are withdrawn on T8112 externals too. Worth one line, because users of those monitors will notice.

The limit on external modes beyond the provider clock exists because
nothing on Linux acts on the pipe's bandwidth vote. Apply it only while
no running PMP has acknowledged this processor's display request
(apple,pmp-report), so it steps aside by itself once a PMP display vote
lands for the SoC.

Scope today: T8112 external ports (the boot loader gives them a 360 MHz
provider clock). T8142 external processors also carry provider clocks
(firmware-0/1) and are covered once enabled, the same firmware-27
give-up path. On T8112 the cut is a pixel clock above 720 MHz, so
2560x1440 above 165 Hz, single-stream 4K above about 75 Hz and 5K at
60 Hz are not offered there.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Thanks. All three addressed at 3dae134:

  1. Keyed on the missing PMP display path: new dcp_pmp_display_ready() (dcp.c) asks the PMP report, without waiting, whether a running PMP has acknowledged this DCP's apple,pmp-report request; the limit applies only when it has not (no phandle, no report, or not acknowledged). T8112 has no apple,pmp-report, so the result is unchanged today, and the limit steps aside by itself once a T8112 PMP display vote lands.
  2. Scope and Risk: the second commit message and the body now say "today T8112 externals; T8142 externals once enabled" and list what a 720 MHz pixel-clock cut withdraws (2560x1440 above 165 Hz, single-stream 4K above about 75 Hz, 5K60). The forced-modeline note is in Risk.
  3. J413: on the live J413 (fleet89) neither DCP node has apple,clock-ids and clk_summary has no DCP firmware clocks (it runs the 13.5 DCP firmware). So the guard cannot apply there, the same inert case as the J616s and Neo rows, and the J413 has no external display attached right now. The block that reaches the guard is the J473 (27.2). I'll repeat the J473 row on 3dae134 and post it here.

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

The zero-timeout mode validation calls dcp_ext_pmp_wait_ready(), which reaches apple_pmp_start_wait(). That function queues PMP startup before checking the completion, even with a timeout of zero. A connector mode query can therefore start firmware asynchronously and reject the mode on this pass, with no demonstrated connector reprobe after the acknowledgement. Please use a side-effect-free readiness query for mode validation, keep startup on the enable path, and cover the first mode scan and subsequent acknowledgement on J473.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m2 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at 107a6de0: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
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 107a6de0
Conflicts ok none
PR text ok Risk: two-way · M2 (T8112) external displays on firmware 27. A mode the monitor could actually show is hidden on T8112 externals: every pixel clock above 720 MHz (2x the 360 MHz provider clock): 2560x1440 above 165 Hz, single-stream 4K above about 75 Hz, 5K at 60 Hz. That is the set that shows the strip today. A mode userspace forces (custom modeline) still reaches the commit path, as before.

Areas: area:display

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

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J473 row repeated on 3dae134 (one-shot, production Stage 2): the MSI on USB-C offers 2560x1440 at 165/144/120/60 Hz (180/240/280 withdrawn), 1920x1080@240 kept; the Acer on HDMI keeps 1080p180. Boot mode set 2560x1440@164, then GNOME's saved 144. No "Giving up on frequencies" line this boot. Restored to the saved kernel (Enforcing, 0 failed units, 0 AVC).

Mode validation asked the PMP report whether the display request was
acknowledged, with a zero timeout. That call also queues the PMP start
when the PMP is halted, so a connector probe could start firmware as a
side effect.

Read only the device tree instead: the limit applies while the
processor has no PMP display request (apple,pmp-report). A processor
with one starts its display only after the PMP has acknowledged the
request, and the PMP then scales the display clock. T8112 has none
today, so its external ports keep the limit until a PMP display vote is
added for it.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Right: apple_pmp_start_wait() queues the start even with a zero timeout. Fixed in 25276a9. Mode validation no longer calls into the PMP report. The limit applies while the processor has no PMP display request in the device tree (apple,pmp-report), checked with of_property_present() only. A processor with a request starts its display only after its enable path has the PMP's acknowledgement (the existing dcpext/v14.7 start gates), and from then on the PMP scales the clock. So no probe-time start, and no mode list that depends on when the acknowledgement arrived, which removes the reprobe question. The dcp.c helper is gone.

On the J473 there is no apple,pmp-report today, so the first mode scan is the whole story there. I'll repeat the J473 row on 25276a9 (first scan after boot, then a hotplug-style reprobe via a mode list read after GNOME's modeset) and post it.

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

This removes the mode-query startup side effect. The new bypass tests for property presence, while dcp_ext_wait_pmp() only enforces the handshake for dcp_ext_dptx_607() or dcp_is_ext26(), and even there returns success when of_parse_phandle() fails. The mode guard can therefore step aside where startup never verified an acknowledgement. Please use a shared side-effect-free predicate that applies the same processor checks and resolves the phandle, or use a read-only acknowledged state from the startup path. Verify the fixed-clock and PMP-backed cases at the new head.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J473 row on 25276a9 (one-shot, production Stage 2): first mode scan after boot: the MSI on USB-C offers 2560x1440 at 165/144/120/60 Hz; the Acer on HDMI keeps 1080p180. Forced re-detect of both connectors (echo detect on each status file), then Mutter's list again: unchanged on both. No "Giving up on frequencies" line in the boot. Restored to the saved kernel (Enforcing, 0 failed units, 0 AVC).

…owledgement

A PMP display request in the device tree does not mean the start path
verified it: dcp_ext_wait_pmp() checks the acknowledgement only for
some external processors and starts without one when the phandle does
not resolve. Record the acknowledgement where a start path verifies it
(the DISPEXT wait, and the v14.7 and v26.6 starts that log 'PMP running
with the display request acknowledged') in pmp_display_acked, and lift
the limit only on that state. Mode validation reads only the recorded
state, so it never starts or waits on the PMP.

Move the comparison into dcp_provider_clock_limits() in iomfb-state.h
with a KUnit case: with the J473's 360 MHz provider clock, 2560x1440 at
165 Hz fits and 180 and 240 Hz do not; a PMP acknowledgement or a
missing provider clock limits nothing.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Agreed: a present phandle is not a verified handshake. Fixed in 107a6de. The start paths that verify the acknowledgement record it in dcp->pmp_display_acked: dcp_ext_wait_pmp() after a successful wait (not on its no-phandle or skipped paths), and the v14.7 and v26.6 starts that log "PMP running with the display request acknowledged". The limit is lifted only on that recorded state. Mode validation reads the flag (READ_ONCE) and nothing else, so it never starts or waits on the PMP.

The comparison moved into dcp_provider_clock_limits() (iomfb-state.h) with a KUnit case in apple-iomfb-mode-state. Fixed clock (J473, 360 MHz): 165 Hz (666.46 MHz) allowed, exactly 720 MHz allowed, 720.001, 180 Hz (727.05) and 240 Hz (969.4) limited. PMP-backed: the same 969.4 MHz allowed once acknowledged. No provider clock: nothing limited. Local run: arm64 QEMU, display.kunitconfig + CONFIG_DRM_APPLE_KUNIT_TEST=y, 10/10 passed.

No firmware-27 processor with a provider clock has a PMP acknowledgement on hardware today (T8112 has no apple,pmp-report), so the PMP-backed case is covered by KUnit only. The J473 fixed-clock row on 107a6de follows as soon as the J473 is free.

@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 107a6de after required CI and hardware evidence.

Checked: The mode query reads a flag set only after startup verified the PMP display acknowledgement. Missing links and failed handshakes never set it, and enumeration does not touch the PMP. I ran seven checks against the exact clock helper, including the equality boundary, zero provider clock and acknowledged PMP. Please refresh the J473 scan/redetect receipt at this head and include evidence for the PMP-backed startup path when qualifying that configuration.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J473 row at 107a6de (one-shot, production Stage 2): first scan: the MSI on USB-C offers 2560x1440 at 165/144/120/60 Hz (no 180/240/280); the Acer on HDMI keeps 1080p180. Forced re-detect of both connectors: Mutter's lists unchanged. No "Giving up on frequencies" line in the boot. Restored to the saved kernel (Enforcing, 0 failed units, 0 AVC). The PMP-backed path has no firmware-27 hardware yet (KUnit only); it gets its own row when T8112 gains a PMP display request.

@RyanTheTide RyanTheTide changed the title drm: apple: refuse external modes beyond the v27 provider clock drm: apple: interim: refuse external modes beyond the v27 provider clock Nov 28, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Code-owner ping (6-point merge rule, point 6): @aurora-silicon/core @aurora-silicon/omarchy-mac @aurora-silicon/aurora-maintainers, this touches drivers/gpu/drm/apple/ (owned by your teams).

State at head 107a6de: approved by aurora-silicon-review; J473 row m2strip-d PASS at this head; J616s and Neo rows inert PASS; KUnit for dcp_provider_clock_limits() passes locally. Hosted CI is running now.

Plan: if nobody objects within 1 h and CI is green, this is merged with --admin under the 6-point rule.
Rationale: an interim guard. Without it, J473 external modes above the v27 provider clock show only a top strip on the panel. It steps aside on its own once a start path records a verified PMP display acknowledgement.
Revert: git revert the 4 commits (52bda7a, 3dae134, 25276a9, 107a6de).

A review or objection from any of you blocks the merge.

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

Copy link
Copy Markdown
Contributor Author

Merging with --admin under the 6-point rule. Every point holds at head 107a6de:

  1. Adversarial review: approved by aurora-silicon-review (REVIEW6, a different lane from the author).
  2. Hosted CI: every check is green, including apple-build, kunit, host-tests and all KUnit suites. readiness is only the label bot; it was cancelled by its concurrency group, not failed.
  3. Hardware row at this head: J473 m2strip-d PASS. MSI modes are capped at 1440p165, Acer 1080p180 is intact, and both the first scan and a forced redetect pass.
  4. Regression rows on three families: M2 (J473), M4 Pro (J616s, inert) and A18 Pro (Neo, inert).
  5. No open blocking review.
  6. Code-owner teams pinged at 19:08 (issuecomment-7236385133); no objection after more than 1 h.

This is an interim guard. It steps aside on its own once a start path records a verified PMP display acknowledgement. The real fix is T8112 PMP plus a display vote.
Revert: git revert of the 4 commits 52bda7a 3dae134 25276a9 107a6de (or of the merge commit).

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:m2 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.

1 participant