Skip to content

drm/apple, phy: apple: atc: key the H17P external and T8140 DP paths on firmware and DT data, not the board - #2370

Merged
DjDeveloperr merged 4 commits into
mainfrom
sweep/display-gates
Nov 26, 2026
Merged

DjDeveloperr merged 4 commits into
mainfrom
sweep/display-gates

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Three checks in the display stack test the board (apple,j700) when another check already decides:

  • drivers/gpu/drm/apple/iomfb.c dcp_external_zero_reply() (08b540f): the D134 zero reply requires the H17P external method profile, apple,j700 and apple,t8140-dcpext. Only the apple,t8140-dcpext match data sets that profile, and probe admits it only for the supported firmware release.
  • drivers/gpu/drm/apple/dcp.c dcp_h17p_external_supported() (a7a7e2f): checks apple,j700 before the compatible and the apple,firmware-version/apple,firmware-compat check, which is the real gate.
  • drivers/phy/apple/atc.c atcphy_load_t8140_dp() (7f67eba): returns -EOPNOTSUPP unless apple,j700. Only has_t8140_dp PHYs call it, and the lists it applies are DT properties. Without them it already returns -EINVAL, and the caller warns.

The comment on the external HDR brightness hints (2bec709) says "H17P only, for now". It is stale and does not give the real reason for the scope.

Change

  • D134 reply: keyed on the H17P external method profile alone.
  • H17P external admission: the machine check is dropped. The apple,t8140-dcpext compatible and the firmware-version/compat table decide.
  • ATC PHY DP lists: the machine check is dropped. The PHY match data and the presence of the DT lists decide. The function keeps its name because a PHY layout flag selects it, not a board.
  • HDR hints: comment only. set_parameter_dcp exists in every firmware's method table, but parameters 3 and 6 are defined per firmware build. macOS was seen sending them only on the H17P external firmware (26.6.2) and on firmware 27, so the scope stays on those two firmware ABIs.
  • The apple-dcp host selftests are updated to match. The D134 dispatcher test now expects the reply from the method profile alone. The admission test asserts that the machine is never consulted.

Why this is safe: apple,t8140-dcpext and apple,t8140-atcphy appear only in the J700 device trees, and on J700 every changed predicate gives the same result as before. No other SoC reaches the changed code.

Kept as is (sweep of drivers/gpu/drm/apple)

About 114 compatible checks were classified, by firmware ABI, IP-block compatible, board loader quirk, per-board data, or generalizable. Two J700 loader quirks stay: the single-zero apple,iomfb-surfaces encoding and the missing provider-table properties. Both describe what the J700 loader passes. The J714s-scoped firmware 27 paths and the per-SoC crossbar checks are generalizable, but this change leaves them alone because they interleave with other open display work and need hardware rows on boards not covered here.

Testing

  • Build: make LLVM=1 W=1 drivers/gpu/drm/apple/ drivers/phy/apple/ with the release config. Baseline and patched both pass. No warnings before or after.

  • checkpatch --strict: clean on all four patches.

  • tools/testing/selftests/drivers/gpu/apple-dcp/run.sh (ASan/UBSan): 88/88 pass before and after. This includes the 15,552-case D134 dispatcher test.

  • Hardware (one-shot test kernel 7.3.0-aurora-swl1 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):

    • T8140 J700 (the only machine reaching the changed checks; DTB-only trial + test kernel): appledrm bound, eDP connected and DP-1 state as on production, 0 DCP/IOMFB errors, 3 s2idle cycles rc=0, 0 AVC. Dock DP hotplug was not exercised (night, no physical replug).
    • T6040 J616s, T6000 J316s, T8112 J413: boot with DCP bound, no new DCP lines.

Still to run

  • Neo (T8140 J700) with an external display on the dock: connector connected in /sys/class/drm/*/status, modes listed by modetest, no "unknown callback", "DisplayPort tunable bundle unavailable" or "Unsupported external display" in dmesg. Pending.
  • J616s (T6040) HDMI + internal panel: both connected, dmesg clean. Pending.
  • M1 Pro (T6000), M2 (T8112): boot with DCP bound, dmesg clean. Pending.

Original code: Ryan Murray (D134 reply, H17P external admission, T8140 DP lists, HDR hints).

…board

dcp_external_zero_reply() answered the async D134 record with a zero
reply only when the method profile was H17P external and the machine
was apple,j700 and the node apple,t8140-dcpext.

D134 is a record of the H17P external firmware ABI. The method profile
already names that ABI: only the apple,t8140-dcpext match data sets it,
and probe admits such a processor only when its apple,firmware-version
and apple,firmware-compat name the supported release
(dcp_h17p_external_supported()). The machine and compatible checks
decided nothing more. Key the reply on the method profile alone.

No change on J700, the only board with this processor. The apple-dcp
host selftest now expects the reply from the method profile alone.

Fixes: 08b540f ("drm/apple: answer the measured J700 external D134 record")
Signed-off-by: Ryan Murray <[email protected]>
… board

dcp_h17p_external_supported() returned false unless the machine was
apple,j700, before checking the processor's compatible and its
apple,firmware-version/apple,firmware-compat against the supported
firmware release.

The external H17P path depends on the display processor (the
apple,t8140-dcpext compatible, whose match data selects the H17P
external method profile) and on the firmware release the loader
describes in the device tree. The board is not part of either. Drop the
machine check and keep the compatible and firmware checks, so the
firmware table is what admits the path.

No change on J700, the only board with this processor. The apple-dcp
host selftest now checks that the machine is never consulted.

Fixes: a7a7e2f ("drm/apple: Compose the qualified J700 external display path")
Signed-off-by: Ryan Murray <[email protected]>
…t the board

atcphy_load_t8140_dp() returned -EOPNOTSUPP unless the machine was
apple,j700. The caller only runs it for a PHY whose match data has
has_t8140_dp (apple,t8140-atcphy), and the lists it applies are device
tree properties passed by the bootloader. A node without them already
fails the length check with -EINVAL, the caller warns, and dp_tunables
stays false.

Drop the machine check: the PHY compatible and the presence of the DT
lists decide. The function keeps its name because has_t8140_dp, not a
board, selects it.

No change on J700, the only board with this PHY.

Fixes: 7f67eba ("phy: apple: apply the T8140 DisplayPort setup lists")
Signed-off-by: Ryan Murray <[email protected]>
The comment above dcp_external_hdr_hints() said only the H17P external
path sends the hints "for now". The call site has since added unpaired
firmware 27 external processors, and the reason the hints are not sent
everywhere is the firmware ABI: every firmware has set_parameter_dcp,
but the parameter numbers are defined by each firmware build, and macOS
was seen sending these two only on the H17P external firmware (26.6.2)
and on firmware 27. Say so. No functional change.

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

Copy link
Copy Markdown
Contributor Author

J700 (MacBook Neo) row, from one combined test kernel (integration b4cd7b3 plus this PR, #2477, #2474 and #2299), one-shot boot, compared against the production kernel:

  • eDP connected, enabled, 1 mode.
  • 0 unknown callback / tunable bundle unavailable / Unsupported external display lines, before and after a 30 s s2idle.
  • Not covered: the external path. Nothing was plugged into the dock's DP output (DP-1 disconnected on both kernels), so this row doesn't show the external display being keyed. That still needs a row with a monitor on the dock.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

No blockers.

What I checked at 3719db6: DCP_IOMFB_METHODS_H17P_EXTERNAL comes only from apple_dcp_hw_t8140_external (drivers/gpu/drm/apple/dcp.c:9637). Probe refuses an apple,t8140-dcpext node whose firmware the table does not admit (dcp.c:6965-6969), and component matching applies the same check (apple_drv.c:1467). So the profile-only D134 test at drivers/gpu/drm/apple/iomfb.c:2062-2065 cannot be reached without the admission check. has_t8140_dp is set only by the apple,t8140-atcphy match data (drivers/phy/apple/atc.c:7969). Without the DT lists, atcphy_load_t8140_dp() returns -EINVAL before it touches any register, and the caller only warns (atc.c:6480-6485), so dropping -EOPNOTSUPP changes nothing except the warning's errno on a node without lists. The HDR-hint change is a comment only. On J700 every changed predicate evaluates as before. CI host-tests pass and the branch merges cleanly.

HW row: J700 (T8140) on 3719db6 + integration with a monitor on the dock's DP output. The connector should read connected with modes listed, D134 should be answered, and dmesg should show no "unknown callback", "DisplayPort tunable bundle unavailable" or "Unsupported external display" lines across a replug and 3 s2idle cycles, with 0 AVC and 0 failed units. The posted J700 row had DP-1 disconnected, so the D134 reply and the DP lists were not exercised.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The DT and firmware-based display path selection is still needed. Head 3719db6faf64 replays cleanly onto integration/aurora 5441428d9033. Nine arm64 objects built, including the DCP and ATC objects and all six IOMFB variants that include the changed template. The Neo dock DisplayPort row remains open.

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

Pre-PR checklist (§1–§6) review at 3719db6faf644dd9b143c325fc23535989f216d1 (host-tests: SUCCESS; not superseded on integration/aurora).

Technical verification

All four commits apply cleanly onto live integration/aurora and have no code blockers:

  • dcp_external_zero_reply() (drivers/gpu/drm/apple/iomfb.c): keying on DCP_IOMFB_METHODS_H17P_EXTERNAL alone is safe because only apple_dcp_hw_t8140_external (apple,t8140-dcpext) sets that profile, and dcp_probe() / apple_drv.c gate it via dcp_h17p_external_supported().
  • dcp_h17p_external_supported() (drivers/gpu/drm/apple/dcp.c): removing of_machine_is_compatible("apple,j700") leaves the apple,t8140-dcpext compatible and exact apple,firmware-version/apple,firmware-compat checks in control.
  • atcphy_load_t8140_dp() (drivers/phy/apple/atc.c): removing of_machine_is_compatible("apple,j700") is safe because only apple,t8140-atcphy sets has_t8140_dp, and missing DT lists already fail cleanly with -EINVAL before touching registers (dp_tunables stays false).
  • dcp_external_hdr_hints() (drivers/gpu/drm/apple/iomfb_template.c): comment-only update accurately matching live call sites.
  • tools/testing/selftests/drivers/gpu/apple-dcp/lifecycle.py: updates both admission and D134 dispatcher host tests cleanly (minor non-blocking nit: dispatcher() stubs of_machine_is_compatible/of_device_is_compatible could assert(false) like lifecycle() does).

Blockers

  1. §5 Hardware evidence — Neo (T8140 J700) external DisplayPort dock row remains open:
    • The posted J700 boot (on a combined multi-PR test kernel, without failed units reported) had DP-1 disconnected, so neither the external D134 callback path (dcp_external_zero_reply()) nor active DisplayPort bring-up using the loaded T8140 tunables was exercised on hardware.
    • As already noted in ## Still to run and the 2026-11-23 comment, please post a live-head J700 run with an external DisplayPort monitor connected via the dock: connector connected with modes listed, replug + 3x s2idle, 0 unknown callback / DisplayPort tunable bundle unavailable / Unsupported external display / new kernel errors, 0 SELinux denials, and 0 failed units.

Checklist (§1–§6)

  • §1 No model gating: Pass (removes three redundant apple,j700 board checks in favor of IP compatible, firmware ABI, and DT property presence).
  • §2 Production-ready: Pass (default command line, no hacks).
  • §3 Safety: Pass (firmware admission and DT property validation remain intact).
  • §4 Clean-room and attribution: Pass (all 4 commits b66c454609e3, 89d2a67a18de, 03f5ad5410b9, 3719db6faf64 carry human author/committer and Signed-off-by: only, zero AI commit trailers; plain Assisted-by: in PR body).
  • §5 Evidence: Incomplete — see Blocker #1.
  • §6 Naming: Pass.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:usb Area from CODEOWNERS (bot) changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Merge readiness at 3719db6f: ready to merge

Check Detail
CI at head ok 1 check passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at 3719db6f
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: area:display, area:usb
Merge: gh pr merge 2370 --merge (Owners and Core through the bypass: add --admin).

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

@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 3719db6faf64: the code is ready; it needs only a row at this head.

Blockers: none in the code. Missing row: the J700 boot had DP-1 disconnected, so neither the external D134 path nor DP bring-up with the loaded T8140 tunables ran. Needed: one J700 run at this head with an external DP monitor on the dock, the connector connected with modes listed, and a replug and an s2idle with no unknown callback, tunable bundle unavailable or Unsupported external display lines. The Neo lead will run it.

Checked: no Apple material. This removes three apple,j700 board checks. The apple,t8140-dcpext compatible with the exact firmware-version/compat checks, has_t8140_dp on apple,t8140-atcphy, and the DT tunable lists now decide, and a missing list still fails with -EINVAL before any register is touched. The selftests pass 88/88 under ASan/UBSan. CI green. This replaces my earlier review.

Evidence

Read the four commits. Nit: the dispatcher() stubs in lifecycle.py could assert(false) like lifecycle() does.

@DjDeveloperr
DjDeveloperr dismissed their stale review November 24, 2026 19:42

Superseded by the review at 3719db6

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) ready-to-merge Meets the merge policy: merge it (bot) labels Nov 24, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

3719db6faf64 (batched cleanly in J616s Batch #3 cc59e9b94d16 over main 7c0c2fc25ffc, 0 merge-tree diffs across all 5 changed files) J616s (MacBook Pro 16" M4 Pro, T6040, Apple M4 Pro (G16S B1), macOS 26.6.2 fw, guarded one-shot 7.3.0-aurora-pr2905+, default cmdline, stock Stage 2 1.0.0b17, boot_id=01629efb) PASS: 0 failed units, Enforcing, 0 new AVC (1 matching baseline), 0 GPU faults, 0 subsystem errors, real rtc1 s2idle 2/2 (success=2 fail=0), eDP connected pre/post-sleep, 406600000.sep + 514600000.mtp RTKit v12 clean, Borealis VK dEQP-VK.api.smoke.* 8/8 (pre & post-sleep) + glsl.loops.* 624/624, Wi-Fi 3/3 ping pre/post-sleep; stock 7.3.0-aurora-fleet89 restored & verified (946097c2).

@github-actions github-actions Bot added the ready-to-merge Meets the merge policy: merge it (bot) label Nov 26, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

3719db6faf64 Neo (J700, T8140, external DP-1 on dock, merged cleanly onto main 6563be47b560 with 0 changed-file diffs, default cmdline) PASS: card1-DP-1 connected with 34 modes (1920x1080), 1/1 USB-C/DP unplug/replug (sn201202x 1-0c unbind -> disconnected -> bind -> connected, 34 modes), 1/1 rtc0 (apple-pmu-rtc) s2idle wake (connected, 34 modes), 0 forbidden dmesg strings (unknown callback / DisplayPort tunable bundle unavailable / Unsupported external display), 0 DCP/DISPEXT0/ATC errors, 0 failed units, Enforcing, 0 new AVC, Wi-Fi 3/3; stock 7.3.0-aurora-fleet89 restored and verified.

@DjDeveloperr
DjDeveloperr merged commit 61c7b88 into main Nov 26, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the sweep/display-gates branch November 27, 2026 13:21
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) area:usb Area from CODEOWNERS (bot) needs-template PR body lacks Tested or Risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants