Draft: virgl: add support for hardware video acceleration

Closed Feng Jiang requested to merge flynnjiang/virglrenderer:0.9.1-va into master

This function is implemented based on libva and currently supports H.264 and H.265 decoding, and will gradually support encoding and other profiles in the future.

I played the following files using MPV player(--hwdec=auto/no):

File Desc.
bbb_sunflower_1080p_60fps_normal.mp4 H.264+AC3+MP3, 1920x1080, 60fps, 339MB
bbb_sunflower_2160p_60fps_normal.mp4 H.264+AC3+MP3, 3840x2160, 60fps, 642MB
caminandes_llamigos_1080p_hevc.mp4 H.265+AAC, 1920x1080, 24fps, 27MB

Here are the test results:

On x86_64 (Intel i5-9500 + AMD Radeon RX550), CPU usage:

software decoding hardware decoding
H.264/1080p@60fps 65.0% 17.3%
H.264/4K@60fps 108.0% 17.6%
H.265/1080p@24fps 42.6% 9.5%

On aarch64 (Kunpeng-920 + AMD Radeon RX550)), CPU usage:

software decoding hardware decoding
H.264/1080p@60fps 76.0% 6.7%
H.264/4K@60fps 321.0% 8.4%
H.265/1080p@24fps 63.7% 4.1%

Signed-off-by: Feng Jiang jiangfeng@kylinos.cn

Edited by Feng Jiang

Merge request reports