Skip to content

T6050 (M5 Pro/Max): enable both scalers - #4156

Merged
DjDeveloperr merged 4 commits into
mainfrom
media-parity/t6050-scaler
Dec 4, 2026
Merged

DjDeveloperr merged 4 commits into
mainfrom
media-parity/t6050-scaler

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

The M5 Pro/Max (T6050) has two scaler/CSC engines, and both were disabled in the DT. This enables them and adds a T6050 variant to apple-scaler.

Problem: on T6050 boards, scaler0 and scaler1, their DARTs and their MSR power states were all status = "disabled", and the driver had no apple,t6050-scaler entry. Nothing bound and no V4L2 converter existed.

Change: three commits. The binding stops forcing T6050 instances to stay disabled. The driver gets an apple,t6050-scaler variant (hardware-version 24) that reuses the T8142 MSR23 front end and power-up writes. t6050-media.dtsi enables both scalers, both DARTs, MSR0/MSR1 with their ASE core states, and FAB2_SOC as apple,always-on, because it refuses to power down.

Tested: K114s (MacBook Pro 14", M5 Pro), kernel 7.3.0 (main 42169a0 plus three PRs) with this driver source as a module. I ran it two ways. First by setting the nodes okay at runtime. Then with a one-shot boot of the K114s's own DTB with only these status changes. In the boot run both engines bound at 6.6 s and started from the boot loader's pre-loaded image. 1218 jobs ran with 0 job errors and 0 DART faults, SELinux enforcing and 0 failed units. Outputs of scaler0 and scaler1 are byte-identical (8/8). Rotate 90 and h/v flip are exact. P010 to NV12 is within 1. On flat chroma, NV12 to BGRA matches the BT.709 maths within 1 LSB. Scaling against ffmpeg bicubic: Y 44.6 dB (1080p to 720p NV12) and 43.8 dB (2160p BGRA to 1080p NV12). In GStreamer, v4l2convert (NV12 1080p to BGRA 720p) ran 300 frames on each instance. checkpatch --strict is clean. The driver builds with W=1. The apple-scaler KUnit suite passes 22/22 on arm64 QEMU. All 11 T6050 DTBs build, and dt_binding_check plus dtbs_check of apple,scaler-v23.yaml are clean.

Risk: two-way door. Only T6050 boards are affected. T8142 and older variants are unchanged. If a core fails to start, the driver fails the probe cleanly. The always-on FAB2_SOC matches what the hardware does already.

Still to run: suspend/resume. On this kernel's DT the K114s has no RTC wake (pre-#2007), so I could not run it unattended. Also still to run: a byte comparison with the J815 suite outputs, which I don't have; T6050 runs the same job images. GStreamer BGRx caps are refused because the MSR23 path offers BGRA (AR24) but not BGRX (XR24); that is a separate format addition. The J775D's die-1 scalers and the flat t6050-j775c.dts are not covered here.

Closes #4104

Hardware facts (ADT 27.2, K114s)
  • scaler0 at 0x2285000000 and scaler1 at 0x23a1000000 have hardware-version = 24 (T8142 has 23). They have the same 10 register windows at the same offsets, 20 interrupts, pre-loaded and their own DART (dart-scaler0/1). All 11 T6050 27.2 ADTs have both instances at the same addresses.
  • Engine id read at probe: 0x40f0084. The SRAM holds the pre-loaded MSR image (valid vector, crc32 0xc50a6e2b, the same on both). The core is cold (state 0), so the driver starts it and uploads nothing.
  • Before the power-up writes, the registers T8142's table touches hold reset values with the same layout. With the T8142 table, both cores answered the same hello (00000100 0 0 00100100) and STAR.
  • FAB2_SOC (MSR1's parent): Failed to reach power state 0x0 (requested 0xf0000f0, now: 0x1f0003ff) when the pwrstate driver probed it without always-on.
Job rows (identical on both instances; refs = ffmpeg swscale, accurate_rnd + full chroma)
job result vs swscale max diff
NV12 1920x1080 -> BGRA 1920x1080 (BT.709 limited) G 41.6 / B 34.7 / R 32.3 dB (bilinear) 94-119 at sharp chroma edges of testsrc2
same, flat-chroma pixels vs exact BT.709 maths 433153 px 1
NV12 1920x1080 -> NV12 1280x720 Y 44.6 dB, UV 38.9 dB (bicubic) Y 37
BGRA 3840x2160 -> NV12 1920x1080 Y 43.8 dB, UV 32.7 dB (bicubic) Y 43
P010 1920x1080 -> NV12 1920x1080 Y 52.7 dB, UV 56.5 dB 1
NV12 1280x720 rotate 90 -> 720x1280 exact 0
NV12 1280x720 rotate 270 -> BGRA same as the CSC row -
NV12 1920x1080 hflip, vflip exact 0

The CSC differences are swscale's chroma upsampling at testsrc2's hard colour edges. The engine's chroma filter lies closest to a bilinear, horizontally co-sited model. A 1:1 conversion with a mirror is refused, as on T8142. Throughput: 300 frames of NV12 to BGRA at 1080p took about 470 ms per instance, including V4L2 overhead.

Boot run

This was a one-shot of the K114s's saved Stage 2 with only the DTB's status properties changed: 9 nodes set okay plus FAB2_SOC always-on, the same set this PR enables. It used the same kernel and boot entry. Both scalers probed at boot with the image intact after boot-time power-domain handling. The suite outputs were the same bytes as in the runtime run. Kernel errors: 4 lines, all unrelated (DCP service admission, a dockchannel iface notice, ASoC routing). Afterwards the Mac was restored to its saved Stage 2 and default entry and verified.

The T6050 (M5 Pro/Max) scalers now have a qualified firmware hand-off,
power and reset path: the OS starts the core from the image the boot
loader pre-loads, as on T8142. Drop apple,t6050-scaler from the rule that
keeps an instance disabled; only apple,t8152-scaler stays there.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
T6050's two scalers report MSR hardware-version 24. Their register
windows, interrupts and firmware interface match T8142's MSR23: the core
image is pre-loaded by the boot loader (ADT pre-loaded), it starts after
the same power-up writes, answers the same hello and init messages, and
runs the job images the MSR23 builder makes.

Add apple,t6050-scaler with a variant that reuses the T8142 power-up
table. On the K114s (MacBook Pro 14-inch, M5 Pro) both instances start
and run CSC, scaling, P010 and quarter-turn/mirror jobs; their outputs are
identical to each other byte for byte.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Every T6050 ADT has scaler0 (MSR0, under FAB0_SOC) and scaler1 (MSR1,
under FAB2_SOC) with a DART each. Enable both scalers, their DARTs and
the MSR0/MSR1 and ASE core power states.

FAB2_SOC refuses to power down: asked for state 0 it stays in 0xf
("Failed to reach power state 0x0 ... now: 0x1f0003ff"), so mark it
apple,always-on like FAB0_SOC and FAB1_SOC.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 3, 2026 08:09
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) area:media Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (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 ee98422c: ready to merge

Check Detail
CI at head ok 11 checks passed
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head ok comment at ee98422c
Conflicts ok none
PR text ok Risk: two-way · . Only T6050 boards are affected. T8142 and older variants are unchanged. If a core fails to start, the driver fails the probe cleanly. The always-on FAB2SOC matches what the hardware does already. Still to run: suspend/resume. On this kernel's DT the K114s has no RTC wake (pre-#2007), so I could not run it unattended. Also still to run: a byte comparison with the J815 suite outputs, which I don't have; T6050 runs the same job images. GStreamer BGRx caps are refused because the MSR23 path offers BGRA (AR24) but not BGRX (XR24); that is a separate format addition. The J775D's die-1 scalers and the flat t6050-j775c.dts are not covered here. Closes #4104

Areas: area:bringup, area:media
Merge: gh pr merge 4156 --merge (Owners and Core through the bypass: add --admin).

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

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 3, 2026
The scaler DARTs carry a second register window, so the DART binding
requires reg-names now that the nodes are enabled. Use the same names as
the JPEG DART ("dart", "auxiliary"); the driver does not map the
auxiliary window, so nothing changes at runtime.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

dt-checks failed on 25ddb85: enabling the two scaler DARTs exposed that they have a second reg window without reg-names (20 new CHECK_DTBS warnings, one per DART per T6050 board). ee98422 names them "dart", "auxiliary", the same as the T6050 JPEG DART. apple-dart never maps an "auxiliary" window, so the hardware rows above still apply unchanged. Local dt-validate on the K114s DTB gives no warnings for either DART.

@github-actions github-actions Bot removed ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) labels Dec 3, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at ee98422

Checked: Both scaler nodes use the T6050-compatible variant, and the shared DTS includes their DART and MSR power states. The DART fix names the existing windows dart and auxiliary in the binding's order. The driver continues to use the first window for register access. The scaler binding keeps the 10-register and 20-interrupt layout, the two required power domains and the separate disabled T8152 requirement. The change is scoped through compatible data and the shared SoC include. I reviewed the existing functional result for both engines and the exact DART-name delta above that result.

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

Both scalers ran 1,218 jobs on the K114s build. The two reg-names additions leave the DART register addresses and selected window unchanged. The current head enables both firmware-backed scalers at boot, and the resume path can leave an engine down if its preloaded image is gone from SRAM. Please run a sleep/wake on the final DTB and submit jobs to both engines after wake, recording committed sleep and checking for restart warnings and DART faults.

@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 ee98422c0edd. The T6050 match selects the new variant and both enabled scalers keep their own DART and MSR power chain. The added DART names leave the resource indices unchanged. The 1,218-job K114s boot covers both engines' initial start.

Before landing, run the same conversion on both engines after a committed sleep with the final DTB, on J714s or K114s. The resume helper can leave an engine stopped when its SRAM image is missing, so record the restart log and job results as well as the system wake.

@github-actions github-actions Bot added ready-to-merge Meets the merge policy: merge it (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 3, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Exact-head J714s (T6050 / M5 Pro, firmware 27.2, SLC 16 planes) hardware verification of ee98422c0edd (both T6050 scalers after committed deep sleep with the final DTB & apple-scaler.ko, kit work/j714s-linux4156-ee98422c-20261204 SHA 6eeaef7fb113):

VERDICT #4156 J714s: PASS

Summary

  • Boot & Identity: Both Arm A (main 571a6c45, scalers disabled) and Arm B (same 7.3.0-main571a6c45 Image, vmlinux 54f3f643d077, final bd3112c5 + #4156 DTB b2742149c35c & apple-scaler.ko, both scaler nodes okay) booted cleanly on SLC 16 planes, firmware 27.2, and returned cleanly to verified stock 7.3.0-m5-pr67.
  • Bind: Arm A bound neither scaler; Arm B bound both at boot: 2285000000.scaler (/dev/video16) and 23a1000000.scaler (/dev/video17).
  • Committed Deep Sleep: Arm A completed 9 committed deep sleeps and Arm B completed 7 committed deep sleeps (PM: suspend entry (deep), apple-sleep: back from sleep, boot object resumes N -> N+1, rtcwake rc=0, suspend success +1, fail +0, same boot; early 0.57–0.67 s USB2_plug wakes occurred on both A and B from the lab USB-C cable, and Cycle 2 completed a full 30 s deep sleep on the first attempt).
  • Restart & Post-Wake Conversions (4,800 / 4,800 jobs OK, 0 failed):
    • engine0 (2285000000.scaler): 2,400 / 2,400 OK, 0 failed
    • engine1 (23a1000000.scaler): 2,400 / 2,400 OK, 0 failed
    • Across pre-sleep + all 7 committed wakes on Arm B, both engines logged MSR23: restarted after resume (submit 0x0, status 0x0) and produced bit-exact SHA-256 digests matching pre-sleep and matching engine0 == engine1 across all 3 conversion workloads (100 jobs each per checkpoint × engine):
      • csc (NV12 1080p -> ABGR32 720p): median 667.5–681.0 us, sha 9a4c10aba8e4f3df
      • p010 (P010 1080p -> NV12 1080p): median 671.7–681.1 us, sha 155f141d70c3b79e
      • rot (NV12 720p -> NV12 720×1280 rot90): median 256.3–465.4 us, sha 15db840f602d31c7
  • Kernel Log: Zero scaler warnings/errors, zero apple-dart faults, zero RTKit crashes/oops/lockups on Arm B vs Arm A.

Cycle 2 (full 30 s committed deep sleep) wake & restart log snippet

[  243.007033] aurora-j714s kernel: PM: suspend entry (deep)
[  244.577471] aurora-j714s kernel: apple-scaler 2285000000.scaler: MSR23: restarted after resume (submit 0x0, status 0x0)
[  244.592362] aurora-j714s kernel: apple-scaler 23a1000000.scaler: MSR23: restarted after resume (submit 0x0, status 0x0)

@DjDeveloperr
DjDeveloperr merged commit ec9d3f7 into main Dec 4, 2026
15 checks passed
@DjDeveloperr
DjDeveloperr deleted the media-parity/t6050-scaler branch December 4, 2026 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) area:media Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

arm64: dts: apple: t6050: both scalers disabled, no scaler device on M5 Pro/Max

2 participants