Hello,
I tested the proposed 0006-ExportSurfaceHandle-allocate-bo.patch on
Ivy Bridge (Gen7), which was the generation still missing. It works
there too.
Test environment
----------------
- Lenovo G480, Intel Core i3-3110M, HD Graphics 4000
(Ivy Bridge GT2, Gen7)
- Ubuntu 26.04.1, kernel 7.0.0-44-generic, GNOME on Wayland
- i965-va-driver 2.4.1+dfsg1-2build1, libva 2.23.0, Mesa 26.0.8 (crocus)
- Google Chrome 158.0.8127.107 (ANGLE on OpenGL, Ozone/Wayland), started
with only --enable-features=AcceleratedVideoEncoder. No decode-related
flags are needed in this version: VA-API decode is on by default.
- YouTube served H.264 (the enhanced-h264ify extension blocks
VP8/VP9/AV1, which Gen7 cannot decode)
Build
-----
Ubuntu source package 2.4.1+dfsg1-2build1, the existing series
0001-0005, then the patch from this bug. It applied with --fuzz=0.
I installed the resulting i965_drv_video.so in a private directory and
loaded it with LIBVA_DRIVERS_PATH and LIBVA_DRIVER_NAME=i965, leaving
the system driver untouched. vainfo lists the same 16
profiles/entrypoints as the stock driver.
Minimal reproducer (outside Chromium)
-------------------------------------
vaCreateSurfaces(VA_RT_FORMAT_YUV420, 1280x720) followed immediately by
vaExportSurfaceHandle(DRM_PRIME_2, READ_ONLY | SEPARATE_LAYERS) and
again with COMPOSED_LAYERS:
- stock driver: VA_STATUS_ERROR_INVALID_SURFACE (6) for both; after
vaDeriveImage() (which allocates the bo) both succeed
- patched driver: success for both, also on the fresh surface
Chrome, stock driver
--------------------
- "vaExportSurfaceHandle failed, VA error: invalid VASurfaceID"
repeatedly in the GPU process log (10 times in about 10 minutes of
playback)
- The VA driver's DRM client in the GPU process held only 8 KiB while
a video played, so no decode surfaces existed.
- Decoding ran on the CPU, in the renderer's "Media" threads: about 95%
of one core at 1080p60. At 720p30 it was about 43%; that run also had
--disable-features=AcceleratedVideoDecodeLinuxZeroCopyGL, which makes
Chrome skip VA-API decode entirely, so it decoded in software there
too.
Chrome, patched driver (same Chrome flags)
------------------------------------------
- No vaExportSurfaceHandle errors
- The VA driver's DRM client grows to 47 MB (720p) / 75 MB (1080p)
while playing, so decode surfaces are allocated and used.
- The renderer's "Media" threads stay at 2-4% of one core.
- 720p30 H.264 Main (Big Buck Bunny): 0 dropped frames out of 618.
Whole Chrome process tree: 7.0 CPU-s per 15 s (about 10.4 CPU-s in
the software run above, same video and resolution).
- 1080p24 H.264 High (Sintel, 1920x818): 2 dropped frames out of 570,
6.5 CPU-s per 15 s for the whole process tree.
- Output checked visually: the picture is correct, with no corruption
or green/black frames.
The tiling choice (HAS_TILED_SURFACE, NV12) matches what Gen7 decode
allocates in avc_ensure_surface_bo(), so the bo allocated at export
time is the one the decoder later writes into, with no reallocation.
Together with the earlier reports for Sandy Bridge (Gen6) and Broadwell
(Gen8), the patch is now confirmed on Gen6, Gen7 and Gen8. It would be
great to have it in unstable.
I did this testing with help from Claude (an AI assistant).
Thanks,
Thiago Natanael