Skip to content

media: apple: jpeg: enable the M4 Pro JPEG engines on the J616s - #1047

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
eng/t6041-jpeg
Nov 6, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
eng/t6041-jpeg

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Summary

The M4 Pro/Max JPEG engines identify differently from the Neo's (ADT hw-type 0x101008, masked HWREV 0x100008 vs 0x110000), but they use the same register layout and encode programming as T8140: 64-bit address pairs, HWREV at 0x1c4, same job sequence. The driver refused them ("engine layout not supported") because the T6041 variant had no admitted revision.

  • media: apple: jpeg: admit the T6041 engines: admit masked HWREV 0x100008 under the existing stepping mask; KUnit identity cases added.
  • arm64: dts: apple: t6040-j616s: enable the JPEG engines: enable ps_jpg, jpeg0/jpeg1 and their DARTs on the J616s.

Hardware test (J616s, 11-07 03:56-04:03)

One-shot Stage 2 trial (live Stage 2 with only these status lines flipped, never committed), fleet17 kernel plus this driver change as a module:

  • Both engines probe: JPEG encoder, HWREV 0x100008.
  • 4K NV12 natural frames at q75, 8/8 encoded on each engine; software decode vs source: PSNR Y 43.8 / U 40.4 / V 38.5 dB.
  • Throughput q75: 4K about 200 fps (source-bound), 1920x1088 777 fps (engine 0) / 661 fps (engine 1); CPU jpegenc 4K 97 fps.
  • 0 DART faults, 0 new AVCs (SELinux enforcing), no new error-level log lines.
  • KUnit apple-jpeg 5/5; checkpatch --strict clean; DTB builds with no new W=1 warnings.

Known issue (driver-wide, not J616s-specific)

With GStreamer's v4l2jpegenc, heights that are not a multiple of 16 (e.g. 1080) hang/crash the pipeline: the driver pads sizeimage to whole macroblock rows (1088). 1280x720 fails caps negotiation. The same code runs on the Neo; tracked separately.

🤖 Generated with Claude Code

The M4 Pro/Max JPEG engines identify as 0x101008 rather than the Neo's
0x110000, but they use the same register layout and encode programming:
64-bit address pairs, HWREV at 0x1c4 and the same job sequence. Accept the
T6041 revision under the existing stepping mask so probe no longer refuses
it, and cover the new admission in the KUnit identity test.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Enable both JPEG engines, their DARTs and the JPG power domain on the
16-inch M4 Pro MacBook Pro now that the driver admits the T6041 revision.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
@RyanTheTide
RyanTheTide merged commit 2a760a8 into integration/aurora Nov 6, 2026
@RyanTheTide
RyanTheTide deleted the eng/t6041-jpeg branch November 6, 2026 17:04
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