Repository navigation
drm: apple: interim: refuse external modes beyond the v27 provider clock - #3457
Conversation
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>
There was a problem hiding this comment.
Verdict: FINISH, then merge at 52bda7ae
Blockers: none in the code as it stands. Three items to finish before it leaves draft:
drivers/gpu/drm/apple/iomfb.cdcp_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 (noapple,pmp-reportlink, 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 noapple,pmp-report.- 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/1provider 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". - 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.cdcp_firmware_clocks_v27()(the internal-panel disp0 fallback, the T6041/T8122 dcpext early return, empty tables, thefirmware-Nnamed clocks for T8142), thedcp_mode_valid()callers (apple_drv.c:1201connector helper,parser-test.cKUnit), and theapple,pmp-reportusers in the device trees (t6031, t8122, t8132, t8140; none for t8112 or t8142). - Not blocking:
- The connector
.mode_validonly 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 connector
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>
|
Thanks. All three addressed at 3dae134:
|
There was a problem hiding this comment.
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.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
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>
|
Right: On the J473 there is no |
There was a problem hiding this comment.
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.
|
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 ( |
…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>
|
Agreed: a present phandle is not a verified handshake. Fixed in 107a6de. The start paths that verify the acknowledgement record it in The comparison moved into No firmware-27 processor with a provider clock has a PMP acknowledgement on hardware today (T8112 has no |
There was a problem hiding this comment.
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.
|
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. |
|
Code-owner ping (6-point merge rule, point 6): @aurora-silicon/core @aurora-silicon/omarchy-mac @aurora-silicon/aurora-maintainers, this touches 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 Plan: if nobody objects within 1 h and CI is green, this is merged with A review or objection from any of you blocks the merge. |
|
Merging with
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. |
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:
getClockFrequency(0) (360000000) < videoClock 484700000! Giving up on frequenciesand leaves raising the display clock to the SoC power manager (PMP), which acts on the pipe's bandwidth vote ("RTBandwidth: Using Dashboard").dvfs-domainlists 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).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
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.