Skip to content

drm: apple: add J773g HDMI display support - #1192

Draft
techmore wants to merge 9 commits into
aurora-silicon:mainfrom
techmore:j773g/hdmi-display-20261107
Draft

techmore wants to merge 9 commits into
aurora-silicon:mainfrom
techmore:j773g/hdmi-display-20261107

Conversation

@techmore

@techmore techmore commented Nov 8, 2026 •

Copy link
Copy Markdown

Summary

HDMI output on the M4 Mac mini (J773g). On this machine the main DCP drives the HDMI port through the T8122 DPTX PHY and a DP-to-HDMI converter, and iBoot hands the display over already running.

Nine commits:

  1. iommu: apple-dart: adopt the T8132 main external display handoff.
  2. drm: apple: dcp: adopt a T8132 main DCP whose output is an external connector, with a J773g profile that has no panel timing.
  3. phy: apple: dptx: add the T8122 PHY next to the T6050 variant. Runtime PM is enabled for T8122 only.
  4. dt-bindings: display: apple,display-subsystem: allow dma-noncoherent, which the shared T8132 node has always carried.
  5. arm64: dts: apple: t8132-j773g: enable the DPTX PHY, the DCP and the HDMI connector; on this board the display-subsystem node is described at the root.
  6. arm64: dts: apple: t8132-j773g: complete the HDMI display description (the ps_dptx_phy domain, kept on; the DCP's cells; the display frontend alias).
  7. iommu: apple-dart: prefer disp0-piodma with fallback to the legacy disp0_piodma spelling in all four DART frontend lookup paths.
  8. drm: apple: dcp: use the J773g HDMI HPD signal after enabling the converter rails.
  9. arm64: dts: apple: describe the two retained display DARTs' firmware-owned DISP_CPU domain.

The PHY commit is Niklas Sheth's: it carries his Signed-off-by and a Link: to his commit, then a note of the changes made here. The earlier PHY commit by another author (7e92f4929531), whose sign-off was asked for in review, is no longer in the series.

The DCP, DRM and DART changes key on apple,t8132-dcp with apple,connector-type = "HDMI-A".

Earlier testing

Every commit builds with the J773g config (CONFIG_DRM_APPLE_DCP_T8132=y) and W=1 for drivers/phy/apple/dptx.o, drivers/iommu/apple-dart.o, drivers/gpu/drm/apple/ and the t8132 and t8122 device trees. dptx.o also builds with arm64 defconfig plus ARCH_APPLE and PHY_APPLE_DPTX. The tip builds Image, device trees and modules. dt_binding_check passes for apple,dptx-phy.yaml. The apple-dcp host tests pass in CI. CHECK_DTBS was not run: dt-validate crashes on apple,tunable in this tree.

Hardware: DjDeveloperr runs this PR with #2166 and #2296 on top as the default boot of a J773g on a 26.6.2 stub (his comments of 2026-11-19): KWin drives HDMI at 1920x1080@120, and with the ps_dptx_phy change the display is restored on 3 of 3 resumes. Not booted by me at this head: my J773g is on a 27.2 stub, whose DCP firmware needs further changes that are not in this PR. J713 and the other DPTX PHY users were not tested.

Dependencies

aurora-silicon/aura#199 must accept disp0-piodma before this renamed DTB is deployed with its T8132 frontend handoff. Linux still accepts the old underscore spelling for existing DTBs. This main-DCP adoption is for the 26.6.2 IOMFB path. The separate firmware-27 external DCP route is tracked in #2541.

Suspend-to-idle (2026-11-19)

ps_dptx_phy is now apple,always-on on the J773g, folded into "arm64: dts: apple: t8132-j773g: complete the HDMI display description" as DjDeveloperr asked. genpd powered the domain off over a sleep, the PHY keeps no state, and the modeset replayed on resume failed (DPTXPort: firmware reports link fault 22 on target 0:4, then -67).

  • Tested by DjDeveloperr on a J773g (26.6.2 stub) on top of this PR: display restored on 3 of 3 resumes.
  • Not tested on my unit (27.2 stub). This head was not booted by me; the change is DTS only, the J773g DTB builds, dtbs_check was not run.
  • The domain has a consumer (the DPTX PHY node, runtime PM enabled), which is why genpd switches it. Always-on is a description-level fix until the PHY driver can restore its state on resume. No other T8132 board uses this PHY.

Related, on top of this PR: #2296 (cursor plane; also the frame not shown: -16 drops) and #2166 (EDID).

dt-checks (2026-11-19)

The dt-checks job reported three new warnings for t8132-j773g.dtb on the previous head. This table records those warnings and their fixes. This head still needs its own schema CI.

Warning Cause Done
display-subsystem: Unevaluated properties … ('dma-noncoherent' was unexpected) The shared t8132-dcp.dtsi node has always carried the property and the binding never listed it. It shows now because this board is the first to enable the node in its device tree. dma-noncoherent: true in apple,display-subsystem.yaml, as its own commit.
soc (simple-bus): display-subsystem: 'ranges' is a required property A node without reg cannot be a child of a simple-bus once enabled. On this board the node is described at the root, as T8122, T6030, T6031 and T8142 (J704/J813) do; the disp0 alias follows the label. The shared tree is not changed.
aliases: 'disp0_piodma' does not match any of the regexes dtschema's own aliases.yaml forbids the underscore. The J773g DT now uses disp0-piodma; the kernel tries it first and falls back to disp0_piodma for older DTBs. aurora-silicon/aura#199 must learn both spellings for the T8132 frontend path.

The node move reverses 76b6d84 for the J773g only. Kernel and loader find the node by the disp0 alias and by compatible, never by path. The platform device becomes display-subsystem (was soc:display-subsystem), which changes sysfs and /dev/dri/by-path.

Booted once on a J773g (27.2 stub, 1080p) with the same device-tree content on our 27.2 display test tree, not this PR's head or its DTB: disp0 = /display-subsystem, SID0/SID16 admitted, card1-HDMI-A-1 connected, kernel display lines identical to the /soc run apart from the device name. Nobody watched the monitor. DjDeveloperr's 26.6.2 setup (this PR + #2166 + #2296, G16) has not run the move.

Validated with dtschema 2025.2 (dt-validate on the built DTBs): the J773g DTB has one new line against the base, the alias warning. The binding change was checked on the Apple DTBs with an enabled display-subsystem node, built at this head: none gains a line. scripts/dtc/apple-dt-check.sh itself and make dt_binding_check were not run; only dt-doc-validate on the binding. checkpatch --strict is clean on the three new or amended commits.

Current review update

Rebased onto integration/aurora at 5746ef8a5. The rebase preserves the current DART check for a valid firmware handoff and the current DRM PM lifecycle.

The driver now polls the J773g's documented AOP GPIO 41 for HDMI HPD after enabling both rails. It stops early on HPD, bounds the wait at 100 ms, and continues adoption with no sink. A legacy DT without the HPD GPIO or an HPD read error retains the old settle delay. A GPIO provider that defers probe still defers the driver.

On 65746c7d9, native ARM64 GCC 13.3 with Rust and CONFIG_DRM_APPLE_DCP_T8132=y compiled the affected DRM, Apple DART, and DPTX objects and the J773g DTB without warnings. The DTB has the expected PIODMA alias and active-high GPIO 41. Local dtc no longer reports the alias warning. The extracted startup fixture passed six cases, including provider deferral and a headless timeout. Full image and connected/headless 26.6.2 cold boots remain outstanding.

The first device-tree workflow passed schema and ADT coverage but reported two newly enabled display DARTs without a power domain. 0bed6a7f describes their existing DISP_CPU domain as firmware-owned. Linux’s PMGR driver keeps a logical provider and does not access or switch the protected state register. The updated J773g DTB builds with no additional normalized schema warnings, and the all-board DART differential reports zero new findings. On 0bed6a7f, GitHub device-tree checks, Apple DRM KUnit, and host tests passed.

The current 3db52087 head changes commit metadata only. The HDMI DTS commit documents the platform-device and /dev/dri/by-path rename, and the source tree is identical to 0bed6a7f. The prior head's green checks are linked above; the current head starts a new CI run. The earlier commit trailers also disclosed LLM and checkpatch assistance without identifying a model.

Assisted-by: LLM (OpenAI:Codex; original T8122 PHY contribution: OpenAI Codex GPT-5.6 Sol)

@techmore

techmore commented Nov 8, 2026

Copy link
Copy Markdown
Author

Per Documentation/process/coding-assistants.rst, this draft branch deliberately carries no Signed-off-by added by an AI agent. After reviewing the final commits, the human submitter will run agents/sean-signoff.sh himself to add his own DCO certification and push the human-signed commits before the PR leaves draft.

@techmore
techmore force-pushed the j773g/hdmi-display-20261107 branch 2 times, most recently from 04e1d87 to 396679f Compare November 8, 2026 10:31
@techmore
techmore marked this pull request as ready for review November 8, 2026 10:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-19T13:20:02.022830Z
We couldn’t complete this review. Comment @codex review to try again.
d480ca7 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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

Commit 7e92f49 is authored by Pavel Shago but carries only the submitter's Signed-off-by. It needs a Signed-off-by from its author as well (DCO, Documentation/process/submitting-patches.rst).

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

Besides the Signed-off-by from its author still needed on 7e92f49:

  1. This no longer merges into integration/aurora. drivers/phy/apple/dptx.c conflicts with c0e42a1 ("phy: apple: dptx: Add the T6050 variant", from #940, merged as 328654f). Please rebase and keep both the T6050 and T8122 variants.

  2. The description lists the exact head as not booted. After the rebase, please add the J773g result for that head (HDMI connector and modes, desktop, cold and warm boot). iomfb_m4.c, dcp.c and apple-dart.c are shared with J713, so please also add a J713 internal and external display check.

@DjDeveloperr

Copy link
Copy Markdown

@techmore could you rebase this onto current integration/aurora? It conflicts in drivers/phy/apple/dptx.c with the T6050 variant from #940. Please keep both the T6050 and T8122 variants.

Two other things are needed before we can merge:

  • DCO: 7e92f49 is authored by Pavel Shago and still needs his Signed-off-by alongside yours.
  • CI: it needs to run green on the rebased head.

We've changed how we handle hardware checks, so we no longer hold contributor PRs for them. Once the branch is rebased, signed off, green and approved, we'll merge it and run the shared-path J713 display check afterwards, with a revert ready. A note of the J773g boot on the rebased head (connector and modes, desktop) would still help if you have it. I'm reviewing the content now so it can go in as soon as the rebase lands.

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

Content review against current integration/aurora, so this can merge as soon as it is rebased. It is otherwise well scoped. The new DCP, DRM and DART branches key on apple,t8132-dcp plus apple,connector-type = "HDMI-A", so other machines' display paths are unchanged, apart from items 2 and 3.

Required, besides the rebase (keep both the T6050 and T8122 variants in dptx.c) and Pavel's Signed-off-by on 7e92f49:

  1. Build break. t8132_ext_drm.c calls dcp_t8132_main_external() but includes neither dcp.h nor any header declaring it, so CONFIG_DRM_APPLE_DCP_T8132=y doesn't build. Add #include "dcp.h".
  2. NULL dcp_m4_pf. In iomfb_m4_init(), J773g has no M4 profile. (!pf && !external) now lets a NULL pf through, so dcp_m4_pf is NULL at the first D590 callback or swap. It also starts admitting dcpext on M4 machines without a profile. Please keep the !pf refusal and add a J773g profile without panel timing.
  3. Runtime PM on every variant. In dptx.c, devm_pm_runtime_enable() without pm_runtime_set_active() makes every DPTX PHY read as runtime-suspended. The T8112/T6020 fixed-HDMI paths never call phy_power_on(), so once appledrm evicts simpledrm, genpd can gate the PHY domain on those desktops. After the rebase this would also cover T6050. Please enable runtime PM for DPTX_PHY_T8122 only.
  4. Empty DRM device. In apple_drv.c, when t8132_ext_drm_init() registers no output (for example on unqualified firmware), the driver still registers a DRM device and evicts simpledrm, which leaves a black screen. Please return -ENODEV in that case.
  5. reg-names requirement. Making reg-names required in apple,dptx-phy.yaml invalidates the existing dptx_phy node in t8122-peripherals.dtsi, which has no reg-names and lists dptx before core. Please fix that node in the same commit, or drop the requirement.
  6. AUX calibration. The T8122 activation reads the AUX calibration result back, then writes a fixed code. The set32(..., 0) writes do nothing. Please compute the code from the readback, as t6050_impedance_calibration() does, and drop the no-op writes.
  7. PMP-report commits. Nothing in the series uses the two PMP-report commits, and their event-config window overlaps the DCP's disp-4 range. Please split them into their own PR.
  8. PR description. Please drop the reference to the private notes path and the provenance note, and update the outdated sign-off text.

Optional:

  • Make a DPTX connect failure after adoption non-fatal. Currently probe fails after the session is pinned.
  • Drop the unreachable M4 shutdown hunk in dcp.c.
  • Drop the &framebuffer0 override, which now equals the default.
  • Say in the commit message why J773g doesn't use the j713 admission parameters.
  • Note that with both dcpext outputs adopted, the HDMI output is silently skipped (T8132_EXT_MAX).

Hardware checks won't hold the merge. We'll run the shared-path J713 display check after merge, with a revert ready.

@techmore
techmore force-pushed the j773g/hdmi-display-20261107 branch 2 times, most recently from bdd8b67 to 3638318 Compare November 13, 2026 20:28
@techmore

Copy link
Copy Markdown
Author

Rebased onto current integration/aurora; new head 36383187409a. The series is now four commits.

  1. t8132_ext_drm.c includes dcp.h.
  2. iomfb_m4_init() keeps the !pf refusal. J773g has its own M4 profile with no panel timing; its ABI fields are the J713 values, which is what the earlier J773g runs used.
  3. Runtime PM is enabled for DPTX_PHY_T8122 only.
  4. apple_drm_init_dcp() returns -ENODEV when t8132_ext_drm_init() registers no output. That is before the aperture is released and before drm_dev_register().
  5. The reg-names requirement is dropped, and with it the binding commit, which had nothing else left that matched its subject.
  6. The T8122 AUX calibration waits 125 us, checks completion, and copies the code from 0x4210 into 0x4228 with a field update, as t6050_impedance_calibration() does. The two no-op writes are gone. A calibration that does not complete now fails activation with -ETIMEDOUT.
  7. The two PMP-report commits are out of this series.
  8. The description is rewritten.

Optional items: a DPTX connect failure after adoption is now a warning; the unreachable M4 hunk in dcp_platform_shutdown() and the &framebuffer0 override are dropped.

The PHY commit's author is Niklas Sheth. It carries his Signed-off-by and a Link: to his commit, followed by a note of my changes and my Signed-off-by.

Checked before pushing, at every commit, with the J773g config (CONFIG_DRM_APPLE_DCP_T8132=y) and W=1: drivers/phy/apple/dptx.o, drivers/iommu/apple-dart.o, drivers/gpu/drm/apple/, and the t8132 and t8122 device trees all build; dt_binding_check passes for apple,dptx-phy.yaml. dptx.o also builds with arm64 defconfig plus ARCH_APPLE and PHY_APPLE_DPTX. CHECK_DTBS was not run: dt-validate crashes on apple,tunable in this tree.

This head has not been run on the J773g. Item 6 changes register writes there, so I will test it and add the connector, modes and desktop result here.

@techmore

Copy link
Copy Markdown
Author

Hardware test, Mac mini M4 (J773g), 2026-11-14: at this PR's exact head 36383187409a the HDMI output was not adopted.

Kernel: aurora-silicon/linux integration/aurora 5d112b1d5493 plus the exact heads of #1192 36383187, #1718 5fbbff26, #1191 (first five commits) 3fa83613, #1865 9c71c29f, #1702 0430675d, #1703 9b0ca002 and #1872 2eb84498, merged without conflicts (release 7.3.0-prheads+, native arm64 build with GCC 15.2.0, 0 warnings). One boot on a Mac mini M4 (J773g, T8132) with a Fedora 44 userspace. The device tree came from the boot chain, not from this tree, so DT-only changes were not exercised.

The display driver did not take over the HDMI output. The kernel log shows:

[    0.075085] apple-dart 30a340000.iommu: error -EBUSY: DCP inherited SID23 leaf[0][1] targets Linux RAM: 000fff103e530001
[   16.465715] apple-dcp 30ae00000.dcp: error -ENODEV: inherited SID23 domain not qualified
[   16.467788] apple-drm soc:display-subsystem: [drm] 0 T8132 external output(s): -517

The screen stayed on the firmware framebuffer (simple-framebuffer, 1920x1080); no DRM device from the display driver had a connector.

We are finding the cause and will push a fix together with hardware evidence. Until then I am converting this PR to a draft so it is not merged in this state.

@techmore
techmore marked this pull request as draft November 14, 2026 03:07
@techmore

Copy link
Copy Markdown
Author

Update to my earlier FAIL note: that result remains valid for the unmodified #1192 DTB. The successful runs below used a source-built DTB containing one additional J773g DTS completion commit; they therefore supersede the earlier result only for the completed DTS.

I have fast-forwarded one commit, 700491843df09e2a8c2182215769025609895d5a, onto this PR. It changes only t8132-j773g.dts:

  • mark ps_dptx_phy okay on J773g, overriding the inherited J713 PMGR-domain policy;
  • add #address-cells = <2> and #size-cells = <2> to dcp, as on the established Apple display DTS nodes;
  • add the disp0_piodma alias required by the existing display handoff lookup.

The four commits already in #1192 are unchanged, including Niklas Sheth's authorship and trailers on the T8122 DPTX PHY commit.

Hardware result

Five consecutive J773g soak boots (S1–S5) reached the graphical login display. In every run:

  • card1-HDMI-A-1 was connected and enabled on apple-drm;
  • the connector advertised 3840x2160 modes;
  • the display handoff admitted inherited SID0 and SID16 mappings and adopted the external DCP;
  • there were zero observed RTKit crash/panic log lines.

S2 also completed an explicit 3840x2160@30 modeset. A further C1 boot passed on the rebased combined tips. Camera frames show the login display for S1–S5 and C1.

Artifact provenance: S1–S5 used kernel Image 9f4d73f7… from composite tree 787d70b2, containing the exact non-DT #1192 head 36383187. The new commit is DTS-only, so the kernel Image code was unchanged. DTB f9e2f3d7… was built from composite source tree 9ed2e7c5, containing #1192 plus this DTS commit and the separate Ethernet-only DTS change. The Ethernet change touches only PCIe nodes. S1–S5 therefore used that composite DTB. In addition, three consecutive boots used an Image (e072b0b75271df4476b7dabdb90e329094b339c1ebf901aabecd9157bfc38c3f) and DTB (de99bb21c4131b453bbb662aa97e9c6f9429c1e3086045dff427a9de1618f04d) built from this commit alone (as the tree-identical pre-sign-off commit be51d0fc, on #1192 head 36383187, without the Ethernet change), through RAM Stage 2 a25d7126414bed97530cd401042c024d2539d1bd7086a4e1c9d7b2b9fb17ca46. In all three, HDMI-A-1 was connected on apple-drm, apple,dcp-os-log was present, and there were zero observed RTKit crash/panic log lines; the first also completed an explicit 3840x2160@30 modeset. The Ethernet port stayed disabled in all three, as expected without the separate Ethernet change. CI should rerun after the fast-forward.

H1 is not included in the pass count: SDDM appeared, but SSH did not answer within 240 seconds and a later restart stuck in Stage 1.

Validation limits

The full dt-validate invocation currently crashes in dt-schema on an existing apple,tunable uint8-array. A warning-delta run with phy/ti,cd2e22.yaml excluded completed; it reports the known underscore-alias warning and otherwise pre-existing warnings. I am not claiming a clean full-schema dtbs_check pass.

Not covered: cold entry, 4K60, HDMI audio, hotplug, Wi-Fi association, Bluetooth traffic, a front USB device, J713, or other boards.

@FatBoy721

Copy link
Copy Markdown

Second J773g PASS for 3638318 + 7004918 (Mac mini M4; kernel = techmore hwtest 787d70b; Stage 2 = aura b8461a80 + 083dbc3f + 79fcfc00 + 7fdadb3e; stock Aurora U-Boot; Stage 1 1.0.0b8, stub 26.6.2). 3/3 boots:

apple-dart 30a340000.iommu: Preserving DCP SID23 root 0x00000103ffeec000 and 2 foreign 32-MiB slots; no writes
apple-dart 30a300000.iommu: Inherited SID0/SID16 frontend admitted; SID0 strict DMA outside 1 foreign and 4 retained slices
apple-dcp 30ae00000.dcp: external DCP adopted
apple-drm soc:display-subsystem: [drm] 1 T8132 external output(s): 0
aurora-g16 302600000.gpu: M4 G16G: 10 cores enabled
aurora-g16 302600000.gpu: G16: firmware at READY, starting the backend
[drm] Initialized aurora 1.0.0 for 302600000.gpu on minor 0

/dev/dri shows card1-HDMI-A-1 and renderD128. An Omarchy/Hyprland desktop runs GPU-accelerated on it; renderer screenshot to follow.

Note: a Stage 2 that lights HDMI itself (the aura boot-hdmi v7 series) leaves SID23 tables outside the ADT pt-region: DCP admission: root[8] … child=1000eb6c000 outside ADT [103ffeec000,103fff1c000). This admission refuses it, so the two can't be combined.

@FatBoy721

Copy link
Copy Markdown

Renderer follow-up for the J773g PASS above, under the Omarchy/Hyprland Wayland session (eglinfo/glxinfo):

EGL vendor string: Mesa Project          (Wayland platform, EGL 1.5)
OpenGL renderer string: Apple M4 (G16G B0)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 26.3.0-devel (git-8f013bf96b)
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 26.3.0-devel (git-8f013bf96b)

That's hardware rendering on the G16G, not llvmpipe.

@DjDeveloperr

Copy link
Copy Markdown

Follow-up from the same Mac mini J773g, 2026-11-19 05:26: with this PR and the aura stack from my earlier comment, HDMI KMS works. KWin trips on one thing, and frames get dropped.

  • Raw atomic client (KWin stopped, dumb XRGB8888 full-screen buffer): TEST_ONLY and commit both succeed at 1920x1080@60 (the preferred mode) and at 1920x1080@120.
  • KWin's EINVAL comes from the plane check. KWin's first commit puts a 32x32 buffer at dst: 32x32+956+536 on plane-0, which looks like its cursor, so drm_atomic_helper_check_plane_state() refuses with "Plane must cover entire CRTC". The T8132 external device has a single, primary plane that can't be positioned. With KWIN_FORCE_SW_CURSOR=1 KWin's modeset goes through: card1-HDMI-A-1 connected enabled, CRTC active at 1920x1080@120, a full-screen AR24 GPU buffer on plane-0, and no KWin errors.
  • Still to look at:
    • dcpext-30ae00000.dcp: frame not shown: -16 keeps appearing (ratelimited) under KWin;
    • there's no EDID (Could not find edid, which drm: apple: t8132: publish the sink's EDID on external outputs #2166 would cover on a newer base);
    • the output only shows up about 11 s after boot, once the DCP re-announces its AV services, by which time KWin may already have started on simpledrm and then lost it ("Primary GPU ... was removed").
  • Ideas:
    • a cursor plane, or letting this plane be positioned the way the DCP's swap allows, would remove the need for the KWin override;
    • registering the connector as connected at adoption (aura's boot modeset is already scanning out) would avoid the late hotplug.

🤖 Generated with Claude Code

@DjDeveloperr

Copy link
Copy Markdown

J773g results with this PR, from the M4 mini drivers lane (2026-11-19). This is now the mini's default boot: kernel 7.3.0-ARCH-m4drv8, which is this PR + #2166 + #2296 on the M4 mini GPU stack, with the HDMI DT in the configured boot.bin.

  • Desktop. KWin 6.8 drives HDMI at 1920x1080@120. It renders on the G16 (renderD128) and scans out on this DCP. Plain boots: output on at ~9.3 s, EDID published via drm: apple: t8132: publish the sink's EDID on external outputs #2166, G16 READY ~3.9 s.
  • KWin's EINVAL was the cursor. With only a primary plane, KWin puts its cursor there. drm: apple: t8132: a cursor plane on external outputs (KWin on the M4 mini's HDMI) #2296 adds a cursor plane (upper surface 1), and with it no KWIN_FORCE_SW_CURSOR is needed. drm: apple: t8132: a cursor plane on external outputs (KWin on the M4 mini's HDMI) #2296 also fixes the frame not shown: -16 drops: the SID0 host windows ran out, and the copy fallback refused while direct swaps were in flight.
  • Suspend-to-idle breaks HDMI unless the DPTX PHY domain stays on. On resume, the replayed modeset fails: DPTXPort: firmware reports link fault 22 on target 0:4, then on: 1920x1080@120 Hz failed: -67, link status BAD. genpd powers dptx_phy off over the sleep and the PHY keeps no state. This DT change on top of this PR fixes it, 3 of 3 resume: display restored (two rtcwake, one systemctl suspend, waking by Wake-on-LAN via PCI: apple: wake on a root port's PME (Wake-on-LAN on the M4 Mac mini) #2297):
    &ps_dptx_phy {
    	apple,always-on;
    	status = "okay";
    };
    
    Could you fold it into arm64: dts: apple: t8132-j773g: complete the HDMI display description?
  • Caveat for older kernels. With the DCP enabled in the DT, a kernel without this PR still boots on simpledrm. But its G16 waits forever in asahi_g16_display_prepare() (-EPROBE_DEFER, the native display never registers), so it has no GPU.

@techmore
techmore force-pushed the j773g/hdmi-display-20261107 branch from 7004918 to d480ca7 Compare November 19, 2026 12:52
@techmore
techmore marked this pull request as ready for review November 19, 2026 13:19
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@techmore
techmore force-pushed the j773g/hdmi-display-20261107 branch from d480ca7 to b8880d5 Compare November 19, 2026 15:24
@techmore

Copy link
Copy Markdown
Author

dt-checks on the new head will still report one new warning: t8132-j773g.dtb: aliases: 'disp0_piodma'. The other two are fixed (details in the description). The alias cannot be renamed in this PR: the loader's T8132 frontend path resolves only disp0_piodma, and t8132-j713.dtb carries the same warning in the base.

Which do you prefer: accept it here as on the J713, or I first add disp0-piodma to the loader (aura #199) and the kernel lookups and then rename it in this dts?

One of the two fixes moves the J773g's display-subsystem node to the root, which reverses 76b6d84 for this board only. It has run on my 27.2 unit but not on a 26.6.2 setup. If the node should stay under /soc, say so and I will put it back; the ranges warning then stays.

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

Thanks, techmore. All eight items from my 11-13 review are addressed:

  • dcp.h is included;
  • the !pf refusal stays, with a J773g profile;
  • runtime PM is on for DPTX_PHY_T8122 only;
  • -ENODEV is returned when no output registers;
  • the reg-names requirement is gone;
  • the AUX calibration code comes from the 0x4210 readback, with -ETIMEDOUT;
  • the PMP commits are out;
  • the description is updated.

The ps_dptx_phy always-on fold is in as well.

One thing holds the merge: dt-checks fails on this head with one new warning from this PR's own dts, t8132-j773g.dtb: aliases: 'disp0_piodma' does not match any of the regexes. We only merge with the PR's own checks green.

On your question, please rename it rather than accept the warning:

  1. Kernel, in this PR: make every lookup of the alias accept both spellings. Today that's apple_dart_frontend_validate() in drivers/iommu/apple-dart.c (of_find_node_by_path(dcp->sid == 0 ? "disp0" : "disp0_piodma")). Try disp0-piodma first and fall back to disp0_piodma, so the J713 tree keeps working unchanged.
  2. This dts: use disp0-piodma in t8132-j773g.dts.
  3. aura: the T8132 frontend lookups (src/kboot.c:7427, :7517-7520, :7924, :7981-7985 on main) learn the hyphen form, with the underscore as fallback, the way the generic path already does at src/kboot.c:8089-8104. J773g HDMI needs aura #199 anyway, which hasn't merged, so no deployed loader loses the handoff. That fits as one small commit in #199, or its own aura PR.

The J713's own alias can be renamed later.

Moving the display-subsystem node to the root is fine; T8122, T6030, T6031 and J704/J813 do the same. Please note the sysfs and /dev/dri/by-path change in that commit's message.

integration/aurora has also changed apple_drv.c and dcp.c since your base (the T6041 firmware-27 and dcp-fabric commits), so expect a branch update before the merge.

Once dt-checks is green, it merges. These rows come after the merge, with a revert ready:

  • the J713 internal and external display check on the shared path;
  • a J773g row on the 27.2 stub.

@RyanTheTide

Copy link
Copy Markdown

After the hdmi-pwren and dp2hdmi-pwren GPIOs are driven high in dcp.c, the probe sleeps a fixed msleep(100) and gives no reason. If the DP-to-HDMI converter has a power-up time, describe the rails as fixed regulators with startup-delay-us in the device tree, or cite the datasheet value in a comment. If it doesn't, wait for something observable (HPD or an AUX reply) with a timeout. Until then this should stay a draft.

@RyanTheTide
RyanTheTide marked this pull request as draft November 20, 2026 23:56
@RyanTheTide

Copy link
Copy Markdown

This does not apply cleanly to the current integration/aurora tip 110861f: apple-dart.c and apple_drv.c conflict with changes that landed since (apple_dart_board() and prefer_shadow in apple_drm_init()). Both conflicts are additive and resolve by keeping both sides, so a rebase is mechanical. Still open from review: the fixed msleep(100) after the HDMI power GPIOs in dcp.c, and the dt-checks warning on the disp0_piodma alias. @techmore could you rebase, rename the alias to disp0-piodma with the underscore fallback in apple_dart_frontend_validate(), and replace the fixed delay with a described or observable wait? #2497 builds on this PR, and #2541 covers the 27.2 dcpext path, so neither replaces it.

A rebased copy is on this repository as rebase/20261123/pr-1192 (110861f plus this PR's commits, authorship unchanged, conflicts resolved as described above). It is there to save you the rebase; take it or redo it as you prefer.

Build check of 110861f plus this change (arm64, LLVM=1, Image, dtbs and every directory it touches, Fedora config plus asahi.config): builds, no warnings in the files it touches; CHECK_DTBS over every Apple DTB: 1 new warning lines against the tip. Host tests (tools/asahi/run-host-tests.py --only) on 110861f plus this change: apple-dcp passes (1/1).

techmore and others added 8 commits November 23, 2026 21:56
A T8132 main DCP wired to fixed HDMI uses six firmware segments and shares
the retained SID 0/SID 16 frontend contract with the external display path.
Qualify that layout from the available main DCP and its connector role.
Validate its physical framebuffer separately from inherited mappings and
preserve both frontend streams without a board-name gate.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Some T8132 desktops route the main DCP through a fixed DPTX-to-HDMI path
instead of an internal panel. Use the connector-type property as that role
contract, prepare the PHY and converter rails, adopt the retained firmware
session, and register it through the external-output KMS path. Accept the
retained physical framebuffer without manual bind controls or machine-name
checks.

Use a J773g M4 profile without panel timing and continue to refuse machines
without a profile. J773g does not use the J713 panel admission parameters
because the external path skips apple_pmp_j713_display_prepare() and has no
internal panel timing or panel power admission.

Keep an empty external device from replacing simpledrm, and retain an
adopted session when its initial HDMI DPTX connect fails. The external KMS
layer still caps the device at two outputs, so two adopted dcpext outputs
leave the fixed HDMI output unregistered.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
T8122 (as used on T8132) needs its own cold activation: the T8112 core
power steps, moved enable/clear bits (0x2218, 0x2234), a different
0x2230 setting, no 0x4008/0x420c/0x4404/0x4408/0x4600 steps, and an AUX
impedance calibration whose result is copied into 0x4228. At link-rate
change it clears 0x222c bit 1 instead of 0x2220 bit 7, takes the T6020
settings for 0x20b0, the first 0x20b4 write and 0x20b8 bit 16, then
clears 0x20b4 bit 1 and skips the 0x20b8 bit 21 clear.

For T8122 only, enable runtime PM before creating the PHY so the generic
PHY core propagates runtime-PM references to the provider. The T8112,
T6020 and T6050 paths are unchanged.

Link: GravityLinux/linux@877c574
Signed-off-by: Niklas Sheth <hi@niklassheth.com>
[Sean: extracted the T8122 hunk; rebased over T6050; runtime PM for T8122 only; calibration code from the readback]
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The T8132 display subsystem node has carried dma-noncoherent since it was
added, and the binding does not list it. dtbs_check did not notice: the
node is disabled in the shared tree and enabled by the boot loader on the
boards with a panel. A board that enables it in its device tree gets

  display-subsystem: Unevaluated properties are not allowed
  ('dma-noncoherent' was unexpected)

Allow the property.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The Mac mini routes its main DCP through the T8122 DPTX PHY and an HDMI
converter controlled by two SMC GPIOs. Describe that fixed path and enable
the retained DCP, mailbox, and display DART nodes. Do not attach the DCP or
mailbox to DISP_CPU: iBoot leaves that domain in auto mode and direct PMGR
writes fault on this machine.

The display subsystem node has no registers and is enabled here, so it
is described at the root rather than under the simple-bus (dtbs_check:
"soc: display-subsystem: 'ranges' is a required property"); the disp0
alias follows its label.

The move renames the platform device from soc:display-subsystem to
display-subsystem, changing its path under /sys/bus/platform/devices.
The /dev/dri/by-path links that use that platform-device name also
change. Update any userspace configuration pinned to the old path.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
With only the HDMI path described, the Mac mini still has no display:

- The DPTX PHY sits on ps_dptx_phy, which the J713 PMGR policy (applied
  to every M4 board that does not state the domain) keeps from Linux.
  phy-apple-dptx and the DCP behind it wait for it until the deferred
  probe timeout (-110). State the domain for this board, as it already
  does for the ATC2 and ATC3 domains.
- The DCP's PIODMA child owns iommu-addresses entries in
  /reserved-memory, so the DCP node needs #address-cells and
  #size-cells; the display DART's admission otherwise warns that both
  are missing.
- The loader and the display DART look the PIODMA stream up by the
  disp0_piodma alias, as on T8122; add it.
- genpd powers ps_dptx_phy off over a suspend-to-idle and the PHY keeps
  no state, so the modeset replayed on resume fails ("DPTXPort: firmware
  reports link fault 22 on target 0:4", then -67). Mark the domain
  apple,always-on. Found and tested by Diljit Singh on a J773g (macOS
  26.6.2): the display is restored on 3 of 3 resumes.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Prefer disp0-piodma for SID16 and retain the original underscore alias
for deployed loader and J713 device trees. Apply the same lookup to
admission, validation, reservations and the diagnostic attribute.

Name the J773g alias disp0-piodma while leaving the target label alone.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Use J773g's ADT HDMI HPD GPIO to detect a connected sink instead of
sleeping unconditionally after enabling the rails. Bound the wait at the
old 100 ms budget and keep adopting the DCP session if the output is
unplugged. Preserve the original settle delay when the GPIO is absent
or cannot be read. Attach the GPIO to the main
DCP, which owns the HDMI route in this firmware path.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
@techmore
techmore force-pushed the j773g/hdmi-display-20261107 branch from db7d34d to 65746c7 Compare November 24, 2026 03:02

Copy link
Copy Markdown
Author

The rebased draft is at 65746c7d9 on 5746ef8a5. The J773g DT now uses disp0-piodma, and each Linux frontend lookup still accepts the underscore form. The converter setup now waits for actual HDMI HPD on AOP GPIO 41, bounded to 100 ms, and a low signal does not prevent headless adoption. Legacy DTs without HPD retain their original settling delay. The affected ARM64 DRM, DART and DPTX objects and J773g DTB built without warnings. The alias warning is gone in local dtc. I’ve documented the matching loader change in aurora-silicon/aura#199 and kept this in draft pending schema CI and 26.6.2 hardware boots.

The DCP firmware and frontend DARTs share the DISP_CPU state, as on J713. Expose its firmware-owned domain so the DARTs have their real dependency without allowing Linux to read, reset or switch the locked state register.

Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>

Copy link
Copy Markdown
Author

The first DT workflow’s schema and ADT coverage steps passed. The DART power-domain step flagged the newly enabled display DARTs at 0x30a300000 and 0x30a340000. Follow-up 0bed6a7f points both to their DISP_CPU domain and describes that state as firmware-owned. The PMGR driver supplies a logical dependency without reading, switching, or resetting the locked state register. The rebuilt J773g DTB adds no schema warnings, and the 138-board DART comparison reports zero new findings. The draft still needs the new GitHub run and connected and headless 26.6.2 cold boots.

Copy link
Copy Markdown
Author

The companion loader alias change is now published in aura#199 at 52dfbed7. On this kernel’s current 0bed6a7f head, all three GitHub checks (device tree, host tests and DRM KUnit) passed. Both aliases are accepted, the J773g DTS uses disp0-piodma, and the HDMI path waits on observable HPD with a timeout. The current-head cold-boot and J713 shared-display results are still outstanding. With those identified as post-merge rows in the prior review, could you review the updated kernel and the firmware-owned DISP_CPU description when convenient?

@techmore
techmore force-pushed the j773g/hdmi-display-20261107 branch from 0bed6a7 to 3db5208 Compare November 24, 2026 04:20

Copy link
Copy Markdown
Author

DJ, the HDMI DTS commit 51a94e69 now describes the platform-device rename from soc:display-subsystem to display-subsystem, the sysfs path change and the corresponding /dev/dri/by-path link change. The series at 3db52087 also moves the assistance disclosures to the PR body. Its source tree is identical to 0bed6a7f, whose device-tree, DRM KUnit and host workflows all passed. The new head is running those checks again.

The connected and headless 26.6.2 main-DCP boots remain unverified. Your November 20 review put the J713 shared-path and 27.2 J773g checks after merge with a revert ready; I’ve kept those distinct from the 26.6.2 rows.

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.

5 participants