Commits
Commits on
00c1b3ff2d80d84fef71bb6208110dedbbd95fc4Filtered to crates/ec-va/tests/gpu.rsClear filter2026-08-20
test(ec-va,ec-hw): verify VPP filter probe, struct layout, and P010 zero-copy encode against a real 4K HEVC HDR fileAhmet Kaan Gümüş · cffd9af
test(ec-va,ec-hw): verify VPP filter probe, struct layout, and P010 zero-copy encode against a real 4K HEVC HDR file
ec-va/tests/gpu.rs: vpp_filters_probe (vaQueryVideoProcFilters on the real
display — radeonsi advertises only VAProcFilterDeinterlacing (2), no
HighDynamicRangeToneMapping) and vpp_converts_p010_to_nv12 (Vpp::convert
end to end).
ec-va/src/sys.rs: a const size_of/offset_of assert block for
VAProcPipelineParameterBuffer against va_vpp.h:886 (224 bytes on this
target, field offsets checked through va_reserved) plus
VAProcColorProperties — the layout was already correct, this just pins it.
ec-hw/tests/gpu.rs, against a real HEVC Main10 P010 4K HDR mkv:
- encode_frame_accepts_p010_via_vpp: encode_frame (zero-copy, P010 via VPP)
vs to_i420()+encode (CPU path), decoded back and compared. H.264: worst Y
and UV PSNR both infinite (byte-identical after decode). H.265 is refused
by encode_frame's own documented contract ("frame's coded size does not
match this encoder's ... the VPP conversion pass does not resize") because
this file's SPS pic_height_in_luma_samples (2160) is a multiple of the
H.264 encode block size (16) but not the HEVC one (32) — an existing,
intentional design choice, not a defect this round touched.
- p010_zero_copy_encode_is_realtime: median 6.14 ms/frame for
decode+encode_frame (H.264, the target that isn't refused on this file)
vs 22.55 ms/frame for decode+to_i420+encode — zero-copy is ~3.7x faster
and well inside the 20 ms budget.
cargo test -p ec-va -- --test-threads=1: 13 passed (+2 doctests, +4
compile-fail doctests).
cargo test -p ec-hw --release --test gpu -- --test-threads=1: 27 passed, 0
failed (most non-P010 tests skip: no generated bitstream fixtures on this
checkout).2026-08-14
feat(va): hand-written libva FFI with RAII handles and picture typestateAhmet Kaan Gümüş · 0eac457
feat(va): hand-written libva FFI with RAII handles and picture typestate Minimal VA-API bindings for the hardware-video lane, no bindgen and no build-time tooling. `sys` transcribes the libva 1.23 subset the family needs; everything above it is safe. - ABI: struct layouts asserted at compile time against numbers printed by abi-probe.c compiled against the system headers; `vaInitialize` version guard refuses libva older than 1.23 at runtime. Together these close the header-drift trap that broke the incumbent bindings at 1.23. - Soundness: C enums stay `i32` in `sys`; the safe `Profile`/`Entrypoint` mirrors carry an `Unknown(i32)` arm, so a value from a newer driver can never be transmuted into an invalid Rust enum. - RAII: Display/Config/Surface/Context/Buffer each destroy exactly what they created, and children hold an `Arc` of their parent, so libva's destruction order is a borrow-checker fact. Image and buffer mappings unmap on drop; PRIME exports own and close their descriptors. - Picture typestate: New -> Rendering -> Ended -> Synced, transitions consume the picture; out-of-order submission does not compile. - Caps probe reports per-pair RT formats plus driver-legal surface sizes (radeonsi refuses below 64x64) instead of assuming them. 55 unsafe blocks, every one SAFETY-commented. Tests run against the real GPU: 11 live tests (caps table vs vainfo, 100 pool create/destroy cycles under an RSS bound, PRIME fd ownership, derive/map/unmap round trip) plus 4 compile_fail doctests pinning the typestate on E0599.