Skip to content

Test M2 DCP, AVD and ANE firmware contracts - #2964

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
kunit/m2-driver-coverage
Nov 23, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
kunit/m2-driver-coverage

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

The display and video decoder tests missed firmware and variant selection used by the M2. The AVD host recovery fixture also stopped compiling after the decoder gained a no-reset variant.

Change

Add KUnit coverage for DCP 13.5 admission and IOMFB methods, 27.x table validation, T8112 AVD variant selection, and reverse physical placement of ANE preload ranges. Update the AVD host recovery fixture and verify that the no-reset path leaves DMA parked. Add missing module descriptions to three ANE firmware test modules.

Testing

Arm64 QEMU passed 522 cases with one unrelated skip. The AVD host queue, decode-program, dispatch and recovery tests passed. The display, decoder and ANE firmware tests link as arm64 modules against fleet85 exports.

Test details
  • DCP with 13.5 firmware accepts both the legacy 13.3 compatibility property and explicit 13.5. The legacy start, modeset, swap and power methods have distinct nonempty tags. The 27.2 table differs from the 27.0 table, and validation refuses unknown versions or missing required methods.
  • AVD matches the T8112 device-tree entry to its open decoder firmware, stream setup and supported codecs. The queue host test ran 100,000 shuffled operations and observed 36,424 ordered retirements. The recovery fixture checks that the no-reset variant leaves the DART domain parked with no reset, boot or DMA reattach.
  • The ANE test accepts adjacent DATA-before-TEXT physical regions and rejects overlap and wrap at the end of DATA.
  • Module checks used fleet85’s config and symbol exports with BTF and automatic signing disabled for the local build. The three ANE metadata warnings are gone.
  • The skipped test requires CONFIG_UCLAMP_TASK and covers GPU utilization.

Still to run

The DCP 27.2 production boot, ANE firmware startup and DP-audio hardware sleep rows are tracked with their respective driver changes.

Assisted-by: LLM (Codex)

Cover 13.5 firmware with legacy and explicit compatibility, required
legacy IOMFB commands, and firmware-27 method selection and refusal. Test
the real driver with local OF properties and a copy of the 27.2 method
table.

Signed-off-by: Ryan Murray <[email protected]>
The extracted recovery function now checks the variant before resetting
the decoder. Model the variant and verify that the no-reset case keeps
DMA parked without restarting the decoder.

Fixes: 0c94baf ("media: apple: avd: don't reset the T6041 decoder in recovery")
Signed-off-by: Ryan Murray <[email protected]>
Use the probe match table and a local OF node to check the T8112 open
firmware, codec mask and stream setup. Register the suite in the decoder
so it also builds when the driver and tests are modules.

Signed-off-by: Ryan Murray <[email protected]>
Cover contiguous reverse physical placement, overlap in that direction,
and overflow past the end of the second segment.

Signed-off-by: Ryan Murray <[email protected]>
Add module descriptions for the pending request, HWX and preload suites
so that modpost accepts the ANE firmware tests as modules.

Signed-off-by: Ryan Murray <[email protected]>

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 pre-PR checklist review at d80fe820d7e23e96ecc2dc4da9989e80bbecf3e7:

  • §1 No model gating: Pass. Pure KUnit / host-test additions and module metadata; zero runtime driver behavior changes. All new tests exercise existing DT match tables, firmware admission, IOMFB method tables, and ANE preload range checks.
  • §2 Production-ready, no hacks: Pass. No new command-line or module parameters, no sleeps/retries, and no lab-only driver paths. KUnit inclusions are cleanly gated (IS_ENABLED(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST) in dcp.c/iomfb_v13_3.c matching existing suites, and IS_REACHABLE(CONFIG_VIDEO_APPLE_AVD_KUNIT_TEST) in avd-drv.c so tristate =m/=y combinations build cleanly without built-in-to-module link errors).
  • §3 Safety: Pass. No hardcoded hardware limits. recovery-test.py now models AVD_QUIRK_NO_RECOVERY_RESET (BIT(5)) and verifies the safety invariant that the no-reset variant stays parked on empty_domain with IRQ off and zero resets/boots/detaches; ane_preload_physical_order_test verifies DATA-before-TEXT overlap rejection and U64_MAX wrap-around rejection.
  • §4 Clean-room and attribution: Pass. All 5 commits (a834150cfa50..d80fe820d7e2) carry human author/committer (Ryan Murray <[email protected]>) and human Signed-off-by: only, with zero AI trailers in commits (Fixes: 0c94baf620c7 verified) and PR-body disclosure present. No proprietary code, strings, offsets, or forbidden provenance comments.
  • §5 Evidence & CI: Pass. Both required CI workflows are green on d80fe820d7e2: Apple DRM KUnit / kunit (138 passed, 1 unrelated CONFIG_UCLAMP_TASK skip; apple-dcp-firmware 2/2 and apple-iomfb-legacy-methods 1/1 passed) and Host tests / host-tests (463/463 passed). Additional local arm64 QEMU KUnit (522 cases), AVD host tests, and arm64 =m module link checks are reported, and drivers/media/platform/apple/avd/tests/recovery-test.py was independently verified locally with -Wall -Wextra -Werror -fsanitize=address,undefined (PASS).
  • §6 Naming & KUnit hygiene: Pass. Clean upstream/Aurora naming throughout, proper __be32 / cpu_to_be32 usage, KUnit-managed allocations (kunit_kmalloc) with no stack/global DT mutation, and the three MODULE_DESCRIPTION(...) additions resolve modpost warnings on ane_h16_{hwx,pending,preload}_test.ko.

Approved for MERGETRAIN-LINUX4.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide merged commit 65c274f into integration/aurora Nov 23, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the kunit/m2-driver-coverage branch November 27, 2026 13:21
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.

2 participants