Repository navigation
media: apple: ave: T8132: start the 26.6.2 stub's encoder firmware; enable the encoder on J773g, J604, J623/J624 - #1489
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
Thanks for the T8132 encoder work, and for the PSNR numbers across H.264, HEVC and Main 10.
Before this can go in, please rewrite three pieces of text: the commit message of "media: apple: ave: add T8132 (M4) support", the comment above ave_t8132 in ave-drv.c, and the new comment in ave_layout_for_crc(). They explain the variant values by what a macOS driver build does. They should only say what the J713 hardware shows: the firmware segment sizes and TEXT CRC, the ADT values the variant uses (device id, type), what you saw the coprocessor start do, and the encode results. Please drop the macOS driver names and versions, the internal identifiers and the routine comparisons. The firmware build labels next to the CRCs can stay, as elsewhere in ave-fw.c.
The branch also conflicts with integration/aurora now, so a rebase in the same push would help. I'll run the encode regression on our M1 Pro, M2 and Neo once the rewrite is up.
|
One more spot with the same issue: item 2 of the PR description names the macOS driver version. Please drop it there too when you reword the commit message. |
183a42b to
7e3c2d7
Compare
|
Thanks for the review. Pushed:
Retested on J713 (the rebased driver, after a fresh boot; the node is now /dev/video10): FFmpeg H.264 720p/1080p/2160p, CBR/VBR, Constrained Baseline, HEVC 720p/1080p and Main 10, and Chrome WebCodecs H.264. Every PSNR is identical to the previous revision. Hardware decode (H.264/HEVC/VP9/AV1, 6 clips) is still byte-exact. dt-schema now runs locally too: the binding passes |
RyanTheTide
left a comment
There was a problem hiding this comment.
The rewritten comments and commit message describe only what the J713 shows, and the driver changes are new table entries. The AVE driver also runs on the A18 Pro, M1 Pro and M2, so we will run an encode check on those once aura#152 is in, then merge. Thanks for the PSNR table.
7e3c2d7 to
eb4ff8d
Compare
|
Rebased onto |
|
@EdupugantiAkhil #1677 went in first, so this now conflicts in Results so far, with that resolution in a test kernel (integration e661192 plus this PR and the others in this round):
The M2 and A18 Pro encode runs are still queued. |
|
M2 results with this PR's driver code (applied over #1677 with both 25G83 CRCs kept), one-shot test kernel: the M2 encoder binds as before, H.264 1080p is byte-identical to the production kernel (300/300 frames, 23777084 bytes) and HEVC bytes are identical too, before and after 3 s2idle cycles. The conflict in ave-layout.c still needs the rebase described above before this can merge. |
eb4ff8d to
c57eac9
Compare
|
Rebased onto integration/aurora, keeping both 25G83 CRCs (T6041 and T8132). Retested on J713: encode and decode results unchanged. |
|
Tested on a J773g (Mac mini M4, 26.6.2 stub, aura with #152): the encoder works, after two changes to this series.
With both changes, on the J773g (1920x1080 testsrc2, yuv420p, 120 frames,
The encoder's |
|
Thanks for testing on the J773g! I'll fold both changes into the series, rebase onto integration/aurora and retest on the J713. It should be up in under an hour. |
c57eac9 to
96882be
Compare
|
Folded both in and pushed (96882be): |
|
On macOS 27.2 (26B123) firmware, the J773g preloads AppleAVE2FW 9013.55.1 (TEXT 0x154000, CRC 99fc929a), and this series refuses it with "unexpected firmware segment sizes". The 27.2 AppleAVE2 kext renumbers the M4 as device 23, type 23 (26.6.2: 26/24), so the 27.2 build needs its own start identity. #2643 adds it as a T8132 build table on top of this PR: H.264/HEVC with B-frames encode at 45.6/46.5 dB PSNR on the J773g. Feel free to fold it in here instead; otherwise #2643 goes in after this one. Conflicts with current integration/aurora (test merge onto 5b596e6): only in this PR's DT commits. The driver files merge cleanly.
I haven't pushed anything to your branch. |
|
Blockers: 1. The driver part is small and reads correctly: a new compatible-selected variant, its CRC added to the known list, and the CRC mapped to the existing 9003.78.0 layout, with the per-boot TEXT word that the J773g needed. The conflicts with integration/aurora and the 27.2 firmware follow-up are already covered in the earlier comments, so I don't repeat them.
HW row: J713 booted with the DTB built from this branch (not the runtime overlay) on the default command line: FFmpeg H.264/HEVC/Main 10 encode with the PSNR table above, decode unchanged, 0 DART faults, 0 SELinux denials, 0 failed units, 0 new kernel errors. The same encode row on J604 or J623/J624 before their commits go in; otherwise drop those two commits for now. Assisted-by: LLM (Claude:Opus 5.5) |
|
@EdupugantiAkhil, a tidy-up pass over the open PRs here. These of yours need something:
If any of these are no longer needed, closing them helps; otherwise a merge or rebase onto integration/aurora is usually all they need. Thanks! |
Signed-off-by: Akhil <[email protected]>
|
Kept the board enables as they are: they follow how the video decoder is enabled on T8132 ( Merged |
There was a problem hiding this comment.
The forward merge keeps the existing firmware selection and J713/J715 DTBs intact. The bring-up rationale explains why a board can opt in separately. The identical nine-node enablement should still live in one shared T8132 include, referenced only by qualified boards if needed. The J713 runtime overlay supports encoder function, while the affected exact-head desktop or J604 full boot and green hosted checks are still outstanding.
Keep both the T8132 26.6.2 and T6041 27.2 firmware CRCs and their KUnit cases. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
Verdict: HOLD at bcf0d2f1
Blockers:
- Hosted build/DT/KUnit CI skipped at
bcf0d2f1:apple-build,dt-checks,host-tests, andKUnitall reportedSKIPPEDonbcf0d2f1(onlyreadinessran). Please trigger/ensure a green hosted build +dt-checks+KUnitrun at this head. - Exact-head full-boot hardware row missing (
bcf0d2f1): Current evidence is still the out-of-tree driver + runtime overlay run on J713 (d65c5a18d) plus a pre-rebase J773g run. Please post a full-boot exact-head kernel+DTB row on a 26.6.2 T8132 Mac (e.g., J773g or J713/J604) on the default command line. - Prior
CHANGES_REQUESTEDreview still open: Resolve the openCHANGES_REQUESTEDreview fromRyanTheTide(and confirm with maintainers whether the repeated 9-node board enablements acrosst8132-j604.dts,t8132-j623-j624.dtsi, andt8132-j773g.dtscan stay per-board matching#1488or should be consolidated into a shared include).
Checked:
- Verified
bcf0d2f1cleanly forward-mergesmain(MERGEABLE) with unchangedave_t8132_25g83build table, KUnit case, and T8132 board DTS enablements (+194/-1across 8 files).
Evidence
- Head commit:
bcf0d2f129f8c88001500e873efc4aa1541ba246(Merge main into j713-ave-enable). - CI snapshot:
readiness=SUCCESS,apple-build=SKIPPED,dt-checks=SKIPPED,host-tests=SKIPPED,KUnit=SKIPPED.
|
PASS: J773g (M4 Mac mini) at
|
|
Merged main into bcf0d2f, keeping both firmware CRCs and both KUnit cases. The three AVE production objects and all four affected DTBs passed the warm build check. The 26.6.2 full-boot row is still needed. |
There was a problem hiding this comment.
Verdict: MERGE at bcf0d2f129f8
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Verified bcf0d2f1 cleanly forward-merges main (MERGEABLE) with unchanged ave_t8132_25g83 build table, KUnit case, and T8132 board DTS enablements (+194/-1 across 8 files).
Follow-ups (not blocking): hosted build/DT/KUnit run, exact-head T8132 full-boot row, Ryan's open CR, per-board DTS consolidation question
Re-checked at bcf0d2f under the 12-01 merge bar: the three texts this asked to rewrite now describe only what the hardware shows (no macOS driver names, versions or internal identifiers in the commits, comments or diff), and the branch merges main cleanly. Nothing left from this review. The extra encode checks on other SoCs are not needed: the change only adds T8132 table entries and DT nodes, and the 27.2 path is unchanged (KUnit). The 26.6.2 full-boot row stays a follow-up.
|
Merging at |
What:
main(#2675) starts the T8132 encoder only with the firmware the macOS 27.2 stub preloads; with the 26.6.2 stub (encoder firmware 9003.78.0, TEXT 0x148000) the probe refuses it. This adds that build asave_t8132_25g83, chained fromave_t8132through.next_build(segment sizes select it), and enables the encoder on the Mac mini (J773g), MacBook Pro 14" (J604) and iMac (J623/J624).Tested: J713 (T8132, 26.6.2 stub) at e8cdf38 (driver and J713 DTB unchanged from d65c5a1, where it ran): H.264/HEVC/Main 10 encode 8/8 and Chrome WebCodecs byte-identical to the previous revision, decode 6/6 byte-exact, 0 DART faults, 0 apple-ave warnings. Driver built out of tree against the running 7.3.0 and the DT enabled by a runtime overlay (see Evidence). J773g on 26.6.2 before the rebase: 45.3/46.3 dB. The 27.2 path is unchanged (KUnit).
Risk: two-way door · T8132 Macs (J713/J715, J773g, J604, J623/J624); the 27.2 build's selection is unchanged.
Not yet: a full-boot row with this head's kernel and DTB on the default command line on a 26.6.2 T8132 Mac; J604 and J623/J624 on hardware (J713/J773g stand in for the same T8132 block; board owners, please verify).
Details
media: apple: ave: start the T8132 encoder firmware from the 26.6.2 stub:ave_t8132_25g83(TEXT 0x148000, DATA 0x12c000, device 26, handshake type 24, per-boot word at TEXT 0x4224, TEXT CRC 9308d2ab), chained the wayave_t8112->ave_t8112_26b123is; since the merge ofmain(media: apple: ave: admit the J775D's encoder by its build's per-boot word #2882) the build sizes, CRC and per-boot word sit in its own one-entrybuilds[]table, as forave_t8112_26b123; its CRC in the known list and mapped to the 9003.78.0 layout. KUnitave_t8132_25g83_buildchecks that each stub's sizes select their own build, start fields and layout, and that the near misses are refused.arm64: dts: apple: t8132-j773g/t8132-j604/t8132-j623-j624: enable the video encoder: the encoder, its two DARTs and its six VENC power domains, ast8132-j713-j715.dtsidoes. The domains are stated in each board tree: on a J773g with an earlier tree they came up disabled through the PMGR policy and the encoder DARTs deferred until the probe timed out.The binding,
t8132-peripherals.dtsiand J713/J715 changes of the earlier revision are dropped: #2675 landed them.Thanks to @DjDeveloperr for the J773g testing and for finding the per-boot TEXT word and the VENC domain gap.
Evidence
J713 (T8132), stub 26.6.2, preload TEXT CRC 9308d2ab, head d65c5a1 (main a851ca0 merged into the 4 commits; the driver selected "firmware build 25G83 (TEXT 0x148000 CRC 9308d2ab, DATA 0x12c000)"):
Driver: this head's
drivers/media/platform/apple/ave/, built out of tree (clang 22,-Werror) against the running distro kernel 7.3.0, with a local define forV4L2_PIX_FMT_APPLE_L8V0, which that kernel's uapi predates. Probe selected the 26.6.2 build;/dev/video14.DT: encoder, DARTs and VENC domains enabled at runtime by an overlay with the same properties as this tree. Command line: default plus the local J713 display options
apple_dart.j713_dcp=1 apple_dart.j713_display=1and the test-helper options.FFmpeg 9.0.2 VA-API, all frames decodable, frames/sizes/PSNR identical to the previous revision:
Chrome WebCodecs H.264 hardware encode (VaapiVideoEncodeAccelerator): 60/60 frames, bitstream byte-identical to the previous revision.
Hardware decode H.264/HEVC/VP9/AV1: 6/6 byte-exact against software.
Regression: 0 DART faults, 0 apple-ave warnings; SELinux not enabled on this NixOS install (0 AVC lines). 2 failed units, both local and independent of this change (a test helper that predates the in-tree AVD, and a Touch ID re-arm unit that fails on earlier boots too). New kernel errors versus the previous boot: only the overlay's fw_devlink messages for the ACIO nodes, which appear on every overlay boot and on no boot without it.
Host tests (
drivers/media/platform/apple/ave/tests/run*.py): pass. All six T8132 DTBs build with warnings identical tomain.