Repository navigation
media: apple: avd: repair the VP9 host control fixture - #2972
Merged
Merged
Conversation
The VP9 decoder copies request controls under the V4L2 control lock. Provide lock and allocation shims so the standalone host test builds. Exercise the busy-bank check through avd_vp9_run() so it also checks the production cleanup path under the sanitizers. Signed-off-by: Ryan Murray <[email protected]>
RyanTheTide
commented
Nov 23, 2026
RyanTheTide
left a comment
Contributor
Author
There was a problem hiding this comment.
Review at 4b0be5d. No blockers. The mock now requires the lock around the control copy, and the busy-bank case enters through avd_vp9_run(), which performs normal cleanup. I reran the exact fixture against the exact-head source with ASan and UBSan. Dependency, bank ownership, adaptation, early release and legacy fallback all passed. This repairs host coverage without changing the decoder.
DjDeveloperr
approved these changes
Nov 23, 2026
DjDeveloperr
left a comment
Contributor
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist audit at live head 4b0be5d855d1244f0438842caddbcfc4d54ee3f1.
Technical Audit (drivers/media/platform/apple/avd/tests/vp9-test.py)
- Decoder contract match (
avd-vp9.c): Matchesavd_vp9_run_preamble()lines 859–866 (v4l2_ctrl_lock(ctrl)->kmemdup()ofhdr->p_cur.pandctrl->p_cur.p->v4l2_ctrl_unlock(ctrl)) andavd_vp9_run()lines 954–957 (kfree()ofconstrun.decode_paramsandrun.prob_updates). - Lock & memory shims:
v4l2_ctrl_lock()/v4l2_ctrl_unlock()assert balanced single-lock discipline (assert(!locked_ctrl)/assert(locked_ctrl == ctrl)), andkmemdup()assertsassert(locked_ctrl)before copying exactsizebytes into amalloc()buffer.#define kfree(p) free((void *)(p))avoids-Wdiscarded-qualifiersunder-Wall -Wextra -Werroronconstpointers. - Busy-bank cleanup check: Switching the busy-bank case from direct
avd_vp9_run_preamble(&ctx, &attempt)toavd_vp9_run(&ctx)exercises the productionout:kfree()cleanup path on-EBUSYso LeakSanitizer stays clean while still asserting== -EBUSYand!dst[2].bank. - Non-blocking note:
drivers/media/platform/apple/avd/tests/vp9-test.pyis not currently wired intotools/asahi/run-host-tests.py, so CIhost-testsdid not executevp9-test.pydirectly; consider adding it in a follow-up so futureavd-vp9.ccontrol changes are caught automatically in CI.
Checklist (§1–§6) & CI
- §1 No model gating: Pass (host test fixture only).
- §2 Production-ready, no hacks: Pass.
- §3 Safety: Pass (no decoder code modified).
- §4 Clean-room & attribution: Pass — commit
4b0be5d855d1carries human author/committer (Ryan Murray <[email protected]>) and humanSigned-off-by:only, with zero AI trailers in commits; PR body disclosesAssisted-by: LLM (Codex). - §5 Evidence: Pass — host-fixture-only repair verified locally under ASan/UBSan/LSan on
integration/auroraand againsta4b51cdff0a7. - §6 Naming: Pass.
- Live CI (
4b0be5d855d1): 1/1 checkCOMPLETED / SUCCESS(host-tests: 463/463 passed).
Assisted-by: LLM (Gemini 4 Neon)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The VP9 host fixture no longer builds after the decoder started copying request controls under the V4L2 control lock.
Change
Model the control lock and copy in the host fixture. Run the busy-bank check through the decoder's normal entry point so it also exercises cleanup.
Testing
The VP9 fixture passes under ASan and UBSan on integration/aurora and against the merged decoder in a4b51cd.
Host test details
The original fixture failed to compile against the merged decoder. The repaired fixture exercises the existing dependency, bank ownership, probability adaptation, early-release and legacy fallback cases. LeakSanitizer stays enabled and the busy-bank case returns EBUSY with no new bank assigned.
Assisted-by: LLM (Codex)