Repository navigation
media: apple: scaler: add the M3, M3 Pro, Max and Ultra engines (on #2252) - #2429
RyanTheTide wants to merge 2 commits into
Conversation
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]>
The scaler driver did not match the M3 generation, so the disabled scaler and scaler-DART nodes Ryan Murray described for T8122, T6030, T6031 (also used by T6034) and T6032 in 982f330 and 4c28191 had no driver and stayed off. The M3 engines report hardware-version 16 (T8122) and 17 (T6030, T6031, T6032) in the hardware description of every M3 board. Compared with the engines the driver already knows: - MSR aperture 0x30000: larger than the 0x28000 of hardware-version 10 to 14, smaller than the 0x38000 of the MSR20 engines (20 to 22). - Two interrupts (MSR, PIODMA) and a T8110 DART with the pixel stream at SID 0 and the PIODMA mapper at SID 1, as on every other engine. - T8122: three register ranges like T6000/T8112. T6030/T6031/T6032: the fourth, PMGR-facing range of the later engines. Add one variant for each hardware version and run them on the common job without the MSR20 control block, the job that hardware-version 12, 13 and 14 engines already run. Whether hardware-version 16/17 also has the MSR20 block inside its larger aperture is not visible in the hardware description; a job that does not complete is caught by the 500 ms watchdog. Enable the scaler and its DART in the SoC dtsi files: one engine on M3 and M3 Pro, two on M3 Max, four on M3 Ultra (two per die). Every board of each SoC has these engines. The existing nodes were checked against the hardware description of each board and our own IODeviceTree capture of a J615: register ranges, interrupts, DART SIDs and the MSR / MSR ASE core power domains all match, so only the status changes. In the binding, require exactly three ranges on T8122, four on T6030/T6031, and both DART streams on all three. Signed-off-by: Ryan Murray <[email protected]>
|
Build and KUnit results for the M3 scaler commit (e70c9fa), arm64, LLVM, on the shared integration config with CONFIG_RUST turned off (its
Still to run: T6030 DTBs with the system dtc (blocked on the Assisted-by: LLM (Claude:Opus 5.5) |
|
J615 row (MacBook Air 15" M3, T8122, macOS 27.2 firmware): the hardware-version 16 variant works with the common job. Cold one-shot boot with this PR's driver change (as a module on the 7.3 lab kernel) and the T8122 scaler and DART nodes enabled: |
|
Replaced by #2804: the same changes with the commit trailers fixed, on the current integration/aurora. |
Stacked on #2252 (M2 Pro/Max/Ultra engines): this branch contains its commit ff0deb5 plus one M3 commit. Review only the top commit; merge after #2252.
Problem
The scaler (MSR) driver matched no M3-generation engine, so the disabled scaler and scaler-DART nodes for T8122, T6030, T6031/T6034 and T6032 (added by Ryan Murray in 982f330 and 4c28191) had no driver and stayed off. The rule is that a block is on by default on every machine that has it, chosen by a hardware property, with no per-chip copies of the driver.
Change
apple,t6031-scalerandapple,t6032-scalerreuse the T6030 data, so there is no per-chip code. Both run the common job that hardware-version 12/13/14 engines already run, without the MSR20 control block.apple,scaler.yamlalready lists the M3 compatibles. This adds tighter limits: exactly three ranges on T8122, four on T6030/T6031, and both DART streams on all three.Testing
make W=1 drivers/media/platform/apple/scaler/(arm64, LLVM): in progress at PR time (the first attempt failed inmodules_prepareon a Rust bindings error from the shared config, so it is being rebuilt with Rust off). The result will be posted as a comment.statusof the scaler and scaler-DART nodes (2 lines on T8122, 4 on T6031/T6034, 8 on J575d). The two T6030 DTBs (j514s, j516s) fail in dtc both before and after this change, on the float literals int6030-gpu.dtsi:102, which this PR does not touch, so the T6030 nodes were checked in the source only.dt-doc-validateand yamllint pass. The J615, J514c, J575d and J516m DTBs passdt-validateagainst the updated schema, and a J615 DTB edited to give the scaler four ranges is rejected as expected.Still to run
t6030-gpu.dtsifloat literals are fixed.id) with no DART faults,v4l2-compliance -s, and NV12/P010 to BGRx plus BGRx to NV12 at 1080p compared with a software reference. If the first job times out, the first thing to test is the MSR20 control block (see below). M3 Pro/Max/Ultra rows will come from community owners.Per-SoC hardware facts (ADT of each board)
Power domains: the DT nodes use the MSR (or MSRn) pwrstate and the MSR ASE core below it. The PMGR device list confirms both (T8122 0x428/0x498, T6030 0x508/0x560, T6031 MSR0 0x518/0x590, MSR1 0x508/0x538). The ADT MSR-V and MSRn-DART gates are aliases of those same pwrstates, so the DART node's MSR domain is correct. The SOC-VNOM/VMAX entries are performance votes, not power domains, and are not modelled. Only
statuschanges in the DT.Compared with the engines the driver already supports:
Open question: the MSR20 control block on hardware-version 16/17
The M3 MSR range (0x30000) is large enough to hold the 0x2e300-0x2e318 words that the MSR20 engines program. The hardware description shows the size of the range but not which blocks are inside it. This PR uses the job that hardware-version 12, 13 and 14 engines run without that block, because more generations have been tested with it. A wrong guess fails safely: the job times out (500 ms watchdog), the engine is reset, and the buffer is returned with an error. If the J615 times out, the next step is a one-line test build with
.msr20 = trueinapple_scaler_t8122.The scaler DARTs keep the full DART input address space, as on T8112 and T8132. The ADT DVA window (base 1 TiB) is not added as
apple,dma-rangeuntil a DART probe on M3 confirms the input address width.Assisted-by: LLM (Claude:Opus 5.5)