Repository navigation
T6050 (M5 Pro/Max): enable both scalers - #4156
Open
RyanTheTide wants to merge 4 commits into
Open
RyanTheTide wants to merge 4 commits into
RyanTheTide wants to merge 4 commits into
Conversation
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>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
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>
Contributor
Author
|
dt-checks failed on 25ddb85: enabling the two scaler DARTs exposed that they have a second reg window without |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 noapple,t6050-scalerentry. 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-scalervariant (hardware-version 24) that reuses the T8142 MSR23 front end and power-up writes.t6050-media.dtsienables both scalers, both DARTs, MSR0/MSR1 with their ASE core states, and FAB2_SOC asapple,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 --strictis clean. The driver builds withW=1. The apple-scaler KUnit suite passes 22/22 on arm64 QEMU. All 11 T6050 DTBs build, anddt_binding_checkplusdtbs_checkofapple,scaler-v23.yamlare 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.dtsare not covered here.Closes #4104
Hardware facts (ADT 27.2, K114s)
hardware-version = 24(T8142 has 23). They have the same 10 register windows at the same offsets, 20 interrupts,pre-loadedand their own DART (dart-scaler0/1). All 11 T6050 27.2 ADTs have both instances at the same addresses.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.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)
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.