mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-18 14:40:56 +00:00
Add VAAPI driver path fallbacks for AppImage
This commit is contained in:
@@ -138,10 +138,12 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
|
|
||||||
int major, minor;
|
int major, minor;
|
||||||
VAStatus status;
|
VAStatus status;
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
status = vaInitialize(vaDeviceContext->display, &major, &minor);
|
status = vaInitialize(vaDeviceContext->display, &major, &minor);
|
||||||
if (status != VA_STATUS_SUCCESS && qEnvironmentVariableIsEmpty("LIBVA_DRIVER_NAME")) {
|
if (status != VA_STATUS_SUCCESS && qEnvironmentVariableIsEmpty("LIBVA_DRIVER_NAME")) {
|
||||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Default VAAPI driver failed - trying fallback drivers");
|
"Trying fallback VAAPI driver names");
|
||||||
if (status != VA_STATUS_SUCCESS) {
|
if (status != VA_STATUS_SUCCESS) {
|
||||||
// The iHD driver supports newer hardware like Ice Lake and Comet Lake.
|
// The iHD driver supports newer hardware like Ice Lake and Comet Lake.
|
||||||
// It should be picked by default on those platforms, but that doesn't
|
// It should be picked by default on those platforms, but that doesn't
|
||||||
@@ -157,6 +159,36 @@ VAAPIRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
status = vaInitialize(vaDeviceContext->display, &major, &minor);
|
status = vaInitialize(vaDeviceContext->display, &major, &minor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status == VA_STATUS_SUCCESS) {
|
||||||
|
// Success!
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qEnvironmentVariableIsEmpty("LIBVA_DRIVERS_PATH")) {
|
||||||
|
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
|
"Trying fallback VAAPI driver paths");
|
||||||
|
|
||||||
|
qputenv("LIBVA_DRIVERS_PATH",
|
||||||
|
#if Q_PROCESSOR_WORDSIZE == 8
|
||||||
|
"/usr/lib64/dri:" // Fedora x86_64
|
||||||
|
"/usr/lib64/va/drivers:" // Gentoo x86_64
|
||||||
|
#endif
|
||||||
|
"/usr/lib/dri:" // Arch i386 & x86_64, Fedora i386
|
||||||
|
"/usr/lib/va/drivers:" // Gentoo i386
|
||||||
|
#if defined(Q_PROCESSOR_X86_64)
|
||||||
|
"/usr/lib/x86_64-linux-gnu/dri:" // Ubuntu/Debian x86_64
|
||||||
|
#elif defined(Q_PROCESSOR_X86_32)
|
||||||
|
"/usr/lib/i386-linux-gnu/dri:" // Ubuntu/Debian i386
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Give up
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (status != VA_STATUS_SUCCESS) {
|
if (status != VA_STATUS_SUCCESS) {
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
|
||||||
"Failed to initialize VAAPI: %d",
|
"Failed to initialize VAAPI: %d",
|
||||||
|
|||||||
Reference in New Issue
Block a user