Repository navigation
Enable HDMI and USB-C DisplayPort on T6041/J616c - #749
Conversation
ecf6bd9 to
ecab47d
Compare
ecab47d to
ac1e69f
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
Good to hear HDMI and USB-C DP drive four displays on your machine. There's a structural issue to sort out first, though.
Required fixes
- Signed-off-by (hard blocker). Neither commit (84f00f2, ac1e69f) has a
Signed-off-by:. Please add yours afterAssisted-by: LLM(git rebase --signoff). - Duplicated SoC description.
t6041-j616c-hdmi.dtsiandt6041-j616c-usbc.dtsidescribe dcpext0/dcpext1, their mailboxes and DARTs, the atc3/atc1 display crossbars and atcphy3 at the same addresses thatt6040-j616s-extdisp.dtsi,-extdisp-hdmi.dtsiand-extdisp-usbc.dtsialready describe for the J616s. That's a second copy of the same T604x hardware, so a fix to one would silently miss the other. Please move the SoC nodes (disabled) into the sharedt604x.dtsifrom PR 525, and keep only the board wiring in the J616c files: HPD and power GPIOs, connector type, which typec port. The J616s files can then shrink to the same board-only overlay. - Two enable mechanisms for the same SoC. J616s brings the external DCP chain up through the display gate (
drivers/soc/apple/display-gate.c) plust6040-j616s-extdisp-mem-loader.dtsi. The J616c files say "the boot loader enables it once it has filled dcpext0's firmware memory and adds dispext0's DART to the display subsystem's iommus". Please use the display-gate path on J616c too. If the loader path is better, make the case and we can move both machines to it. Which loader does that for you, and is that change public? - Stacked on PR 525. This carries all of #525 underneath, so it can only merge after that one, rebased to show just its own two commits.
What passed: the stack builds, and every existing DTB (J616s, J614s, tether) is byte-identical with it applied. The J616s boot with this stack keeps its eDP and both external displays (Acer 1920x1080 on DP-2, MSI 2560x1440 on DP-3). dtbs_check findings for the J616c DTB are listed in the 525 review.
Reuse the existing SoC and PMGR descriptions as the shared T604x base. Keep the M4 Pro DRAM class in t6040.dtsi on top of it. The J614s and J616s compiled trees keep every node and property unchanged. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Describe the Max CPU, OPP and register-window differences on the shared base. Preserve the qualified J616c node and property values. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Move identical register-window constructors into a family helper. The T6040 and T6041 initialization-data checks retain their exact values. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Select a static 25F84 profile and admit the normalized loaded image measured in three qualification boots. Remove exploratory overrides and unknown-image admission from the support path. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Accept 26.5.2 firmware on the T6041 display controllers and add headerless powerlog parsing. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
A DCP commit signals flip_done from its swap completion, after the rest
of the commit tail has run. drm_atomic_helper_commit_tail_rpm() waits
with drm_atomic_helper_wait_for_vblanks(), but appledrm never calls
drm_vblank_init(), so drm_crtc_vblank_get() fails and that wait returns
at once. A blocking commit therefore returned before flip_done, and
drm_atomic_helper_setup_commit() refuses a nonblocking commit on the
same plane until flip_done. A page flip right after drmModeSetCrtc()
failed with -EBUSY ("busy with a previous commit"), which is what
glmark2-es2-drm hit on the J616c.
Wait with drm_atomic_helper_wait_for_flip_done() instead. The rest is
the sequence of drm_atomic_helper_commit_tail_rpm(), in its order. That
helper makes no runtime PM calls: its name stands for enabling CRTCs
before committing active planes, and this keeps that.
The change is not scoped to the J616c. Neither the empty vblank wait
nor the -EBUSY check depends on the SoC, so a per-machine tail would
only leave the race on the others. On every appledrm machine:
- A blocking commit returns after the swap completes and holds its
modeset locks until then.
- A nonblocking commit's worker finishes later. The next commit was
already held back by flip_done, so the flip rate does not change.
- Nothing waits when flip_done is complete early: CRTCs that stay off,
legacy cursor updates, and the T8132 backend, which sends the event
from its flush.
- A lost event costs 10 s and an error in the commit that lost it. The
next commit's dependency wait already has the same bound, so this
adds no new hang.
Framebuffer lifetime does not depend on this wait: displaced scanout is
already retained until its swap completes.
Seen and tested on the J616c only.
Assisted-by: LLM
Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Patching the AOP boot arguments read and rewrote the whole table with memcpy_fromio() and memcpy_toio(), which choose their access widths from alignment and length and write back every byte. Add an AopHwConfig setting for explicit access: read the table in aligned 32-bit words, rounded out to word boundaries so that neighbouring bytes are kept, write only the words that changed and read each one back. This was chosen for the J616c bring-up so that the first accesses to its AOP SRAM had a known width. It does not fix an observed fault: the bulk copy was not run on that machine. The setting is on in HW_CFG_T6040, so it is not J616c-only. t604x.dtsi gives the J614s, J616s and J616c the one apple,t6041-aop compatible, and HW_CFG_T8132 (J713) is a copy of HW_CFG_T6040. Scoping it to the T6041 would take a second compatible, which changes the T6040 device trees, or a machine check. On those machines the values written do not change. The access width does, and there are new ways to fail the probe: -EIO when a word does not read back, and -EINVAL for an empty table or one whose rounded end passes the window. Every other SoC keeps the bulk copy. Synthetic MMIO checks cover malformed tables, bounds and failed readback. Run on the J616c only. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Describe the six amplifiers and headphone jack in the J616c board DT. Stop playback when the speaker protection lease is lost on SN012776 cards fed by the AOP. Until now a lost lease only clamped the amp gains, and the stream kept running with its protection daemon gone or stuck in a stalled sense capture. The clamp stays; the stream now also goes to XRUN, so its client sees the loss. This is shared macaudio code and it is stricter than before. It applies to the J616c, the J616s and the J713. The J614s uses the same condition but binds no speaker link, so it has no lease and never gets here. Narrowing this to the J616c would give machines with the same amps and the same AOP path different protection, and would take a new match entry for it. The stop covers every playback stream of the speaker card, which on these machines carries only the speaker stream. The headphone jack is a card of its own and keeps playing. It is a stop, not a refusal: a client that prepares again plays at the clamped gain until the lease returns. It fires only when the speakers go from unlocked to locked, so not at boot, and not for the kernel's own lock across system sleep, where ASoC suspends the streams itself. A daemon that exits cleanly also loses the lease. Other amps and non-AOP SN012776 cards behave as before, and the MAX98360A path still stops only its software-gain streams. Lease loss was tested on the J616c only. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The T6041 AVD shares its "apple,t6041-avd" compatible with T6040, which holds HEVC back until the firmware lists it. Give the T6041 node a more specific compatible and a variant that holds nothing back, so HEVC is also available on firmware that publishes no codec list. A firmware that does publish one still limits the set. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Build the production initialization objects with their soft-float types and compare constants with explicit capture inputs. Keep T6040 per-chip calibration validation separate; include no captures or local defaults. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
m1n1 compares DT CPUs with its physical MPIDR enumeration. Appending the Max cores to the Pro topology put CPU 9 out of order and stopped boot before kernel entry. Define the full family topology in hardware order and remove the extra cores from T6040. Check the compiled DTB order for both SoCs. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
macOS on J616c writes 0x1c890 = 1 and 0x1c918 = 0 for its tiling passes, where the shared firmware profiles write 0x200440 and 4. Do the same in T6041's 25F84 build and leave the shared profiles unchanged. 0x1c9a8 stays at the shared 0x3c; macOS writes 0x5c here. This does not fix the 25F84 reason-0 restarts under concurrent rendering. They still occurred with these values on an earlier base, also with 0x1c9a8 = 0x5c. Ran on J616c with 25F84, with PRs 732, 749 and 920 and Mesa ca90d8c1919, serial rendering off and the firmware log on: three boots of niri, DMS and 20 Whisper runs each, with no GPU recovery. Add KUnit coverage for the policy boundary and constructor output. Link: aurora-silicon#525 (comment) Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The external display processors, their mailboxes, the fixed DP PHY of ATC3 and the ATC display crossbars are the same hardware on every T604x, at the same addresses. Move them out of the J616s files, all disabled, so that the next board can share them instead of describing them again. The J616s keeps its wiring and the power it runs on. The J614s and J616s DTBs do not change. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
The J616c has no PMP to wait for: iBoot leaves the external display chains powered, and the boot loader fills each external display processor's firmware memory. Enable a chain from the display gate, as for the J616s, once its processor has that memory: its power domains, pins, PHY, crossbar, DARTs, mailbox and processor, and the Type-C route of dcpext1, in one changeset before any device exists, with the chain's display DART appended to the display subsystem's iommus. A chain whose processor has no firmware memory, or that is not all there and disabled, is left as it is, and so is the other chain. The display subsystem's status is never written, so the internal display stays as the boot loader left it. The KUnit tests run the gate on a test tree of the J616c's chains. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
dcpext0 drives the HDMI port through the ATC3 display crossbar, atcphy3 and the on-board DP-to-HDMI converter, as on J616s; the J616c ADT gives the same addresses, interrupts, GPIOs and power states, and atcphy3 gets this board's tunables. With no PMP to acknowledge DISPEXT0, the chain runs as iBoot left it powered: no DISPEXT0 power domain is named and ATC3_COMMON is always-on. Everything stays disabled until the boot loader has filled dcpext0's firmware memory and the display gate enables it. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
…t-front port dcpext1 drives DP alt mode on typec1 through the ATC1 display crossbar and atcphy1, as on J616s: a Type-C display route on dcpext1, the connector's SuperSpeed and route ports, and the Type-C orientation and mode switches of atcphy1 with this board's tunables. atcphy1 has no pipehandler tunable, so it keeps USB2 and takes the DP-only path for DP. dcpext1, its DARTs, mailbox, crossbar and route stay disabled until the boot loader has filled dcpext1's firmware memory and the display gate enables them. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
ac1e69f to
99c9355
Compare
J616c and J616s carried the same six ATC3 PHY tables and the same crossbar power domains. Move them to t604x-extdisp.dtsi. Drop J616s's copy of ps_atc3_usb, which t604x-pmgr.dtsi has, reduce ps_fab7_soc to the parent J616s gives it, and drop status lines the shared files already imply. The J616s files keep what J616c doesn't use: the PMP-ordered power chain, the routes to all three Type-C ports and the ATC3 tables that differ. The J614s, J616s, J616s tether and J616c DTBs are byte-identical before and after. Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
RyanTheTide
left a comment
There was a problem hiding this comment.
This is much nicer, thanks. The shared t604x-extdisp.dtsi, the display gate on J616c and the board files down to J616c wiring were exactly the ask.
On our side every existing DTB is byte-identical with this applied, and the gate only picks the new T6041 path on apple,t6041, so the J616s keeps its PMP chain. Display gate KUnit is 56/56. On our M4 Pro the merge train boot kept eDP and the external display with nothing new in the log. Merging!
The loader fill is fine as a follow-up, please open it against our m1n1 when you get to it so aura can do it on J616c too.
Why
J616c's HDMI port and left-front USB-C DisplayPort use the same dcpext, crossbar and atcphy chain as the J616s, at the same addresses. They now share its description and its enable path, the display gate.
What
t604x: move the external display blocks, the crossbars' power domains and the ATC3 tables both boards share out of the board files intot604x-extdisp.dtsi, all disabled. It's a separate include so the J616s, its tether and J614s stay byte-identical. The J616s files keep only what J616c doesn't use: the PMP-ordered power chain, the routes to all three Type-C ports and the ATC3 tables that differ.display-gate: enable each J616c chain once its processor has firmware memory, with no PMP stage. The display subsystem's status is never written. KUnit runs the gate on a test tree of the J616c chains.t6041-j616c: describe HDMI and USB-C DisplayPort. The board files carry only J616c wiring and tunables.Stacked on #525.
Testing
Kernel is the same merge as #525's proof, with a local boot loader that fills each processor's firmware memory. Logs are at https://gist.github.com/astaff/d1f649ba0d29f5279762e2baa427e732.
/dcp@3a2e00000 enabledand/dcp@602e00000 enabled.set_digital_out_mode returned 0x00000006), then the DCP powered off and came back, and the next mode-sets reported no error. The cause isn't known.Limits
🤖 Generated with Claude Code