Skip to content

media: apple: jpeg: T8112 (M2) encode, enable both M2 engines; T6000 layout (refused) - #1226

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
jpeg/t8112-t6000-layouts
Nov 8, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
jpeg/t8112-t6000-layouts

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Adds T8112 (M2) JPEG encode and enables both M2 engines. Also adds the T6000 (M1 Pro) legacy32 register layout, which stays refused at probe until its reset image is complete.

  • apple-jpeg: register layouts, reset images, DMA widths and completion masks come from per-compatible match data. T8112 uses the wide64 layout shared with T6041/T8140. T6000 gets the compact legacy32 map with 32-bit address bounds (never truncated). KUnit covers the layouts and job programming.
  • Merged onto current integration: integration already describes the T8112 and T6000 JPEG engines and DARTs (disabled) in the *-peripherals.dtsi files, and its binding already covers both compatibles with the apple,jpeg fallback. So this branch keeps integration's binding and nodes and drops its own duplicates. The driver keeps media: apple: jpeg: take NV12/NV16 in one buffer, keep CAPTURE size, fix drain #1072's single-buffer NV12/NV16.
  • t8112.dtsi: enables m2_jpeg0/1 and their DARTs for all four M2 boards (SoC blocks, no board wiring).

Test: M2 J413, fleet33 kernel + this driver

DT enabled at runtime (RAM only, overlay that sets status = "okay"), with gst v4l2jpegenc and ffmpeg. Same script as the Neo check for #1072.

jpeg@265000000 jpeg@265008000
HWREV 0xe0008 0xe0008
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, smpte source, 4K (240 frames x3) 108.7 / 119.9 / 114.6 102.8 / 114.1 / 117.8
fps, smpte source, 1080p (600 frames x3) 403.1 / 418.6 / 421.3 400.8 / 427.8 / 406.9
  • On the M2 the smpte videotestsrc alone runs at 474 fps at 1080p, so those rows are limited by the source. With the cheap black pattern, engine 0 does 656 fps at 1080p and 181 fps at 4K.
  • 3x s2idle (rtcwake -d rtc1 -m freeze) with both engines bound: 3/3 resumed, and both engines encoded after every resume.
  • 0 DART/JPEG faults, SELinux enforcing, 0 AVC on recheck.
  • Removing the overlay at runtime (which unbinds and deletes the DART platform devices) resets the M2. That is a limit of the test tool, not something the shipped DT does. rmmod apple_jpeg alone is clean.

macOS reference: not measured on the M2. Its macOS has FileVault and needs a console login, and no one was at the machine. For comparison, our earlier runs on other Macs: Neo Linux 4K 188 / 1080p 623 fps (#1072); macOS on the Neo-class engine 4K 150 / 1080p 556 fps.

Not measured: a perf (PMP) vote for JPEG on T8112. pmp_report_jpg is disabled pending #1064, so these numbers have no performance request.

T6000: probe returns -EOPNOTSUPP until the legacy32 sparse scratch defaults are specified (tracked as Daybreak t-5786). The M1 Pro nodes stay disabled.

Gates: KUnit apple-jpeg 12/12 (arm64 QEMU), W=1 out-of-tree build against fleet34 with 0 warnings, j413/j415/j473/j493 DTBs build.

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

🤖 Generated with Claude Code

Select register maps, reset images, DMA widths and completion masks through immutable compatible match data. T8112 shares the wide64 profile; describe the compact legacy32 map and enforce its address bounds without truncation. Add disabled engine/DART nodes, binding examples and KUnit coverage.

The clean register contract omits the exact sparse T6000 scratch reset entries. Keep that variant refused at probe until its reset image is complete. Document this limitation and the remaining recovery and board qualification requirements.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Shorten nested assertions and align continuation lines reported by strict checkpatch in the buildbox validation run.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Store builder errors before checking them so the rejection cases remain readable under the strict line-length check.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Take the T8112 wide64 and T6000 legacy32 layout work onto current
integration. Integration already describes the T8112 and T6000 JPEG
engines and their DARTs (disabled) in the per-SoC peripherals files, and
its binding already covers both compatibles with the apple,jpeg fallback,
so keep integrations binding and DT files and drop the branchs
duplicate nodes. Keep the single-buffer NV12/NV16 wording from #1072.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The T8112 JPEG engines now have wide64 match data. Enable both engines
and their DARTs for every M2 board; they are SoC blocks with no
board-specific wiring. T6000 stays disabled (incomplete reset image).

Tested on the M2 (J413, fleet33 + this driver, DT enabled at runtime):
both engines identify as HWREV 0xe0008 and bind; NV12 encodes at
3840x2160/1920x1080/1280x720/640x480 decode with ffmpeg at 41.6-43.4 dB
PSNR (q75) on both engines; GStreamer -e drains (3/3 per size); three
s2idle cycles with both engines bound, encoding after every resume; no
DART or JPEG faults.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
@RyanTheTide
RyanTheTide merged commit feb6575 into integration/aurora Nov 8, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the jpeg/t8112-t6000-layouts branch November 8, 2026 13:10
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