Skip to content

media: apple: scaler: add the M2 Pro, Max and Ultra engines - #2252

Closed
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
spec12/media-compat
Closed

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
spec12/media-compat

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The scaler (MSR) driver did not list the M2 Pro, Max and Ultra engines (T6020/T6021/T6022), so those Macs had no hardware scaler. d34ed1e left T602x out, and c91d838 described the T602x nodes as disabled until a driver qualified them.

Change

Match apple,t6020-scaler, apple,t6021-scaler and apple,t6022-scaler with the T8112 variant data. Enable the engines and their DARTs in t6020-peripherals.dtsi, t6021-peripherals.dtsi and t6022-peripherals.dtsi: one engine on M2 Pro, two on M2 Max, four on M2 Ultra. The T602x nodes use the T8112 register map: three ranges at the same offsets and sizes, two DART streams and the apple,scaler fallback. apple,scaler.yaml already groups these compatibles with apple,t8112-scaler.

Testing

  • make W=1 drivers/media/platform/apple/scaler/ (arm64, LLVM): no warnings before or after.
  • DTBs for all 23 M1/M2-family boards built before and after: 15 are identical, including the J316s and J413. The 8 T602x boards change only the scaler and scaler-DART status lines.
  • KUnit was not run: the scaler tests cover the CSC and format tables, not the match table.

Still to run

An M2 Pro/Max/Ultra owner: one probe line per engine with no DART faults, v4l2-compliance -s on the scaler node, and a 1080p NV12 to BGRx v4l2convert pipeline that reaches EOS. Please also report the engine id value (J413 reads 0x10c000a).

Per-SoC detail
  • T6020 (j414s, j416s, j474s): scaler@40b000000.
  • T6021 (j414c, j416c, j475c): @40b000000 and @491000000.
  • T6022 (j180d, j475d): four engines, two per die.
  • Each scaler DART names its die's MSR domain (4109497, by Diljit Singh). The engine also votes the T602x media fabric domain (ps_afr). The probe reads only the ID, running and IRQ status registers, with the engine powered, and a job that does not complete is caught by the 500 ms watchdog.
  • The scaler has no ID check at probe, so a wrong engine generation would only show up as a job timeout.

Assisted-by: LLM (Claude:Opus 5.5)

The scaler matched T8103, T6000, T8112 and the M4/A18 Pro engines, but
not T6020, T6021 or T6022. Their device trees describe the MSR engines
(one on M2 Pro, two on M2 Max, four on M2 Ultra) and keep them disabled
because nothing would bind.

The driver needs two things from a variant: the number of register
ranges and whether the engine has the MSR20 control block (M4 and
later). The T602x nodes have the T8112 register map: three ranges of
0x28000, 0x4000 and 0x4000 bytes at +0, +0x210000 and +0x204000, two
DART streams, and the "apple,scaler" fallback. The scaler binding
already puts apple,t6020/t6021/t6022-scaler in the same constraint
group as apple,t8112-scaler. They are M2-generation engines, before
MSR20. Use the T8112 data for them.

Enable the engines and their DARTs in the T6020, T6021 and T6022
peripheral trees, so every board with the SoC gets them. The DARTs name
the MSR domain of their own die (commit 4109497, "arm64: dts:
apple: t602x: give the scaler and external DCP DARTs their power
domains"), so the DART's first register read finds its block powered.
The engines additionally vote the T602x media fabric domain (ps_afr),
which the driver links through its power-domain list.

T8103, T6000/T6001/T6002 and T8112 device trees are unchanged.

Signed-off-by: Ryan Murray <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. Commit ff0deb5 ends with Co-Authored-By: Claude Opus 5.5 <[email protected]>. Commits must carry human identity only (the Signed-off-by is fine); drop the trailer and push the fix as a new branch/PR rather than a force push. The Assisted-by: line at the end of the PR body is the right place for it.

The code itself looks sound. I checked that the T602x nodes (t6020-peripherals.dtsi:595, t6021-peripherals.dtsi:774/867, t6022-peripherals.dtsi:1136/1295/1953/2112) carry three ranges at the T8112 offsets and two DART streams, which matches apple_scaler_t8112.num_reg = 3 at apple-scaler-drv.c:870. Matching the block's own compatible is fine. Each DART names its own die's MSR domain, so the die-1 engines on the Ultra do not depend on die 0.

  1. Nit: hw_version (apple-scaler-drv.c:871) only feeds the probe log line at :734, and T602x now prints 13 there. If the MSR revision reported by the machine is different on T602x, that line is wrong. Please confirm it against the probe id read on the first hardware run.

The DT enable lands on every T602x board, but nothing has run on T602x hardware yet. Until it does, a wrong register map shows up only as a 500 ms job timeout, because probe does no ID check.

HW row: M2 Pro or M2 Max (and an M2 Ultra if one is available) on this head. Each engine should give one probe line with its id value and no DART faults. v4l2-compliance -s should pass on every scaler node, and a 1080p NV12->BGRx v4l2convert pipeline should reach EOS on each engine (on the Ultra, include die-1 engines 2 and 3). The run should also show 0 AVC, 0 failed units and no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #2793: the same changes with the commit trailers fixed, on the current integration/aurora.

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.

1 participant