Repository navigation
media: apple: avd: VP9: one segmentation map per stream, shared by the banks - #2195
m0d16l14n1 wants to merge 1 commit into
Conversation
|
Same bug and same fix on a J813 (MacBook Air 13" M5). The AVD runs the open-queue transport here ( Test streams, made with libvpx-vp9 from
"Without" is my kernel on #2135's merged head 🤖 Generated with Claude Code |
|
Blockers: 1.
The fix itself is correct. HW row: covered on J815 and J813. Add a regression line from one of those boots: 0 AVC, 0 failed units, 0 new kernel errors. Assisted-by: LLM (Claude:Opus 5.5) |
…e banks The segmentation map is state that runs from frame to frame: a frame with temporal map prediction, or one that keeps the map without updating it, reads the map the frame before it left. With the queued transport (two banks, alternating) each bank had its own seg buffer, so a frame read the map of the frame before last. Every stream with segmentation then decoded wrong from its first non-key frame on. Keep one seg buffer per stream and point both banks at it. Tested on J815 (MacBook Air 15" M5), frame-by-frame MD5 against libavcodec, full decode and a seek into the stream: - before: libvpx aq-mode 2 (complexity) and 3 (cyclic refresh) at 720p and 1080p, and a 360p screen-content clip, wrong from frame 1-3; - after: all of them bit-exact, with the rest of a 67-stream H.264, HEVC, VP9 and AV1 set (59 of 59 PASS; the other 8 are 10-bit and interlaced streams the driver does not expose). The single-bank transport also decoded them right, which pointed at the bank swap. Signed-off-by: Nick <nekreshen@yandex.ru>
a47cddb to
a22f3eb
Compare
|
@RyanTheTide fixed: the commit is re-made with one On #2136: after this PR, its CPU memset in The regression line (0 AVC, 0 failed units, 0 new kernel errors) comes with the next J815 boot. Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-review of a22f3eb: No blockers. From the last review:
Nothing else changed since the last review, and the fix stands as reviewed there. HW row: the regression line from the J815 (or J813) boot on this commit: 0 AVC, 0 failed units, 0 new kernel errors, alongside the existing aq-mode 2/3 MD5 rows. Assisted-by: LLM (Claude:Opus 5.5) |
The VP9 segmentation map carries over from frame to frame: a frame with temporal map prediction, or one that keeps the map without updating it, reads the map the frame before it left. With the queued transport the two banks alternate, and each had its own seg buffer, so a frame read the map of the frame before last. Every stream with segmentation decoded wrong from its first non-key frame.
Change: one seg buffer per stream, used by both banks.
Tested on J815 (MacBook Air 15" M5), with frame-by-frame MD5 against libavcodec, full decode plus a seek:
checkpatch --strictis clean, and the change builds withW=1onintegration/aurorae95ff7b (this head,a22f3eb7: rebased, with oneSigned-off-byand no co-author trailer).With #2136 (sithglan, open): #2136 clears the bank's seg buffer from the CPU on a frame size change (
avd_vp9_run_preamble()). After this PR, that buffer is the stream's sharedvp9_ctx->seg, so the clear could hit a map the other bank's frame is still using on the queued transport. Whichever lands second should not memset the shared map while a frame is in flight. Either it waits until the queue is idle, or it setsVP9_SEG_RESETon the first frame after the size change and lets the firmware reset the map. If #2136 lands first, I'll rebase this onto it and make that change here. Which of the two the firmware honours needs a resolution-change vector on hardware.Part of the J815 bring-up; board results are summarised in #135.
Assisted-by: LLM (Claude:Opus 5.5)