Skip to content

media: apple: avd: H.264 slice hold and intra-header fixes on the rewrite - #785

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
avd/conformance-fixes-2
Nov 1, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
avd/conformance-fixes-2

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Two H.264 fixes for the AVD driver, ported onto the merged rewrite so they work on both the legacy transport and the queued open-firmware transport.

Problem: Fluster JVT-AVC_V1 on the M2 passes 62 of the 83 runnable vectors. Multi-slice streams that negotiate HOLD_CAPTURE_BUF lose slices, and reference-free non-IDR I pictures get an inter header.

Fix:

  • media: apple: avd: fix slice hold negotiation and validate unsupported syntax. OUTPUT advertises HOLD before vb2_queue_init so CREATE_BUFS probing sees it, and S_FMT replaces per-format features. Intermediate slices complete only OUTPUT and keep CAPTURE and their unsubmitted bank. The final slice still goes through v4l2_m2m_job_finish_detach, and tagged PP retirement uses the bank saved with CAPTURE. SPS/PPS/slice controls are checked before instruction generation, and SP/SI, FMO, unsupported bit depths and arbitrary slice order are rejected.
  • media: apple: avd: use an intra header for reference-free non-IDR I pictures. An empty-DPB non-IDR I picture now produces the same intra-only program as an IDR picture.

Legacy dense programs are byte-identical. HEVC gains SPS validation only. VP9 is unchanged.

How tested:

  • run-host-tests 158/158 on this branch. Built W=1 with no warnings against 7.3.0-aurora-fleet14e (aurora-wip 757fc07).
  • M2 (T8112) on fleet14e with avd-fw 66c3911b and the open-queue transport. Fluster per-vector results compared with stock fleet14e on the same boot:
suite stock 757fc07 this branch
JVT-AVC_V1 62 pass, 21 fail 68 pass, 15 fail
JCT-VC-HEVC_V1 140 / 147 140 / 147
VP9-TEST-VECTORS 216 / 305 216 / 305

Newly passing: CABACI3_Sony_B, CABAST3_Sony_E, CABASTBR3_Sony_B, MR3_TANDBERG_B, MR4_TANDBERG_C, MR5_TANDBERG_C. Nothing newly fails, and there were no timeouts.

🤖 Generated with Claude Code

…d syntax

Port the conformance fixes onto the merged frame-queue rewrite. Advertise
HOLD_CAPTURE_BUF before CREATE_BUFS probing and replace format features on
S_FMT. Intermediate slices retain CAPTURE through the core HOLD API; the
last slice still detaches both buffers without completing DMA ownership.

Reject SP/SI, FMO, unsupported SPS controls and arbitrary slice order before
building instructions. Check order before selecting a bank can discard a
held picture. Drop rejected unsubmitted slices and the job table without
releasing a submitted bank belonging to another picture.

Map sparse DPB indexes to packed reference-header slots and count every
VALID header, including inactive entries. Dense legacy programs retain
their bytes; sparse reference operands and inactive-entry counts change
intentionally.

Fold the old host/queue cases into the existing program and dispatch tests,
including exact baseline programs, every DPB occupancy map, CREATE_BUFS
probing, held/final/error dispatch and production two-bank preparation.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
…ictures

Port the reference-free intra-header fix onto the banked H.264 builder.
Frame-number gaps can evict every real reference, leaving a non-IDR I
picture with an empty hardware DPB. Its inter header cannot encode the
empty table because the reference count lives in the first entry.

Use the existing IDR intra-only header for an I picture with no VALID
references. This sets INTRA, clears NOT_IDR and omits the empty reference
preamble. Pictures with references retain the existing header on both
transports.

Extend the rewrite's program test with 32 exact complete-program checks
against the pinned legacy IDR path, preserving before/after evidence.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit a8cee09 into aurora-wip Nov 1, 2026
notmysegv pushed a commit to notmysegv/linux that referenced this pull request Nov 4, 2026
…tion/aurora

Bring integration/aurora up to aurora-wip b359258, the source of
7.3.0-aurora-fleet14f, promoted on the M1 Pro, M2, Neo and J616s on
2026-11-01 and 11-02. The range also covers the fleet14c, fleet14d and
fleet14e sources (f41ac3d, 4759557, 757fc07), each booted on
hardware. It adds aurora-silicon#773, aurora-silicon#776, aurora-silicon#777, aurora-silicon#737, aurora-silicon#713, aurora-silicon#785, aurora-silicon#786, aurora-silicon#788,
aurora-silicon#789 and aurora-silicon#787. No conflicts.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide deleted the avd/conformance-fixes-2 branch November 7, 2026 12:06
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