Skip to content

soc: apple: display-gate, drm/apple: start the M3 Air's (T8122) external DCP on its 27.2 image - #2704

Open
RyanTheTide wants to merge 5 commits into
integration/aurorafrom
j615-extmon/t8122-dcpext-272
Open

RyanTheTide wants to merge 5 commits into
integration/aurorafrom
j615-extmon/t8122-dcpext-272

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

On the macOS 27.2 (26B123) system firmware, the boot loader reserves the M3 MacBook Air's (T8122) external display processor (dcpext) firmware and publishes version and compatibility 27.2.0, but the display gate only admits a 14.7.0 dcpext. It refuses the 27.2 one ("its firmware-compat is not 14.7.0"), so neither USB-C port gets DisplayPort.

Change

One commit, stacked on #2688 (T8122 internal DCP on 27.2). It replaces #2584, whose base branch (#2580) was closed. The code is the same commit, cherry-picked without conflicts.

  • apple_t8122_dcpext_v27_2() admits a T8122 dcpext whose own firmware version and compatibility are 27.2.0, next to an internal DCP that was handed over on the 27.2 image. The selection uses the block's compatible and the firmware ABI, with no board check.
  • Gate: admits that dcpext next to 14.7.0. It copies the internal DCP DART's apple,dma-range (the 1 TiB alias) onto both external DARTs, because the device tree's 14.7 windows share none with the panel's, and the panel lost its scanout when the external processor joined.
  • DCP driver: firmware-27 backend with the 27.2 table and the firmware-27 endpoints, both DPTX ports, a cold start instead of live-session adoption (the DISPEXT domains are off at handoff), and no firmware clock table (like the T6041 dcpext).

The rest of the M4 Air (J713) external-display series (#2673) is not needed on T8122:

Testing

J615 (MacBook Air 15", M3), 27.2 stub, stock command line, the J615 default Stage 2 plus the aura default for the dcpext handoff (aurora-silicon/aura#437):

  • On today's fleet kernel (no 27.2 dcpext support) the gate leaves the dcpext disabled ("firmware-compat is not 14.7.0").
  • With this commit (fleet78 + this commit, same config):
    • the gate enables dcp@31ac00000 with both Type-C routes and both crossbars;
    • the external DCP boots on 27.2: "firmware 27: DPTX controller on 0x24, ports on 0x2a (advertised)", 2 AppleDCPDPTXRemotePort services, "DCP booted";
    • DRM has card1-DP-1 and card1-DP-2 (no sink attached), and eDP-1 stays connected at 2880x1800;
    • s2idle 1/1 with the dcpext up;
    • 0 DART faults, SError or crashes; Enforcing; 0 failed units.
Row detail
  • Boots were one-shots (aura-try Stage 2 + grub one-shot) on the stock fleet command line. The kernel is fleet78 5223420 plus this commit, with the fleet78 config verbatim. The T8122 J615 DTB is byte-identical to fleet78's.
  • With the dcpext admitted, its DISPEXT sys/fe/cpu power domains stay on while no monitor is attached. On the J615, three powered DISPEXT domains cost about 112 mW of total system power (ABBA A/B on the same machine). Runtime power-down of an idle dcpext is a separate change.
  • Lab traces: J615-EXTMON 20261122, rows A (fleet kernel) and B (this commit).

Build: W=1 clean on display-gate.o and dcp.o; checkpatch reports 0 errors and 0 warnings.

Still to run

  • A monitor on either USB-C port (modeset, hotplug).
  • The J613.

Assisted-by: LLM (Claude:Opus 5.5)

…its 27.2 image

On the macOS 27.2 (26B123) system firmware the boot loader can reserve
the T8122 external display processor's firmware (chosen
asahi,t8122-dcpext): it marks dcp@31ac00000 firmware-ready and
publishes firmware version and compatibility 27.2.0, but no image
UUID. The gate then refuses it ("its firmware-compat is not 14.7.0"),
so neither USB-C port gets DisplayPort alt mode.

The processor runs the internal DCP's 27.2 image: the first region the
boot loader reserves for it is the internal DCP's text region. Its
DISPEXT power domains are off at handoff, so nothing is running there
to adopt; Linux starts it, as it does the 14.7 one.

Add apple_t8122_dcpext_v27_2(): a T8122 dcpext whose firmware version
and compatibility are 27.2.0, beside an internal DCP handed over on the
27.2 image. The gate admits it alongside 14.7.0, and the DCP driver
runs it on the firmware-27 backend with the 27.2 table, with the
firmware-27 endpoints, both DPTX port services, no live-session
adoption, and without a firmware clock table, as the T6041 dcpext (it
has no apple,clock-ids; counting them failed the bind with -EINVAL).

On that image the processor and its scanout also use the panel's DMA
window, the 1 TiB alias. The display subsystem takes the window all
its display DARTs share, and the device tree's 14.7 windows for the
external DARTs (from 0) share none with the panel's: once the external
processor joined, the internal DCP lost its scanout mappings (DART
translation faults, no modes). When it admits the 27.2 image, the gate
copies the internal DCP DART's apple,dma-range onto both external
DARTs, as the J613 native 26.x device tree does for that firmware; the
device tree keeps the 14.7 windows.

The 14.7 and native 26.x paths are unchanged.

Tested on the J615 (MacBook Air 15", M3), 27.2 stub, stock command line,
its unchanged device tree and a boot loader that reserves the dcpext by
default: before, the gate refused the dcpext; with this change it starts
(RTKit, "firmware 27: DPTX controller on 0x24, ports on 0x2a", both DPTX
port services, "DCP booted"), DRM gains DP-1 and DP-2 for the two USB-C
ports, the internal panel stays connected, s2idle resumes, no DART
faults. No external monitor was attached.

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

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

Adversarial review of head 3d969657663738b87739591337c6ff04504374ff against the pre-PR checklist.

Stacking & dependency status

  • Stacked on aurora-silicon/linux#2688 (base=j615/t8122-dcp-27-2-standalone), which is still OPEN. Must not merge until #2688 lands and #2704 is retargeted onto integration/aurora.
  • Hard runtime dependency on aurora-silicon/linux#2526 (still OPEN): Without #2526, T8122 27.2 dcpext lacks remote-allocator advertisement gating, dcp_v27_dptx_layout() (DPTX_CONTROLLER_ENDPOINT 0x24 + DPTX_ENDPOINT 0x2a), and afk.c's dcp->dcpext EPIC identity handling — so t8122-dcpext on 27.2 cannot bring up DPTX at all on this branch alone.
  • Boot loader dependency: Default-on handoff without chosen.asahi,t8122-dcpext=1 depends on aurora-silicon/aura#437 (still OPEN; its current head 48fdf64a is not yet boot-tested on hardware).
  • CI gap due to stacking: SEP source checks (6/6) passed, but Host tests (host-tests.yml) did NOT run because it triggers only on integration/aurora / aurora-wip.

What checks out

  • No model/board gating & safe fallbacks: Uses apple,t8122-dcpext compatible + firmware version/compat + internal DCP handoff state; 14.7 and native 26.x paths are untouched; gate_t8122_dcpext() keeps existing CONFIG_DRM_APPLE and nomodeset (video_firmware_drivers_only()) guards so Type-C USB ports are never stranded without a display driver.
  • Attribution: Single commit with clean human authorship and Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>, no agent trailers; PR body ends with Assisted-by:.

Blockers

  1. Insufficient hardware evidence for external display enablement (Checklist §5 & §1):

    • No external monitor has been tested yet (PR body lists "A monitor on either USB-C port (modeset, hotplug)" and "The J613" under Still to run).
    • Booting with DP-1/DP-2 connectors unattached does not verify DP link training, EDID read, modeset, hotplug/unplug, or s2idle with a monitor attached (especially important given firmware-27 external DCP sleep behavior).
    • The J615 boot row also ran against aura#437 commit 1 (which logged OVERLAP DETECTED and skipped DART checks), not aura#437 head 48fdf64a.
    • J613 (M3 Air 13") has no boot row yet.
  2. Stacking, unmerged runtime dependency (#2526), and missing CI + unit tests:

    • Cannot land while base #2688 and runtime dependency #2526 remain open, and before retargeting onto integration/aurora so host-tests runs.
    • Unlike #2688, this PR adds no unit/KUnit/host tests for apple_t8122_dcpext_v27_2(), the dcp_check_firmware_version() apple,t8122-dcpext 27.2 arm, or gate_t8122_dcpext_alias() (e.g. in display-gate-test.c and tools/testing/selftests/drivers/gpu/apple-dcp/boot.py).

Non-blocking code issues & hardening notes

  • Stale comment & firmware_dma_bits consistency (drivers/gpu/drm/apple/dcp.c:7282-7289): The comment states "Its DART window is the one the device tree describes," but gate_t8122_dcpext_alias() overwrites the DT's 14.7 windows with the panel's 1 TiB alias (0x100_0000_0000 + 64 GiB). dcp->hw.firmware_dma_bits is also left 0 (falling back to 42 at dcp.c:6433), which covers the 41-bit window in practice but is inconsistent with the neighboring apple,t8122-dcp and apple,t6041-dcpext blocks (firmware_dma_bits = 41).
  • Stale refusal message (drivers/gpu/drm/apple/dcp.c:6021): Still logs "T8122 external display not started: DCP firmware-compat %s is not 14.7.0" even when 27.2 is now also supported (compare display-gate.c:1953, which was updated to "neither 14.7.0 nor the 27.2 image").
  • gate_t8122_dcpext_alias() hardening (drivers/soc/apple/display-gate.c:1905-1926): Check window->length == 2 * sizeof(u64) (16 bytes) rather than only window->length != 0, and free prop/value if of_changeset_update_property() returns an error.
  • Image identity indirection (include/linux/soc/apple/display.h:96-115): apple_t8122_dcpext_v27_2() infers dcpext's image UUID from apple,t8122-dcp because aura doesn't publish apple,firmware-uuid on T8122 dcpext (unlike dt_reserve_j713_dcpext_one()). That holds on aura#437's default path, but under chosen.asahi,t8122-dcpext=1 aura does not verify dt_t8122_dcpext_shares_image(). Publishing apple,firmware-uuid on dcpext in aura and using apple_dcp_image_v27_2() directly would close that gap.

Assisted-by: LLM (Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 external-monitor row with this PR at 3d96965 (blocker 1). The test kernel carried this head, plus #2783 for the EDID; Stage 2 = aura#437 15dfa6e9.

MSI MPG 325CQRXF on USB-C, default command line. The external DCP starts on its 27.2 image and drives 2560x1440 @ 280 Hz beside the internal panel. EDID name, colourspace (BT2020_RGB), HDR (PQ, 10 bpc) and VRR (48-280 Hz; KMS pacing test 299/299 at 20.0 ms with VRR on, 0/299 with it off) all match macOS. s2idle with the monitor attached passed 3/3, with 0 failed units and no new kernel errors. Full table: aurora-silicon/aura#437 (comment) . The J615 is back on its default boot.

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

Re-reviewed head 3d969657663738b87739591337c6ff04504374ff against pre-pr-checklist.md (§1–§6) following the new J615 external-monitor row (#issuecomment-7077465061) and the merges of #2688 and #2526.

Resolved since prior review

  • Blocker 1 — J615 external-monitor & aura#437 hardware evidence (§5, §2): Resolved by #issuecomment-7077465061 (full table at aurora-silicon/aura#437#issuecomment-7077463348). Verified on J615 (M3 Air 15") with 3d969657 + aura#437 15dfa6e9 on the default command line: MSI MPG 325CQRXF lights up at 2560x1440 @ 280 Hz beside the internal panel (and with #2783, full 384 B EDID, BT.2020_RGB, HDR PQ 10 bpc, and VRR 48–280 Hz KMS pacing 299/299 vs 0/299), s2idle 3/3 pass with monitor attached, 0 failed units, SELinux Enforcing, 0 new kernel errors.
  • Merged kernel prerequisites: Both base PR #2688 (15bd86e3) and runtime dependency #2526 (67f853fb) are now merged into integration/aurora.
  • Checklist §1, §2, §3, §4, §6: Clean — no board/model gating, default command line, DMA window derived from the internal DCP DART's DT property, human-only commit author/committer/Signed-off-by:.

Remaining blockers (keeping CHANGES_REQUESTED)

  1. Base branch & missing Host tests CI:
    • PR #2704 still targets the already-merged branch j615/t8122-dcp-27-2-standalone (parent a3b0fd4f, 160 commits behind integration/aurora and predating #2526's merge into #2688).
    • Please rebase onto and retarget the PR base to integration/aurora so Host tests (host-tests.yml, which only triggers on integration/aurora / aurora-wip) runs and passes alongside SEP source checks (currently 6/6 green on the old base).
  2. Missing unit/host regression tests:
    • Still no unit/KUnit/host tests covering apple_t8122_dcpext_v27_2(), the dcp_check_firmware_version() apple,t8122-dcpext 27.2 arm, or gate_t8122_dcpext_alias() (e.g., in drivers/soc/apple/display-gate-test.c and tools/testing/selftests/drivers/gpu/apple-dcp/boot.py).

Non-blocking notes

  • J613 (M3 Air 13", §1): Still listed under Still to run; fine to request a regression boot row from a J613 holder if not available locally.
  • Unchanged hardening notes from prior review (good to fold in during the rebase if convenient): stale comment + firmware_dma_bits consistency at drivers/gpu/drm/apple/dcp.c:7282-7289, stale refusal log at drivers/gpu/drm/apple/dcp.c:6021, window->length == 2 * sizeof(u64) + error-path kfree in gate_t8122_dcpext_alias() (drivers/soc/apple/display-gate.c:1905-1926), and direct apple,firmware-uuid check once aura publishes it on T8122 dcpext.

Assisted-by: LLM (Gemini 4 Neon)

…ndow copy

gate_t8122_dcpext_alias() took the internal DCP DART's apple,dma-range
whatever its length. The DART driver reads that property as one window,
a start and a size (two u64), so copy only a property of that length;
anything else leaves the dcpext disabled as a missing window does. Free
the property it built if the changeset does not take it.

In the DCP driver, the T8122 dcpext on firmware 27 runs in the window the
gate copied, the panel's (0x100_0000_0000 + 64 GiB), not the device
tree's: say so, and give it the internal processor's 41-bit firmware DMA
addressing, as the T8122 and T6041 processors on firmware 27 have. The
window is below 2^41, so its mappings do not change. The refusal of
other firmware now names both images the driver runs.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
gate_t8122_pmp_image_27_2 hands the gate the 27.2 PMP image, which the
gate takes, then checks the enabled PMP against the fixture's 14.x image
UUID, so it always failed. Check it against the image the case passed.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Add the T8122 external display processor (dcpext) of t8122-dcp.dtsi to
the gate's T8122 test tree, with its DARTs' 14.7 windows and the panel
DARTs' window, but without the boot loader's firmware-ready mark, and
KUnit cases for its admission:
 - without the mark it stays disabled;
 - on 14.7.0 it is enabled with its DARTs, mailbox, power floor, PMP
   DISPEXT request and display DART, and keeps the device tree's windows;
 - on 27.2.0 beside an internal DCP handed over on the 27.2 image
   (apple_t8122_dcpext_v27_2()) both of its DARTs get the panel's window;
 - 27.2.0 beside an internal DCP on its 14.x image, another version than
   compatibility, no version, or 27.0.0 leave it disabled;
 - without a panel window the 27.2 one is not enabled and nothing changes;
 - gate_t8122_dcpext_alias() alone copies one window onto both DARTs and
   refuses a window that is not one start and one size.

The gate keeps the changeset that enabled the dcpext so the test can
revert it, as it does for the panel's.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Build apple_t8122_dcpext_v27_2() and the apple,t8122-dcpext arm of
dcp_check_firmware_version() from the tree on the host and check which
backend each firmware gets: the 27.2 table only for a dcpext whose
version and compatibility are both 27.2.0 beside an internal DCP handed
over on the 27.2 (26B123) image; nothing for another internal image, a
missing internal DCP, another SoC's processor, or other or malformed
versions; the 14.7 template and the native 26.x H17P path as before.

The t6041 admission harness's stubs become a shared prelude, with an
of_find_compatible_node() over the test's two processors.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide changed the base branch from j615/t8122-dcp-27-2-standalone to integration/aurora November 22, 2026 15:40
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Both remaining blockers from the 2026-11-22 review are addressed.

Base: the PR now targets integration/aurora. The first commit's parent was already in it and git merge-tree is clean, so the PR diff is only this PR's commits and nothing was rebased. Host tests run on this push.

Tests:

  • display-gate-test.c (KUnit): the T8122 test tree now has the dcpext of t8122-dcp.dtsi. Nine new cases cover gate_t8122_dcpext_one(), apple_t8122_dcpext_v27_2() and gate_t8122_dcpext_alias().
  • apple-dcp/boot.py (host test): checks apple_t8122_dcpext_v27_2() and the apple,t8122-dcpext arm of dcp_check_firmware_version(), both built from the tree.

Hardening notes folded in:

  • The window copy takes only a 16-byte apple,dma-range and frees what it built on error.
  • The dcp.c comment is fixed, and the dcpext on firmware 27 gets firmware_dma_bits = 41. The window is below 2^41, so its mappings stay the same.
  • The refusal log names both images.

Also fixed: gate_t8122_pmp_image_27_2 (from #2688) checked the PMP against the 14.x UUID, so it always failed.

Commits and test numbers
  • f9f5b6b soc: apple: display-gate, drm/apple: tighten the T8122 dcpext 27.2 window copy
  • 6a1865f soc: apple: display-gate: expect the 27.2 PMP image in its KUnit case
  • dc4e9e6 soc: apple: display-gate: test the T8122 dcpext on 14.7 and on 27.2
  • b1c12cf selftests: apple-dcp: test the T8122 dcpext 27.2 firmware selection

All tests ran on the head merged onto integration/aurora 00cbc67.

KUnit, arm64 qemu, apple-display-gate*:

  • With this PR: 69 tests, 63 pass. All 9 new dcpext cases and gate_t8122_pmp_image_27_2 pass.
  • The 6 failures are all in apple-display-gate-t6041-max, and they fail the same way on the base (60 tests, 7 fail).
  • Negative control: with the 27.2 window copy removed and the length check reverted, 3 new cases fail.

New dcpext cases:

  • Not ready.
  • 14.7.0, which keeps the DT windows.
  • 27.2.0 beside a 26B123 internal DCP, where both DARTs get the panel window.
  • Refused: 27.2.0 beside a 14.x internal DCP, version differing from compat, no version, and 27.0.0.
  • No panel window, where nothing changes.
  • The alias copy alone, including a window of the wrong length.

Host tests:

  • apple-dcp run.py: 93/93. The new t8122-dcpext-v27-admission test fails when the 27.2 arm is removed from dcp_check_firmware_version().
  • run-host-tests.py: dcpext26-, dcp-v27-dptx-layout, iomfb-startup, apple-dart- and t6030-pmp-supplier pass.

Build and style:

  • W=1 build of display-gate.o and dcp.o on the fleet79 config (clang 22) adds no new warnings.
  • checkpatch --strict: 0/0/0 on each commit.

Still to run: no change to the hardware rows. The new code changes only the DMA mask, and the window it covers is the same. A J615 re-boot with an external monitor would confirm that. The J613 row is still open.

Assisted-by: LLM (Claude:Opus 5.5)

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.

2 participants