From 4e7e0d67e532fe04ac052af943b441c5fd9f98bc Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 17 Mar 2020 17:34:35 -0700 Subject: [PATCH] Add a workaround for Mesa Iris returning the wrong VA driver --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 9c4843c6..37fb1b41 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -139,6 +139,15 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) int major, minor; VAStatus status; status = vaInitialize(vaDeviceContext->display, &major, &minor); + if (status != VA_STATUS_SUCCESS && qEnvironmentVariableIsEmpty("LIBVA_DRIVER_NAME")) { + // The Iris driver in Mesa 20.0 returns a bogus VA driver (iris_drv_video.so) + // even though the correct driver is still i965. If we hit this path, we'll + // explicitly try i965 to handle this case. + vaSetDriverName(vaDeviceContext->display, const_cast("i965")); + SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, + "Attempting fallback to i965 VA driver"); + status = vaInitialize(vaDeviceContext->display, &major, &minor); + } if (status != VA_STATUS_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to initialize VAAPI: %d",