From 55e3e16860917f1ef09362575a7c6f953ffbfd89 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 26 Apr 2020 20:18:46 -0700 Subject: [PATCH] Try radeonsi if other VAAPI drivers fail --- app/streaming/video/ffmpeg-renderers/vaapi.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/streaming/video/ffmpeg-renderers/vaapi.cpp b/app/streaming/video/ffmpeg-renderers/vaapi.cpp index 0a865c0a..756a7b12 100644 --- a/app/streaming/video/ffmpeg-renderers/vaapi.cpp +++ b/app/streaming/video/ffmpeg-renderers/vaapi.cpp @@ -230,6 +230,18 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params) } } + if (status != VA_STATUS_SUCCESS) { + // The RadeonSI driver is compatible with XWayland but can't be detected by libva + // so try it too if all else fails. + qputenv("LIBVA_DRIVER_NAME", "radeonsi"); + status = vaInitialize(vaDeviceContext->display, &major, &minor); + if (status == VA_STATUS_SUCCESS && !validateDriver(vaDeviceContext->display)) { + vaTerminate(vaDeviceContext->display); + vaDeviceContext->display = openDisplay(params->window); + status = VA_STATUS_ERROR_UNSUPPORTED_PROFILE; + } + } + if (status != VA_STATUS_SUCCESS) { // Unset LIBVA_DRIVER_NAME if none of the drivers we tried worked. This ensures // we will get a fresh start using the default driver selection behavior after