Skip to content

media: apple: jpeg: complete the T6000 reset image, enable M1 Pro JPEG - #1237

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
jpeg/t6000-reset-image
Nov 8, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
jpeg/t6000-reset-image

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Enables JPEG encode on the M1 Pro (T6000). #1226 added the legacy32 layout but left T6000 refused at probe, because the reset image was missing its sparse scratch defaults.

  • apple-jpeg: the legacy32 reset image is complete. It adds 33 missing defaults: 32 zero writes plus 0x234 = 0x1f40. Registers in that block that are not listed (0x1a4, 0x1b8, 0x20c, 0x210, 0x238, 0x24c) stay unwritten. The image now has 111 static defaults, plus the tiling write the helper appends. reset_complete = true, so probe accepts T6000. The reset handshake is the existing shared aj_reset().
  • T6000 completes jobs with INT_STATUS bit 31 (observed below), so its done mask is now BIT(31) only.
  • KUnit: image length 112 in both encode and idle modes, 0x234 = 0x1f40, all new entries zero, holes not written, -ENOSPC at 111 slots, mask BIT(31).
  • t6000.dtsi: enables jpeg0/jpeg1 and their DARTs (M1 Pro boards). T6001 and T6002 stay disabled.

Test: M1 Pro J316s, fleet36 kernel + this driver

DT enabled at runtime (RAM only), with the shipped node descriptions; the DARTs bind as apple,t6000-dart. Restored by reboot. The test build had the old two-bit mask plus a log line for INT_STATUS.

jpeg@409000000 jpeg@409008000
HWREV 0xd1013 0xd1013
PSNR q75 avg (4K / 1080p / 720p / 480p) 41.61 / 43.36 / 43.29 / 41.62 dB identical
gst -e EOS drain 3/3 at every size 3/3 at every size
fps, gst smpte, 4K / 1080p (3 runs) 120.4 / 121.4 / 118.7 ; 430.5 / 438.3 / 434.3 119.0 / 120.5 / 120.5 ; 436.7 / 437.1 / 436.6
INT_STATUS on completion 0x80000000 (50/50 jobs logged)
  • Frames held in driver buffers (jpeg-enc, a test copy of tools/asahi/prores-enc): 4K NV12 122.3 fps, 1080p NV12 440 fps, 4K NV16 93.0 fps.
  • 3x pm_test=devices freeze with both engines bound; both engines encoded after each cycle. The M1 Pro has no wake-capable RTC yet, so there was no real s2idle.
  • 0 DART/JPEG faults, SELinux enforcing, 0 AVC.

Does it need a DRAM floor? (Neo #899)

I ran each case six times, alternating three runs with the CPUs idle and three with one P-core (cpu9) spinning. Frames were held in driver buffers.

engine case CPUs idle (fps) one core busy (fps) gap
JPEG 4K NV12 q75 122.3 / 122.3 / 122.5 122.8 / 122.8 / 122.8 +0.4%
JPEG 1080p NV12 q75 437.3 / 442.6 / 441.1 448.5 / 447.8 / 448.4 +1.6%
JPEG 4K NV16 q75 93.0 / 93.0 / 92.8 93.3 / 93.3 / 93.3 +0.3%
ProRes 4K NV16 HQ 402.1 / 402.1 / 401.7 403.5 / 403.6 / 403.5 +0.4%
ProRes 4K NV24 4444 280.2 / 280.1 / 280.1 280.8 / 280.9 / 280.8 +0.2%
ProRes 1080p NV16 HQ 1588 / 1603 / 1580 1608 / 1608 / 1608 +1.1%

On the Neo the same comparison showed +16-20% before #899, so there is no gap here worth a floor. T6000 also has no PMC DCS-floor provider, and its PMP perf entries are still unqualified (#1064).

macOS reference: not measured. Policy says Ryan must be told before macOS boots on the M1 Pro, and no one was at the machine. For comparison, macOS on the Neo-class engine: 4K 150 / 1080p 556 fps.

Clean-room source: Daybreak t-5786 clean contract, which contains register facts only.

Gates: KUnit apple-jpeg 12/12 (arm64 QEMU), W=1 out-of-tree build against fleet36 with 0 warnings, j314s/j316s/j316c/j375d DTBs build.

Evidence (our own measurements): traces/codec/20261109-m1pro-jpeg-t6000-gap.

Assisted-by: LLM
Signed-off-by: Ryan Murray 81541646+RyanTheTide@users.noreply.github.com

🤖 Generated with Claude Code

Add the 33 sparse scratch defaults the legacy32 reset image was missing
(32 zero writes and 0x234 = 0x1f40; the holes in that block stay
unwritten), so T6000 no longer refuses at probe. T6000 completes jobs
with interrupt status bit 31, so accept only that bit.

Tested on the M1 Pro (J316s, fleet36 + this driver, DT enabled at
runtime): both engines identify as HWREV 0xd1013; NV12 encodes at
3840x2160/1920x1080/1280x720/640x480 decode with ffmpeg at 41.6-43.4 dB
PSNR (q75) on both engines; GStreamer -e drains; every job completed
with INT_STATUS 0x80000000; three pm_test device suspend cycles with
both engines bound; no DART or JPEG faults.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Both T6000 JPEG engines now probe with a complete reset image. Enable
them and their DARTs for the M1 Pro boards; they are SoC blocks with no
board-specific wiring. T6001/T6002 stay disabled.

Tested on the M1 Pro (J316s), see the driver change.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant