Skip to content

M6/J873g: enable Kopsia hardware video decoding - #2139

Merged
Acelogic merged 8 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j873-kopsia
Nov 23, 2026
Merged

Acelogic merged 8 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j873-kopsia

Conversation

@sithglan

@sithglan sithglan commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This enables V4L2 Request hardware decoding on the Mac mini M6 (J873g/T8152). With the request-enabled FFmpeg/mpv packages, H.264, HEVC/Main10, VP9 and AV1 decode through Kopsia, and mpv presents DRM PRIME frames without a download to the CPU.

Draft for review of the initial hardware bring-up: completion is polled. The decoder and its PSD power domain are runtime power-managed: off at idle, on while frames are in flight. System suspend and fault recovery are not qualified.

Scope and prerequisites

Originally based on integration/aurora at 0abc2f385e54. Acelogic has since merged integration/aurora up to 5701541b5cd5 into the branch (ce48dd2), and added two probe-error fixes (f7450a2, 7df685e). The first three commits carry the Gen3 DART binding, locked-stream support and VHE TLBI fix from #1800, with their source commits recorded. The remaining seven commits add:

  • PSD service 50 as the shared power domain of the decoder and its DART, waiting for ACK before reading the state that consumes it.
  • Cold initialization restricted to the inactive AVD Gen3 instance, using its TLBI aperture and a 64 GiB DMA window at 1 TiB.
  • A Kopsia host backend with the MCU halted, one frame in flight, and VP/PP completion polling while work is active. Existing codec programs and completion handling are reused; no external decoder firmware is needed.
  • Bindings and the J873g decoder/DART description.

The 346 decoder tunables match the MIT-licensed avd-fw v5/tier2 table, with its attribution retained. #2106 is a related Gen3 DART implementation to reconcile during review. There are no new aura, FFmpeg or mpv source changes in this series.

Hardware validation

Mac mini M6, apple,j873g / apple,t8152, Debian forky/sid. Tested kernel: 7.3.0-aurora-j873-avd+ (#6), built from the local M6 integration base 805d9fcc6812 plus this decoder implementation. The exact rebased PR branch has not been booted; its build/schema/host checks are listed separately below.

Both asahi,os-fw-version and asahi,system-fw-version report unknown; the installed aura Stage 1 version was not recorded. Userspace: FFmpeg 7:9.0.2-6+v4l2req2, mpv/libmpv2 0.42.0-1+v4l2req2, Mesa 26.3.0~aurora.wip.ac9d556248c-1, Sway 1.12-1, OpenGL renderer Apple M6 (G18G B1).

Repeated after the final reboot:

Codec Frames compared with software Result
H.264 60 Exact
HEVC 60 Exact
HEVC Main10 60 Exact
VP9 60 Exact
AV1 60 Exact

The tests force -hwaccel v4l2request -hwaccel_output_format drm_prime, download to NV12/P010, normalize to the software pixel format and compare nonempty frame hashes. Logs must also identify the AVD media driver, so software fallback cannot pass. Three simultaneous H.264/HEVC/VP9 processes also produced 60 exact frames each.

Additional hardware results:

  • 4K60 H.264: 120 exact frames; 300 frames decoded to a DRM PRIME null sink at 112 fps.
  • mpv zero-copy rendering visually checked; a 20-second fullscreen run had zero decoder drops and two presentation drops.
  • After the final reboot, exact seeks forward and backward kept hwdec=v4l2request and DRM PRIME interop, with zero decoder or presentation drops during that test.
  • /dev/video10 and /dev/media0 present; no AVD errors, kernel WARNING/Oops/SError, or failed systemd units in the final boot.

Select hwdec=v4l2request in mpv. FFmpeg needs -hwaccel v4l2request before the input; use -hwaccel_output_format drm_prime when retaining hardware frames. CPU filters need an explicit download.

Acelogic's M6 row at 7df685e (booted from RAM through public aura, 12 CPUs, lockdep on):

  • H.264, HEVC, HEVC Main10, VP9 and AV1: 300/300 frames matched software decoding.
  • Three simultaneous processes: 180/180 matched. 3840x2160 H.264: 120/120.
  • Runtime PM: the decoder and its domain were off before playback, on during it, and off again after 10 s idle; 60/60 H.264 frames matched.
  • Interrupting H.264 and opening HEVC right away, three times: 180/180.
  • Host probe-failure checks: an unsupported Kopsia ID gives -ENODEV, and a failed first wake gives -EIO, both before video registration.

Checks on this PR branch

  • Clang 22, arm64, W=1: complete AVD objects, PSD and DART objects, and the J873g DTB build. Existing DART unused-helper and GPU reserved-memory DT warnings remain.
  • All three affected bindings pass dt_binding_check; the J873g DTB passes validation against those schemas.
  • DART host checks: 15/15; AVD host checks: 12/12; hardware defaults: 1/1.
  • git diff --check passes. Checkpatch reports no errors; remaining warnings concern new-file MAINTAINERS coverage and British spelling of acknowledgment.
  • The hardware-tested local tree also completed an Image/modules/DT build.

Remaining work

PostOffice completion is not implemented: completion is polled. Gen3 fault interrupts remain disabled, and recovery reset is disabled for Kopsia: the existing watchdog parks DMA and retires the decoder rather than issuing an unqualified reset. Whole-machine suspend/resume and fault injection have not been tested. Encoding and browser integration are outside this change.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora 0abc2f3. It is now a544621 (was b782c27); the old branch no longer merged.

On 0abc2f3: Image, modules and the J873g DTB build (LLVM 22, the M6's config, W=1, no warnings in the touched files), apple-dt-check.sh: 0 new CHECK_DTBS warnings, and its 3 changed bindings pass dt_binding_check. run-host-tests.py: 427/427. #2178 carries these commits too and was booted on the M6 with them: /dev/video10 (Kopsia) probes as before.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, Thomas. Bit-exact results for five codecs, with a check that rules out software fallback, are a strong start for the M6 decoder.

A few code asks, so this keeps working as more T8152 machines are added:

  • arch/arm64/boot/dts/apple/t8152-j873-avd.dtsi: ps_avd and avd are SoC blocks, and avd_dart is already in t8152-peripherals.dtsi (iommu@485020000). Please describe all three in t8152-peripherals.dtsi with status = "disabled" (the new DART compatible, tlbi reg, power domain and tunables too). The board then only sets status = "okay", and the J804 and J833ct get the same description.
  • drivers/iommu/apple-dart.c, cold Gen3 check: res->start != 0x485020000ULL hard-codes this instance's address. apple,t8152-avd-dart already selects the instance, and reg gives the address, so please drop the address test. The version and stream-count checks are fine.
  • avd-backend-kopsia.c avd_kopsia_poll() (the usleep_range(100, 200) loop) and avd-drv.c skipping the IRQ for Kopsia: if the ADT lists the decoder's interrupt, please describe it and complete VP/PP from the handler. Keep polling only as a fallback when the node has no interrupt, with a comment saying why.
  • Before this leaves draft: pmgr-psd.c sets GENPD_FLAG_ALWAYS_ON and has no power_off, and Gen3 DART faults are not reported (dart->irq = -1). Please add a power-off path and a Gen3 fault handler, or state the hardware reason for each in a comment.

Row: boot the exact PR head on the J873g and repeat your comparison for H.264, HEVC, HEVC Main10, VP9 and AV1, 60 frames each, all exact. Then run 4K60 H.264 to a null sink at 60 fps or more. With power-off added, /sys/kernel/debug/pm_genpd/pm_genpd_summary should show the AVD domain off after 10 s idle and on again for the next decode.

After that we will run a no-regression row for the shared DART changes on our A18 Pro (Neo) and M4 Pro.

@sithglan

Copy link
Copy Markdown
Contributor Author

Thanks. I've done the parts I can verify without the M6. The head is now ee96cb6538a7:

  • DT: ps_avd, avd and avd_dart are now described in t8152-peripherals.dtsi, all with status = "disabled". That includes the apple,t8152-avd-dart compatible, the tlbi reg, the power domain, apple,dma-range and the tunables (b967e8a1b335). t8152-j873-avd.dtsi only sets the three nodes to okay (ee96cb6538a7). I compared the preprocessed J873g tree before and after, with label references kept. The only difference is an explicit status = "okay" on ps_avd and avd. The J804 and J833ct now get the same description, disabled. dtbs_check reports nothing for the AVD nodes on any of the three.
  • DART: the cold Gen3 admission no longer tests res->start, so apple,t8152-avd-dart alone selects the instance. The version, stream-count, PSD domain, tunable and inactive-stream checks stay (fedf1864d853). apple-dart.o builds, with no new W=1 warnings.
  • Decoder interrupt: the ADT's avd node lists interrupts = [308, 268]. These follow the PostOffice pattern (299 + N, 259 + N) for its msgbox-mailbox-connection = 9, so they're that mailbox's send-empty/recv-not-empty pair, not a decoder completion line like the AVD's own mailbox lines on T8142/T6050. The backend halts the MCU, and nothing is known to raise either line then. For now there's no interrupt to describe, and I've added the comment you asked for in avd-backend-kopsia.c and at the IRQ skip in avd-drv.c (ae3336208dbd). On the M6 I'll check whether VP/PP completion raises 268 with the MCU halted. If it does, I'll describe it and complete VP/PP from the handler, keeping the poll only for a node without an interrupt.

Still open, and both need the M6:

I haven't booted this head yet. When the M6 is back on its tether, I'll run the row you listed: the five codecs × 60 frames compared exactly, 4K60 H.264 to a null sink, and the genpd summary once power-off exists.

@sithglan

Copy link
Copy Markdown
Contributor Author

Small follow-up: I rewrapped one overlong line in the DART commit message (checkpatch), so the head is now 49198181bd26. The trees are identical to ee96cb6538a7. The commits named above are now 201b537b6f28 (DART), 49b35d7d904b (Kopsia backend), b8abb2e9e37f and 49198181bd26 (DT).

@sithglan

Copy link
Copy Markdown
Contributor Author

J873g decode row. The exact head can't boot the J873g from its SSD by itself: integration has no J873g NVMe, which comes with #1797. So the kernel is #2178's head 11efadab4eb2, which carries this PR's commits as of 49198181bd26 on the #1797 base, plus #2330/#2333 for their rows. Results:

  • ffmpeg framemd5, v4l2request + DRM PRIME + hwdownload, against software decode, 60 frames each: H.264, HEVC, HEVC Main10, VP9 and AV1 are all exact, and every hardware log shows Using V4L2 media driver avd.
  • 4K60 H.264 to a null sink (3840×2160, 59.94 fps, 3016 frames): 20.6 s, i.e. 146 fps on average (2.44× real time), with no AVD or DART errors in dmesg.

The genpd row (AVD off after 10 s idle, on for the next decode) waits for the power-off path, which is what I'm doing next. It comes with the generic PSD provider discussed on #1797.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, Thomas. The SoC description, the dropped address check and the comment on the ADT mailbox pair cover those points. The decode row on #2178 is fine given the NVMe dependency.

Still open before this leaves draft: the PSD power-off, and Gen3 DART fault reporting (apple-dart.c, dart->irq = -1, "for now"). Doing both on the M6 first is reasonable.

On the 346 decoder tunables: the table is avd-fw's v5/tier2 one, made for an earlier decoder. Does the J873g ADT avd node carry its own tunables, as the DART's do? If so, please describe them in DT the way avd_dart does. If not, please say in the commit how you checked that the table fits T8152, for example against a trace of macOS register writes on the M6.

Row once power-off lands: pm_genpd_summary shows AVD off after 10 s idle and on for the next decode, with the five codecs still exact.

@sithglan

Copy link
Copy Markdown
Contributor Author

The power-off path is in. The head is now 892664b3b581:

  • The AVD's PSD domain is now the generic apple,t8152-psd provider from pmdomain: apple: T8152 PSD services as power domains #2459, which replaces this PR's own PSD binding and driver commits. ps_avd no longer has apple,always-on, so genpd powers the decoder and its DART off when both are idle. The provider is IRQ-safe, because the DART is an IRQ-safe device; without that, genpd keeps the domain on.
  • On resume the DART takes its usual lost-state path (the cold Gen3 init, then the saved TTBR/TCR), and the decoder runs the whole Kopsia setup again (avd_backend_boot()).

genpd row on the J873g (#2178's stack, which carries these commits):

  • At boot the domain powered off 2 s after probe: avd off-0, PSD state register 6.
  • The five codecs, 60 frames each against software, were all exact across 292 on/off transitions during the run. 4K60 H.264 to a null sink ran at 150 fps.
  • 11 s after the last decode the domain was off again.
  • Transitions took 390–500 µs for on and about 240 µs for off. No DART or AVD errors.

That leaves the Gen3 DART fault handler, which I'm working on now on the M6.

@sithglan

Copy link
Copy Markdown
Contributor Author

Gen3 faults are done. The head is now b4923f3a644d.

Gen3 DART faults ("iommu: apple-dart: report T8152 Gen3 DART faults"). A Gen3 DART turns out to report faults like a v2 DART: the pending-stream bitmap at 0x4000 and a record per stream at 0x8000 (status, address), acknowledged by writing the bitmap back. So Gen3 DARTs now request their interrupt and use apple_dart_t8110_v2_irq(). The only Gen3-specific case is the unlock after a lock-on-error exception, because it would go through the TLB command register, which serves translation queries on Gen3. A Gen3 DART with lock-on-error set reports that its stream stays stopped and does not touch that register. All the J873g's Gen3 DARTs have lock-on-error clear (diag 0).

Tested on the J873g with a TEST-only knob that cleared the AVD DART's SID 0 TTBR during an H.264 decode:

  • One interrupt: translation fault: SID:0 write TTBR invalid at 0x10fff000000 (status 0x00000100). The bitmap was acknowledged and the fault didn't repeat (IRQ count 1).
  • The decoder's recovery parked DMA and retired it.
  • After restoring the TTBR and reloading the decoder, the same file decoded bit-exact against the run before the fault.
  • None of the other eight Gen3 fault lines fired during the boot, including the locked display DARTs with three displays running.

The commit is the one I added at the end of #1800, carried here after this PR's copies of #1800's DART commits. I also updated the backend commit's message, because PostOffice completion and suspend/resume are now the only open parts. With the power-off path and this, all of the code asks from your review are addressed.

@sithglan

sithglan commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

On the decoder tunables: the J873g ADT's avd node has no tunables. Its properties are reg, interrupts, the clock/power/service gates and resets, the iommu and mailbox links, and version and capability fields like avd-version, decode-samples-per-second and h264-playback-level. It has no child nodes. So unlike avd_dart, there's nothing for the device tree.

I don't have a trace of macOS's register writes on the M6. The macOS tracer I have runs on the J813 only, and an M6 MMIO trace of the decoder bring-up is a separate project. What I can show comes from outside, on the J873g. With this table:

  • the five codecs decode bit-exact against software;
  • 4K60 H.264 runs at about 150 fps;
  • the results stay exact across 292 power-domain cycles in one run, each of which re-applies the whole table after the decoder has been cold.

That's what the backend commit (e27c046fa931 in the stack, head e9da8548f33f) now says, along with the table's provenance. If you want the MMIO trace as well before this leaves draft, I'll take it on as a follow-up and describe whatever it shows.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, Thomas. The power-off path with the genpd numbers, and the Gen3 fault handler with the injected-fault test, cover everything we asked for in the code. The lock-on-error case stopping the stream rather than touching the query register is the right call.

On the tunables: thanks for checking the ADT and for putting the evidence in the commit. Whether the table needs an M6 trace as well is a question for the maintainer review, so no need to start that project for us.

For leaving draft: once #2459 and #1800 are in, a rebase that drops their copies here (the PSD binding and driver, and the DART commits) would leave this PR with only its own decoder changes.

@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora d1b022dc34fb (Ryan's tidy-up on #1799). The new head is 6a2bbe86dfa1. It's on integration/aurora directly, with #2459's current two commits. The conflicts, the two host-test fixtures that needed the new fields, and the checks (461/461 host tests, W=1 builds) are listed there: #1799 (comment)

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of 6a2bbe8: no change to the decoder or DART code. The only changes are the host-test fixture fields for the new bcm4377-radio-sids test (gen3, cold_gen3) and the PSD commits, which are now #2459's current two (own APPLE_PMGR_PSD symbol, default on with ARCH_APPLE). Our view stands. As before, once #2459 and #1800 are in, rebasing to drop their copies leaves only the decoder commits here. A J873g rerun of the five-codec comparison on this head would confirm the rebase.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide the J873g rerun on this head (6a2bbe86dfa1).

Kernel: 7.3.0-aurora-j873-avd2139+.

The five codecs. 60 frames each, with -hwaccel v4l2request -hwaccel_output_format drm_prime, downloaded to NV12 (P010 for Main10) and compared frame by frame with FFmpeg's software decode. Each hardware run logged "Using V4L2 media driver avd".

codec frames differing frames
H.264 60 0
HEVC 60 0
HEVC Main10 60 0
VP9 60 0
AV1 60 0
  • H.264, HEVC and VP9 decoded at the same time in three processes: 60 frames each, 0 differ.
  • /dev/video10 and /dev/media0 are bound to the avd driver.
  • 0 failed units and 0 AVC denials.
  • No AVD, DART or PSD error, fault or timeout in the kernel log. The only kernel errors are the boot-time lines this stack always has (btcentauri, the ASoC Secondary line, P-state 10 has no OPP, two i2c NACKs).
  • The M6 is back on its default kernel.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora 95a13cf. The head is 834a46b. One conflict:

Commits 1-9, 11 and 12 are identical; 10 differs only by this resolution.

Checks:

  • W=1 build of drivers/media/platform/apple/avd/, apple-dart.o, drivers/pmdomain/apple/ and the J873g DTB: clean.
  • run-host-tests.py avd 12/12, dart 16/16, pmgr 3/3. tests/vp9-test.py passes.
  • DART lint: 0 new (the Kopsia DART has its domain).
  • checkpatch: unchanged.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J873g rerun at 6a2bbe8: five codecs with 0 differing frames and the concurrent three-process run cover the rebase. 834a46b is a rebase only. Commit 10 differs only by keeping #2773's avd_backend_is_open() next to the split IRQ handler, and since Kopsia isn't the open backend it keeps the 64-pixel VP9 floor it had before (avd-vp9.c:681). So the rerun still covers this head, and our view stands.

Assisted-by: LLM (Claude:Opus 5.5)

@Acelogic

Copy link
Copy Markdown
Member

I retested 7df685edb2aa8fbd7b1c2dc27f261bbc8b739be1 on our physical J873g Mac mini M6 after the two probe fixes. This head includes public integration/aurora at 5701541b5cd5. The board booted the test kernel from RAM through public aura with all 12 cores online. The booted image reported the full PR commit in /etc/kernel-commit.

Hardware test Result
H.264, HEVC, HEVC Main10, VP9 and AV1 All 300 frames matched software decoding
H.264, HEVC and VP9 in three simultaneous processes All 180 frames matched
3840×2160 H.264 All 120 frames matched
Runtime power management The decoder and its power domain were suspended/off before playback, active/on during playback, and suspended/off again after ten seconds idle. All 60 H.264 frames matched
Interrupt H.264 playback, then immediately open HEVC All three cycles passed and all 180 HEVC frames matched

FFmpeg logged the avd V4L2 media driver for every stream. The kernel stayed at taint zero with lock debugging enabled. The workload logs showed no new AVD, DART or power-domain errors or kernel warnings.

I also checked probe failures on the host using the actual probe code with simulated hardware responses. An unsupported Kopsia ID returned -ENODEV, and a failed first wake propagated -EIO. Both stopped before video registration. Early backend failure allocated no spare IOMMU domain, and failed media registration released the domain it had allocated. The supported-ID and legacy firmware cases passed as well. The local ARM64 suites passed (12/12 AVD, 16/16 DART, 3/3 PMGR).

The runtime power measurement above supersedes the always-on limitation in the opening description. Whole-machine suspend/resume and decoder recovery after a hardware fault were outside this run.

@sithglan

Copy link
Copy Markdown
Contributor Author

@Acelogic thanks for the row and both fixes. I reviewed them and they are right:

  • f7450a2. For Kopsia, the first runtime resume is where the hardware ID is checked, so failing the probe there (before avd_v4l2_init()) is the right place. pm_runtime_resume_and_get() already drops its reference on failure.
  • 7df685e.
    • Moving the empty_domain allocation after the fallible setup is safe: only the runtime-PM paths use it (avd_pm_park() and avd_pm_recover()), and those can only run after avd_pm_enable().
    • It also fixes leaks of mine: the backend, DMA-mask, IRQ and PD errors returned without freeing it, and so did a failed avd_v4l2_init().
    • Freeing it in the error path without a detach is fine too. The device is attached to it only when the queue parks DMA after a decode fault, and there are no frames before the video device is registered.
    • queue_work is initialized by avd_queue_init() at the top of probe, so the cancel is always on an initialized work.
  • The AVD objects build clean with W=1 at 7df685e (ARCH=arm64 LLVM=-22).

One thing before merge: neither f7450a2 nor 7df685e has a Signed-off-by:. Could you amend both with yours? I can't add it for you. I won't push to the branch in the meantime, so your amend won't race with anything.

I also updated the description. Your runtime-PM measurement replaces the "power domain stays on" note, since PSD power-off has been in the series since the 11-19 rework. Your row is listed, and the base line now names your integration merge.

Assisted-by: LLM (Claude:Opus 5.5)

sithglan and others added 8 commits November 22, 2026 23:18
The AVD Gen3 DART uses the shared TLBI aperture like the display DARTs,
but Linux initializes it from an unlocked state with inactive streams.
Require its PSD power domain, DMA aperture and initialization tunables.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Admit cold Gen3 setup only for the instance its apple,t8152-avd-dart
compatible selects, with version 0x300, 16 streams, its PSD domain, ADT
tunables and inactive streams 0..2. Clear those streams, apply their
tunables and use the Gen3 TLBI aperture before enabling translation.

Map the TLBI aperture before reset and select a two-level 16K page table
inside a single 64 GiB high DMA window. Keep the existing locked display
DART admission and all other unlocked Gen3 instances unchanged.

On J873g this maps all three decoder streams for bit-exact H.264, HEVC,
HEVC Main10, VP9 and AV1 decoding. Gen3 fault IRQ handling and suspend
recovery remain outside this initial bring-up.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe the Kopsia MCU, decoder, wrapper and PIODMA register apertures,
its three DART streams and its shared PSD power domain. The initial
transport submits from the host with the MCU halted and polls completion;
it does not use the PostOffice mailbox or the legacy decoder reset line.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
T8152 Kopsia retains the T8142 codec program format but uses different
initialization and completion registers. Add a host backend that halts
the MCU, initializes the wrapper and PIODMA, and reuses the existing codec
submission and completion logic with one frame in flight. Poll VP/PP
status only while a frame is active.

Enable H.264, HEVC, VP9 and AV1 on this variant without an external
firmware image. Retain the 128-byte H.264 MV and HEVC v5 header quirks.
Disable recovery reset: the existing watchdog parks DMA and retires the
decoder instead of issuing an unqualified reset.

The 346 register tunables are unchanged from the MIT-licensed avd-fw
v5/tier2 table. The J873g ADT's avd node carries no tunables of its own
(unlike its DART's), so there is nothing T8152-specific to describe in
the device tree. The table was checked on the J873g by its output: with
it, H.264, HEVC, HEVC Main10, VP9 and AV1 decode bit-exact against
software (60 frames each), 4K60 H.264 runs at about 150 fps, and the
results stay exact across hundreds of power-domain cycles, each of
which applies the table again. On J873g, forced DRM PRIME decode and download compares
exactly with software for 60 frames of each codec, including HEVC Main10;
mpv also renders through DRM PRIME and seeks in both directions.

The decoder is runtime power-gated through its PSD domain: the backend
is set up again on every resume. A DART fault (injected on the J873g)
retires the decoder through the existing recovery path until the module
is reloaded. PostOffice completion and suspend/resume remain
outstanding.

Link: https://github.com/aurora-silicon/avd-fw/blob/ea3a65cc9c0c41907e6ad2714b813e4be6858485/src/hw/tunables/tunables_v5t2.h
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe the T8152 Kopsia decoder in the SoC peripherals, disabled, so
every T8152 board can enable it: its five register banks, PSD service 50
(apple,t8152-psd) as the power domain shared by the decoder and its DART,
powered off by genpd while both are idle, and the DART as
the apple,t8152-avd-dart instance with its Gen3 TLBI aperture, its
initialization tunables and a 64 GiB window at 1 TiB inside the native
1..4 TiB DMA aperture. The tunables are those of the J873g's ADT.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Enable the T8152 decoder, its PSD domain and its DART on the J873g.

This enables the request decoder node used by FFmpeg and mpv on the M6
Mac mini. The PSD provider supplies both AVD and DART so translation is
initialized only after their shared domain is powered.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The Kopsia backend checks the hardware ID at the first runtime resume.
Propagate a failed resume before registering the media device. Preserve
the existing firmware transport probe behavior.
Allocate the empty IOMMU domain after the fallible backend, DMA and
power-domain setup. Cancel the queue work scheduled on runtime resume
and release the empty domain when probe fails after enabling runtime PM.
@Acelogic

Copy link
Copy Markdown
Member

I rebased the original PR onto the public #1800 merge e8e852d19f8434ee8ccbca3a1ebe57c3a668af77 and retested the resulting head e75d18571f9d248027d9772025419a13cb52423d on the physical J873g Mac mini M6. The PR now contains the six decoder commits and the two probe fixes. The shared display-DART and power-domain commits are already on the base.

The M6 booted this exact head through public aura with the display and decoder drivers enabled and all 12 CPUs online. FFmpeg selected the hardware AVD driver in every stream.

  • All 600 frames matched software decoding in nine comparisons covering H.264, HEVC, HEVC Main10, VP9, AV1, three concurrent streams, and 4K H.264.
  • The decoder powered on for H.264 playback and went back to suspended/off after ten seconds idle. All 60 frames in this run matched.
  • Interrupting H.264 playback and immediately opening HEVC passed three times. All 180 HEVC frames matched.
  • All 12 cores remained online, the kernel stayed at taint zero, and the workloads produced no new decoder, DART, power-domain or kernel warning diagnostics.

On the same boot the combined stack also passed the 3840×2160 KMS modeset, 60 page flips, and disable/re-enable check, using the measured main-DCP endpoint handoff documented on #1800. Local checks on this source tree passed again (12/12 AVD, 16/16 DART and 3/3 PMGR). Both changed bindings and the rebuilt J873g DTB also passed scoped validation using dtschema 2026.9. The six controlled probe cases are documented in the earlier test comment.

@Acelogic
Acelogic marked this pull request as ready for review November 23, 2026 04:22
@Acelogic
Acelogic merged commit b10280c into aurora-silicon:integration/aurora Nov 23, 2026
8 checks passed
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.

3 participants