Skip to content

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

Open
RyanTheTide wants to merge 4 commits into
mainfrom
media-parity/t6050-scaler
Open

RyanTheTide wants to merge 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: not ready yet

Check Detail
CI at head running running: apple-build, dt-checks, 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 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

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

This branch has not been deployed

No deployments
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) 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.

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

1 participant