Skip to content

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

Open
m0d16l14n1 wants to merge 3 commits into
aurora-silicon:integration/aurorafrom
m0d16l14n1:j815/t8142-prores
Open

m0d16l14n1 wants to merge 3 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.

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 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.

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