Skip to content

media: apple: prores: T8142 (M5) ProRes encoder - #1881

Merged
DjDeveloperr merged 4 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-prores
Nov 20, 2026
Merged

DjDeveloperr merged 4 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-prores

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The M5 (T8142) ProRes encoder, on every T8142 machine.

  1. dt-bindings: apple,t8142-prores, beside T6050's, with the same five windows.
  2. media: apple: prores: the T8142 variant.
    • The engine has T6050's five windows at the same offsets.
    • Its power-up is T6050's sequence with a shorter wrapper block: 82 system, 12 control, 80 core and 38 wrapper rows, then the driver's common ring, statistics and quantiser setup.
    • The APRI layout has four blocks and a 38-row wrapper (2592 bytes), with a new KUnit case for it.
    • The rows are built in, as on T6041 and T6050. The ADT has no tunables for this block, so the rows belong to the SoC.
    • The table names the statistics area sizes (APR_STATS_BYTES) and writes the core rows from 0x180 as their repeating 0x40-stride blocks, with APR_BUF() packing each block's buffer start and length.
    • apple/prores-t8142-init.bin is optional; when present it replaces the built-in rows.
  3. t8142-peripherals.dtsi: the SCODEC power state (pmgr device 336, +0x2c0), the engine and its DART, enabled at SoC level. There are no board overrides.

Tested on J815: NV16 1920x1080 to ProRes 422, 10 frames, all decoded by ffmpeg, worst luma PSNR 66.4 dB. That run used an init file holding the same rows. The 300-frame run with the built-in rows and no init file, as requested, is in the next J815 test build.

Checks:

  • W=1 build clean.
  • KUnit 18/18.
  • checkpatch --strict clean.
  • dt_binding_check clean on apple,prores.yaml.
  • J704, J813 and J815 DTBs: W=1 and CHECK_DTBS output is the same as on integration/aurora 0abc2f3.
  • The 212 built-in rows are row-for-row identical to the previous version's table (compiled and compared).

Assisted-by: Claude Opus 5.5

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed. This is an additive T8142 variant and APRI layout (four blocks, 38-row wrapper) with its own KUnit case. The T6041/T6050 variants, layouts and parser are unchanged, and the DT is J815-only. Approving.

Like #1880, it conflicts with the merged #1883 in t8142-j815.dts and t8142-peripherals.dtsi. Please rebase it after #1880 lands, and it merges once CI is green on the rebased head.

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr two changes since your approval, so another look, please:

  1. Rebased onto integration/aurora fc05050. Patches 1-2 are byte-identical; the DTS patches changed context only.
  2. Two new commits: built-in T8142 initialization rows, as T6041 has, with the per-Mac file still optional. Nothing outside an MMIO trace holds these values (no ADT tunables, no table in the 27.2 AppleProResHW kext), so no installer could collect them per Mac. The system rows match T6041's built-in ones but for one value. Details in the description.

W=1 + KUnit build clean, checkpatch --strict 0/0/0. The J815 is deployed without the file, so its next boot runs on the built-in rows; I'll post the result.

Assisted-by: Claude Opus 5.5

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the rebase and the T8142 layout work. The variant, the APRI layout and the KUnit case look good. Three things before this goes in:

  1. Board coverage. The ProRes block, its DART and the SCODEC power state are part of the T8142 SoC, so they should be on for every T8142 machine, not only J815. Please drop status = "disabled" from ps_scodec, apr_dart and apr in t8142-peripherals.dtsi (lines 274, 294 and 600 of this branch) and remove the three overrides from t8142-j815.dts (lines 475-486). J813 and J704 then pick it up with no board lines. If a board really lacks the block, keep it off there with a one-line comment saying why.

  2. The power-up rows (apr_t8142_*_tunables, apple-prores-drv.c 748-990). Where a row can be tied to something documented, such as the ADT apr/dart-apr nodes, the pmgr power domain, or a named register field, please derive or describe it that way rather than as a bare table. Please also trim the commit message of "media: apple: prores: T8142: built-in initialization rows" and the description to what the driver does and the test results.

  3. The hardware run with the built-in rows and no init file is still pending. On J815: boot this branch without apple/prores-t8142-init.bin, encode NV16 1920x1080 to ProRes 422 for 10 s (300 frames). Pass: every frame decodes with ffmpeg, worst luma PSNR at least 60 dB, and no DART faults or encoder timeouts in dmesg. Please post the dmesg excerpt and the PSNR summary.

After that, a J704 or J813 owner can run the same 10 s encode on the SoC-level node. We can run no-regression rows on our A18 Pro (Neo) and M4 Pro, since the T6041 and T8140 paths share this code.

@m0d16l14n1 m0d16l14n1 changed the title media: apple: prores: T8142 (M5) ProRes encoder, enabled on J815 media: apple: prores: T8142 (M5) ProRes encoder Nov 19, 2026
@m0d16l14n1

m0d16l14n1 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

@RyanTheTide thanks. New head 4357676, now three commits:

  1. Board coverage: ps_scodec, apr_dart and apr are on in t8142-peripherals.dtsi, and the J815 overrides are gone. J704, J813 and J815 DTBs build. Their W=1 and CHECK_DTBS output is the same as on 0abc2f3.
  2. Power-up rows: the built-in-rows commit is folded into the driver commit, and that message and the description are trimmed to what the driver does plus the results.
    • The statistics area sizes use the driver's named constant.
    • The core rows from 0x180 are written as what they are: 0x40-stride blocks of a flag word, a block number and a packed buffer start/length (APR_BUF()). The buffers tile two ranges exactly, with no gaps or overlaps: blocks whose flag word ends in 0x600 or 0xa00 cover 0xa00-0xc00 between them, and those ending in 0x5ff or 0x9ff cover 0xa00-0xb40.
    • The ADT apr/dart-apr nodes and the pmgr domain carry nothing that maps onto the remaining rows, so those stay as values, and the comment says so.
    • The 212 rows are row-for-row identical to the previous table.
  3. No-init-file run: it goes into the J815 test build I'm putting together now. That's 300 frames of NV16 1080p to ProRes 422, checked with ffmpeg, PSNR and dmesg. I'll post the dmesg excerpt and the PSNR summary here.

KUnit 18/18, checkpatch --strict clean, dt_binding_check clean.

Assisted-by: Claude Opus 5.5

@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

J815 (MacBook Air 15" M5) run of the 300-frame ProRes test you asked for, on the current head 4357676 (built-in rows, no init file anywhere):

Kernel: integration/aurora 0abc2f3 + this PR + the other T8142 PRs (#2383, #2325, #2328, #2384, #2385, #2330, #2194, #2221, #1906, …). The test looks for an init file in /lib/firmware, /usr/lib/firmware, /run and firmware_class.path, and reads the probe from journalctl -k -b:

[    0.044818] platform 3a1000000.prores: Adding to iommu group 13
[    1.308134] apple-prores 3a1000000.prores: ProRes encoder, id 0x40018
rows: built in (init file anywhere: none)
NV16 1920x1080 -> ProRes 422, 300 frames: rc 0, 88654195 bytes, 300 frames out, 300 decoded by ffmpeg,
irqs 10 -> 310, min luma PSNR 66.3 dB, DART faults/timeouts 0

An earlier 10-frame run on the same boot gave 66.4 dB. No ProRes or DART lines in dmesg after the run.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, that covers all three points. The block is on at SoC level, J704, J813 and J815 build cleanly here with the encoder enabled on each, and the 300-frame run is a clear pass: every frame decoded, worst luma PSNR 66.3 dB, no DART faults or timeouts.

One small thing, optional: in apple-prores-drv.c the new T8142 tables went in under the existing comment "Selected only by the DT compatible, before mapping any resources.", which belongs to struct apr_variant. Moving the tables above that comment keeps it next to its struct.

Once CI is green on this head it is ready for another maintainer look. We will run the no-regression rows on our A18 Pro (Neo) and M4 Pro, and a J704 or J813 owner is welcome to repeat the 300-frame encode on the shared node.

@RyanTheTide

RyanTheTide commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

No-regression rows for the shared apple-prores code at this head (4357676): our A18 Pro (Neo, T8140) and M4 Pro (J616s, T6041 variant). Pass on both.

Test kernel: integration/aurora 0abc2f3 with this PR merged (also #1065, #2240 and #2143, which touch other drivers). Each Mac ran three arms on the same 11-row encode set:

  • A: our production kernel (Neo 7.3.0-40, J616s fleet75).
  • B: the test kernel with this PR in-tree.
  • A': the same test kernel with apple-prores.ko built from this PR's base (0abc2f3) swapped in. This isolates the PR from the rest of the kernel.

The 11 rows cover NV16/P216/NV24/P416 at 1080p and 2160p, profiles 0–5, 8 frames each (testsrc2 pattern). Each row records the md5 of the bitstream, an ffmpeg decode of every frame and fps ×3.

Neo (T8140) J616s (T6041)
md5, 11 rows A = B = A' A = B = A'
md5 set vs the other Mac identical identical
ffmpeg decodes 8/8 in every row, all arms 8/8 in every row, all arms
DART faults / encoder timeouts / prores errors in dmesg 0 0
fps within run-to-run spread (about 1620–1640 fps at 1080p p0–p2 on both) same

So the encode output on the existing engines is byte-identical with and without this PR, and nothing new shows up in the logs. One limit of the J616s rows: that machine has apple/prores-t6041-init.bin installed, and both B and A' logged initialization rows from apple/prores-t6041-init.bin. They therefore compared the init-file path. The built-in T6041 rows were not compared separately on this run. On the Neo no arm logged an init-file line.

Rows (Neo B arm; the other five arms give the same md5 column)
nv16 1920x1080 p0 md5 ebc7d8f2fd02 bytes 789818  decodes 8/8
nv16 1920x1080 p1 md5 30caf4961fce bytes 1788987 decodes 8/8
nv16 1920x1080 p2 md5 330739ee87d5 bytes 2290528 decodes 8/8
nv16 1920x1080 p3 md5 903a7d9057aa bytes 3088581 decodes 8/8
p216 1920x1080 p3 md5 8ce1391ba26a bytes 3059732 decodes 8/8
nv24 1920x1080 p4 md5 58a0c7f858da bytes 4718141 decodes 8/8
nv24 1920x1080 p5 md5 28bdc2e9c514 bytes 4906128 decodes 8/8
p416 1920x1080 p4 md5 74d055bf49ea bytes 4603532 decodes 8/8
nv16 3840x2160 p2 md5 d2943147a979 bytes 7778795 decodes 8/8
nv16 3840x2160 p3 md5 b4ea06517571 bytes 10480762 decodes 8/8
nv24 3840x2160 p4 md5 c9bcd5e81255 bytes 15871963 decodes 8/8
dart/prores errors 0

Assisted-by: LLM (Claude:Opus 5.5)

The M5's ProRes encoder has T6050's five windows at the same offsets.
Take the T8142 compatible beside T6050's.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
The M5's ProRes encoder has T6050's five windows at the same offsets:
core, the AXI-to-fabric wrapper, the SCODEC system window and the two
SCODEC control pages. Its power-up is T6050's sequence with a shorter
wrapper block: 82 system, 12 control, 80 core and 38 wrapper rows, then
the driver's common ring, statistics and quantiser setup.

Add the T8142 variant with its APRI layout (four blocks, a 38-row
wrapper, 2592 bytes) and built-in rows, as T6041 and T6050 have. The ADT
carries no tunables for the block, so the rows are the SoC's. The table
names the statistics area sizes and shows the core rows' repeating
block layout. apple/prores-t8142-init.bin stays optional and replaces
the rows.

Tested on a J815 with an init file holding the same rows: NV16
1920x1080 to ProRes 422, 10 frames, all decoded by ffmpeg, worst luma
PSNR 66.4 dB. The KUnit suite passes, with a new T8142 layout case.

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
Describe the ProRes encoder of the T8142 SoC, so that every M5 machine
gets it:

- the SCODEC power state (pmgr device 336, +0x2c0);
- the engine, with T6050's five windows;
- the DART's power domain, register names and vm range
  (0x100_0000_0000, 0x300_0000_0000).

Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
@m0d16l14n1

Copy link
Copy Markdown
Contributor Author

Thanks for the no-regression rows on the Neo and the J616s, and for the review. I took the optional nit: in e0f8b08 the comment "Selected only by the DT compatible, before mapping any resources." sits directly above struct apr_variant again, with the T8142 tables above it. Nothing else changed: same base (0abc2f3), same three commits, and the diff against 4357676 is that one moved line.

Assisted-by: Claude Opus 5.5

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Since my approval, every point Ryan raised on 11-19 is in:

  • the SCODEC power state, apr_dart and apr are on in t8142-peripherals.dtsi, with no board overrides;
  • the built-in rows are folded into the driver commit, with the 0x40-stride core blocks written through APR_BUF();
  • the 300-frame J815 run without an init file passes (worst luma PSNR 66.3 dB, no DART faults or timeouts);
  • the comment above struct apr_variant is back in place (e0f8b08).

The T8142 variant is selected only by its compatible, and Ryan's Neo (T8140) and J616s (T6041) runs show byte-identical encodes with and without this PR. Approving.

CI: host-tests and the SEP source jobs are green on e0f8b08, and dt-checks was still running when I looked. integration/aurora has also changed t8142-peripherals.dtsi since your base (e4c3c2e, PCIe DART power domains). That merges cleanly, but it is your file, so I'll update the branch and merge once dt-checks and host-tests are green on the merged head.

These rows come after the merge, with a revert ready:

  • a J704 or J813 owner repeating the 300-frame encode on the SoC-level node;
  • the built-in T6041 rows compared on a J616s without prores-t6041-init.bin (Ryan's run used the init file).

@DjDeveloperr
DjDeveloperr merged commit 4918ae1 into aurora-silicon:integration/aurora Nov 20, 2026
8 checks passed
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged as 4918ae1 (dt-checks, host-tests and the SEP source jobs green on the updated head 37a5388). Post-merge verification as in my review: a J704 or J813 300-frame encode on the SoC-level node, and the built-in T6041 rows on a J616s without the init file. A revert is ready if they don't hold.

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.

3 participants