Repository navigation
media: apple: ave: T8132 (M4 Air) encoder on the macOS 27.2 stub, with device tree - #2668
Closed
RyanTheTide wants to merge 4 commits into
Closed
RyanTheTide wants to merge 4 commits into
RyanTheTide wants to merge 4 commits into
Conversation
The macOS 27.2 build of the encoder firmware takes the 26A428 Start commands unchanged, but its H.264 and HEVC Process commands are 0x10 bytes longer (0x6e08 and 0x78c8). Every field the driver writes stays at its 26A428 offset; the added bytes are left zero. Share the 26A428 field description between the two layouts and add ave_layout_26b123 with the longer Process commands. No firmware selects it yet. A KUnit case checks that the two layouts differ only in the Process sizes. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The M4 MacBook Air (J713) with the macOS 27.2 stub has its encoder firmware preloaded with TEXT 0x154000 and DATA 0x12c000, TEXT CRC 99fc929a, the same on every boot. The coprocessor and its start sequence are the M4 Pro's (T6041); the build boots as device 23 and takes handshake type 23, and speaks the 26B123 command layout. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T8132 (M4) encoder has the T6041 resource layout: codec, mailbox and coprocessor banks by name and five named VENC power states. Drop its separate five-bank branch and list it with the T6041 group. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Describe the T8132 encoder like the T6041 one: the codec, mailbox and coprocessor banks by name, its five VENC power states by name, and the DART window above 0x100_00000000 that the bootloader maps the firmware into. Drop the unused pmgr and fabric banks and the clock reference to the disabled peripheral clock provider. On J713/J715 the VENC power states are enabled in the board's PMGR ownership file, so the T8132 platform handoff, which applies that file on the Air's loader tree, keeps them; the encoder's two DARTs get their power state again, and they and the encoder are enabled. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
requested changes
Nov 21, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
The driver and DT are right for the J713. Four things to settle before merge: two for the rebase, one for the M4 mini, one for coverage. These are from reading the code and running the AVE host tests, plus DTBs built with cpp+dtc and validated. No kernel build.
- Rebase onto integration (4ea3629), which now carries #2644.
- 435fefa duplicates #2644's layout commit 4c7a63d, so drop it.
- The driver commit's
ave.hhunk (the CRC define) is already in integration. - The binding commit, rebased as is, brings back the T6032 placeholder
if/then/elsethat #2644 removed. An enabled T6032 encoder node then fails validation (reg-namesandpower-domain-namesunexpected). It doesn't show today only because those nodes are disabled. Drop that block. We have a rebased and validated version locally if it helps.
ave-drv.c:118: the T8132 variant has no.text_boot_word. On the M4 mini (J773g) on 27.2, the preload's raw TEXT CRC readsf641c64b, and99fc929aonly with the boot word (0x4224) zeroed. So enabling the mini's DT on top of this fails withunsupported firmware (text CRC f641c64b). Adding.text_boot_word = 0x4224is harmless on the J713. The comment at :115, "the same on every boot", holds on the J713 only.- Coverage:
any_gopnow reaches the T8132. After the rebase, the T8132 26B123 build admits sessions without B-frames and at other rates. The J713 rows (gst defaults) don't cover that. Please add ffmpegh264_v4l2m2mMain without B-frames at 30 fps andhevc_v4l2m2mat 60 fps on the J713. On the mini, a lab module passed HEVC at 60 fps without B-frames, while H.264 without B-frames failed inside ffmpeg with no driver error. That's still being looked at. - The SVE idle word (
mbox_idle = 0x118). The J713 works without clearing it, and the mini runs with the clear. One A/B that includes a runtime suspend and resume would settle whether the clear is needed.
Nits:
ave-fw.c:46adds anotherAppleAVE2FWlabel to the known-CRC list. Checklist item 4 says no Apple strings, so rename the list's labels in one cleanup.- Dropping
clocks = <&peripheral_clocks 430>from the T8132 node is harmless while the supplier is disabled, but it removes hardware description that the other T8132 nodes keep. t8132-j713-pmgr.dtsi:203(the ownership file) is shared by every M4 Mac. That's fine, worth a line in the commit message.
#2643 (the mini) will be reworked as a follow-up on top of this once it lands: the J773g enable, the layout test expecting 26B123, and the idle-word clear only if the A/B needs it.
Assisted-by: LLM (Claude:Opus 5.5)
Contributor
Author
|
Superseded by #2675: the same commits rebased onto current integration/aurora. Assisted-by: LLM (Claude:Opus 5.5) |
Contributor
Author
|
Superseded by #2675 (the same change rebased). Branch kept. |
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.
Problem. The M4 MacBook Air (J713, T8132) on the macOS 27.2 stub has no video encoder. The encoder node is disabled, the driver has no T8132 entry, and on the Air's loader tree the T8132 platform handoff keeps the VENC power states off. So only the decoder, JPEG and scaler nodes exist.
Change.
Testing. J713 on the 27.2 stub, kernel = the J713 lab default plus these commits, Stage 2 DTB with the same DT changes.
apple-avebinds at boot (/dev/video13). gstv4l2h264enc/v4l2h265encpassed 8/8 rows. 6 of the 8 bitstreams are byte-identical to the same rows on an M4 Pro (J616s, stock driver). The other two are long H.264 Baseline runs, within 0.3 % in size and 0.01 dB PSNR. Every stream decodes with no errors and the full frame count. The DART audit showed 0 unsafe streams, with 0 faults and 0 AVC denials. KUnit apple-ave: 30/30 passed (arm64 QEMU). dt_binding_check and dtbs_check passed on T8132 J713/J773g/J604 plus 19 other AVE boards. checkpatch --strict: clean.Still to run. J715 (same tree, no unit here). Short rows and 4K H.264 are slower than on the M4 Pro (see the table); the performance floor is not looked at yet. The 26.6.2 stub firmware (#1489 25G83 image) is not admitted by this change. That would need a second build entry with its own device numbers.
Rows (J713 vs J616s, same script)
gst videotestsrc smpte NV12 -> v4l2h26Xenc -> parse -> file; fps best of 2 (whole pipeline wall time); PSNR computed off-device against the regenerated source (md5 matches the on-device source).
Low absolute PSNR is the driver's default rate on a fast-moving test pattern, the same on both Macs.
Why the platform-handoff change: on the Air's loader tree,
t8132-platform-handoffappliest8132-j713-pmgr.dtsias the PMGR ownership policy. A first boot with only the board DT enabled showed the six VENC states forced to disabled. The encoder DARTs then waited on their power state until the deferred-probe timeout, and the encoder refused with "needs a translating IOMMU". With the states enabled in the ownership file, both DARTs probe and the encoder binds.Assisted-by: LLM (Claude:Opus 5.5)