Repository navigation
media: apple: scaler: add T8122 (M3) engine support - #4183
Conversation
The T8122 device tree and binding already describe scaler0 (apple,t8122-scaler, 0x30000 MSR aperture, three register ranges, two DART streams, ps_msr and ps_msr_ase_core), but apple-scaler-drv lacked a match entry. Without a bound driver, the MSR and AFT0 power domains also stay on indefinitely waiting on sync_state(). Add apple_scaler_t8122 (hw_version = 16, num_reg = 3, pre-MSR20 control block) and bind it to apple,t8122-scaler. Verified on J613 (MacBook Air 13" M3, T8122): probes cleanly as hardware-version 16 (id 0x10d0041, stale status 0x0), passes 1080p V4L2 M2M jobs (NV12->NV12, NV12->P010->NV12, NV12->AL8V->NV12 bit-exact; NV12->BX24 BT.709), survives hardware deep sleep with post-wake bit-exact NV12->AL8V->NV12 and clean module reload, and drops msr_ase_core, msr, and aft0 to off-0 when idle with zero DART faults. Signed-off-by: Satya Benson <satya@benson.earth>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
RyanTheTide
left a comment
There was a problem hiding this comment.
The T8122 compatible selects the existing pre-MSR20 path with three resources, matching the DT and the reported revision. Other variants are unaffected by the match-table addition. The exact J613 row covers probe, conversion, runtime power-down and conversion again after deep sleep.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approve at 0b95e852bd5e.
The T8122 engine takes the path the T8112 one uses: three register ranges, no MSR20 block. The T8122 node on main matches that (three ranges, two DART streams, ps_msr + ps_msr_ase_core, enabled in the SoC dtsi). num_reg is only the resource check and hw_version is only printed, so the rest of the job code is shared. The highest register the common job writes is 0x25080, inside the 0x30000 window, and the MSR20 words at 0x2e300 stay off. No other compatible changes, and T6030/T6031/T6032 still have no match.
Checked on the merge with main c5bdd6820568 (tree 19028a2da7fe):
make ARCH=arm64 LLVM=1 W=1 drivers/media/platform/apple/scaler/: 0 warnings on main and on the merge..textofapple-scaler-drv.ois identical, and the other two objects are byte-identical, so the only difference is the new variant and its match entry.tools/asahi/apple-scaler-recovery-tests.py(both runs) passes.
The J613 row at this head covers probe, NV12/P010/AL8V/BX24 jobs, runtime power-down and a job after a deep sleep. No further row owed: the other T8122 Macs share the SoC node.
Not checked here: KUnit (hosted), and scaling (the MMIO engines only convert; #4165 changes that and will need its own M3 row).
Summary
Add
apple_scaler_t8122(hw_version = 16,num_reg = 3, pre-MSR20 control block) and itsof_device_idmatch forapple,t8122-scalerindrivers/media/platform/apple/scaler/apple-scaler-drv.c.arch/arm64/boot/dts/apple/t8122-peripherals.dtsiandDocumentation/devicetree/bindings/media/apple,scaler.yamlalready describescaler0(compatible = "apple,t8122-scaler", "apple,scaler",0x30000MSR aperture, 3 register ranges, 2 DART streams,ps_msrandps_msr_ase_core), butapple-scaler-drvhad no match entry. Binding the engine both exposes the hardware V4L2 M2M scaler/CSC and lets PMGRsync_state()power downmsr_ase_core,msr, andaft0when idle.Standalone clean-
mainchange for the hardware-verified T8122 match (related to draft/conflicting #2804, which was waiting on M3 hardware testing).Tested
Tested: J613 (MacBook Air 13" M3, T8122, OS firmware 27.2) on kernel
7.3.0-1-51.202612030709-ARCH(default command line) withapple-scaler.kobuilt from head0b95e852bd5e(LLVM=1 LD=ld):apple-scaler 31d000000.scaler: MSR hardware-version 16, id 0x10d0041, stale status 0x0, exposed/dev/video16(BA24,BX24,NM12,NV12,P010,AL8V,16x16..16384x16384).v4l2-ctl:NV12 -> NV12:inf dB(bit-exact)NV12 -> P010 -> NV12:inf dB(bit-exact)NV12 -> AL8V -> NV12:inf dB(bit-exact)NV12 -> BX24vs BT.709 reference:30.77 dB(NV12 -> BX24 -> NV12:28.10 dB, pixel[B,G,R,X]within +/-1 LSB)rtcwake -d /dev/rtc1 -m mem -s 12,boot object resumes 4 -> 5,wake source: NUB.SPMI0.SW3): post-wake 1080pNV12 -> AL8V -> NV12bit-exact pass; cleanrmmod apple_scaler && insmod.runtime_status=suspended; PMGRmsr_ase_core,msr, andaft0drop fromontooff-0when idle.scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.Risk
Risk: Two-way door affecting T8122 Macs (
apple,t8122-scaler) only. Pureof_device_id+ variant addition using the existing pre-MSR20 register path; reverting restores the previous unbound state.