Video: modularize iris V4L2 runner, add stack switching, Kodiak FW hot-swap, and resilient media fetch#176
Merged
abbajaj806 merged 1 commit intoqualcomm-linux:mainfrom Sep 30, 2025
Conversation
… FW hot-swap, and resilient fetch
- Split responsibilities across run.sh, functestlib.sh, and lib_video.sh
- run.sh: early rootfs resize (>=2GiB), early bundle fetch, platform-aware
stack selection, udev refresh/prune, structured loop + results.
- lib_video.sh: platform detect (lemans/monaco/kodiak), runtime & persistent
blacklists, hot-switch helper (modprobe→insmod fallback), validation,
DMESG triage, jq-less JSON clip parsing, Kodiak firmware helpers:
* video_kodiak_install_firmware: scan /opt for
vpu20_p1_gen2 backups; install to /lib/firmware path
* video_kodiak_swap_and_reload: install + remoteproc reload → module
reload → unbind/bind; refresh /dev/video* on success
- functestlib.sh: moved ensure_rootfs_min_size here for reuse.
- Networking: if ensure_network_online() is present (as used in audio),
call it before bundle fetch; on offline, decode cases are skipped.
Signed-off-by: Srikanth Muppandam <smuppand@qti.qualcomm.com>
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.
Why
We’ve been maintaining a monolithic video test runner that mixed orchestration, platform logic, firmware handling, and test loops.
This PR modularizes the runner, adds robust upstream/downstream stack control across platforms (lemans/monaco/kodiak), and makes firmware & media handling safer and more automated—especially for Kodiak and for offline labs.
What’s in this PR
New/updated scripts
run.sh
Calls shared libs: functestlib.sh and lib_video.sh.
Early rootfs resize: ensures / has ≥2 GiB before any download (ensure_rootfs_min_size 2).
Early bundle fetch (best-effort): pulls TAR_URL media unless --config/--dir is given or EXTRACT_INPUT_CLIPS=false.
Stack selection: --stack {auto,upstream,downstream,base,overlay,up,down} with platform awareness --platform {lemans,monaco,kodiak} (auto-detect by default).
Kodiak upstream pre-step: if --stack upstream on Kodiak, attempts a firmware restore from backups to /lib/firmware before switching (video_kodiak_install_firmware).
Device node refresh: udev trigger + prune stale /dev/video* and /dev/media*.
Clips ensure: validates inputs from JSON, attempts fetch if missing; offline decode cases are skipped (encode continues).
Structured logging, CSV summary, optional JUnit (only if --junit is passed).
utils/lib_video.sh
Stack control:
Runtime block/unblock via /run/modprobe.d/ and persistent blacklist edits (idempotent).
Hot-switch (best-effort, no reboot): unload/load modules with modprobe-then-insmod fallback.
Validation helpers for upstream/downstream presence per platform.
Kodiak firmware handling:
video_kodiak_install_firmware: scans backups in ${VIDEO_FW_BACKUP_DIR:-/opt} (supports multiple patterns like vpu20_p1_gen2_*.mbn, .mbn., *.bak) and installs to /lib/firmware/qcom/vpu/vpu20_p1_gen2.mbn.
video_kodiak_swap_and_reload: installs new FW and attempts remoteproc reload, then module reload, then unbind/bind—with device-node refresh after success.
Media fetch:
video_ensure_clips_present_or_fetch: jq-less JSON scanning to gather input clips; if missing, uses extract_tar_from_url and optionally ensure_network_online (see “Networking”).
DMESG triage and structured JUnit case append helper.
POSIX & ShellCheck hardening (see below).
utils/functestlib.sh
ensure_rootfs_min_size moved here so other suites can reuse it.
ensure_network_online (if available in your tree) is picked up by video fetch flow.