Skip to content

media: apple: scaler: add T8122 (M3) engine support - #4183

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
satchlj:feat/t8122-scaler
Dec 3, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:mainfrom
satchlj:feat/t8122-scaler

Conversation

@satchlj

@satchlj satchlj commented Dec 3, 2026

Copy link
Copy Markdown
Member

Summary

Add apple_scaler_t8122 (hw_version = 16, num_reg = 3, pre-MSR20 control block) and its of_device_id match for apple,t8122-scaler in drivers/media/platform/apple/scaler/apple-scaler-drv.c.

arch/arm64/boot/dts/apple/t8122-peripherals.dtsi and Documentation/devicetree/bindings/media/apple,scaler.yaml already describe scaler0 (compatible = "apple,t8122-scaler", "apple,scaler", 0x30000 MSR aperture, 3 register ranges, 2 DART streams, ps_msr and ps_msr_ase_core), but apple-scaler-drv had no match entry. Binding the engine both exposes the hardware V4L2 M2M scaler/CSC and lets PMGR sync_state() power down msr_ase_core, msr, and aft0 when idle.

Standalone clean-main change 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) with apple-scaler.ko built from head 0b95e852bd5e (LLVM=1 LD=ld):

  • Probe: apple-scaler 31d000000.scaler: MSR hardware-version 16, id 0x10d0041, stale status 0x0, exposed /dev/video16 (BA24, BX24, NM12, NV12, P010, AL8V, 16x16..16384x16384).
  • 1080p V4L2 M2M jobs via v4l2-ctl:
    • NV12 -> NV12: inf dB (bit-exact)
    • NV12 -> P010 -> NV12: inf dB (bit-exact)
    • NV12 -> AL8V -> NV12: inf dB (bit-exact)
    • NV12 -> BX24 vs BT.709 reference: 30.77 dB (NV12 -> BX24 -> NV12: 28.10 dB, pixel [B,G,R,X] within +/-1 LSB)
  • Hardware deep sleep (rtcwake -d /dev/rtc1 -m mem -s 12, boot object resumes 4 -> 5, wake source: NUB.SPMI0.SW3): post-wake 1080p NV12 -> AL8V -> NV12 bit-exact pass; clean rmmod apple_scaler && insmod.
  • Power management: runtime_status=suspended; PMGR msr_ase_core, msr, and aft0 drop from on to off-0 when idle.
  • Regression check: 0 failed systemd units, 0 DART faults, 0 new kernel errors. scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
  • Untested on hardware: T6030/T6031/T6032 (not included in this PR).

Risk

Risk: Two-way door affecting T8122 Macs (apple,t8122-scaler) only. Pure of_device_id + variant addition using the existing pre-MSR20 register path; reverting restores the previous unbound state.

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>
@satchlj
satchlj requested review from a team as code owners December 3, 2026 11:22
@github-actions github-actions Bot added area:media Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

Merge readiness at 0b95e852: not ready yet

Check Detail
CI at head running running: pr-text / pr-text, apple-build, host-tests, KUnit plan
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 0b95e852
Conflicts ok none
PR text ok Risk: two-way · affecting T8122 Macs (apple,t8122-scaler) only. Pure ofdeviceid + variant addition using the existing pre-MSR20 register path; reverting restores the previous unbound state.

Areas: area:media

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

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

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

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. .text of apple-scaler-drv.o is 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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:media Area from CODEOWNERS (bot) blast:m3 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants