Repository navigation
T6041/J616c GPU, protected audio and HEVC (supersedes #525) - #958
Merged
Merged
Conversation
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: #525 (comment) Assisted-by: LLM Signed-off-by: Artyom Astafurov <artyom.astafurov@gmail.com>
Drop the SN012776 playback stop on a lost speaker lease from "ASoC: apple: add protected J616c AOP audio". The J616c keeps the J616s handling: it binds the same apple,j616-macaudio match data, and a lost lease clamps the amp gains as it does on the J616s today. The in-graph speaker protection interface replaces this lock and its lease, and stops every speaker stream when protection is withdrawn, so the stop moves there instead of landing twice in two forms. The J616c board description and its six amplifiers are unchanged. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
The headerless powerlog form reaches powerlog_report() on every brightness report from the T6041 desktop firmware. Log its values with dev_dbg() like the framed form, so a normal boot log stays quiet. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Variant::version was only read by is_25f84(), which only the TA mode KUnit test calls, so every build without KUnit warned that the field is never read and the method never used. The variant already carries what differs between the builds. Check the T6041 build in that test by its 25F84 compute program and split firmware area instead. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
This was referenced Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This carries astaff's #525 with his twelve commits untouched, plus three small commits of ours on top. Merging this merges 525.
What we changed on top
Variant::versionandis_25f84()were only used by a KUnit test, so every normal build warned about dead code. The test now checks the T6041 build by its compute program and split firmware area.Testing
Test kernel 7.3.0-aurora-m4x1105 = integration/aurora 1d76233 + 525, 732, 749, 920, 950 and 951 (our three commits are the only difference from what's merged here, and they compile clean with W=1 and KUnit on).
journalctl -p 3. eDP plus external display, Wi-Fi, BT, Touch ID restored, ANE ready, AOP and ALS up with the word-access bootargs, speakerguardd unlocked the speakers. glmark2 18350.M4 Max proof is astaff's own daily driver runs, logs in 525.
🤖 Generated with Claude Code