backends/drm: ignore modifier env var if modifiers are not supported

Otherwise we might crash
This commit is contained in:
Xaver Hugl 2022-02-08 20:09:08 +01:00
parent 11175cb05e
commit d0c12ac54d

View file

@ -162,7 +162,7 @@ bool EglGbmBackend::resetOutput(Output &output)
QSharedPointer<GbmSurface> gbmSurface; QSharedPointer<GbmSurface> gbmSurface;
bool modifiersEnvSet = false; bool modifiersEnvSet = false;
static bool modifiersEnv = qEnvironmentVariableIntValue("KWIN_DRM_USE_MODIFIERS", &modifiersEnvSet) != 0; static bool modifiersEnv = qEnvironmentVariableIntValue("KWIN_DRM_USE_MODIFIERS", &modifiersEnvSet) != 0;
static bool allowModifiers = (gpu()->isNVidia() && !modifiersEnvSet) || (modifiersEnvSet && modifiersEnv); static bool allowModifiers = gpu()->addFB2ModifiersSupported() && ((gpu()->isNVidia() && !modifiersEnvSet) || (modifiersEnvSet && modifiersEnv));
#if HAVE_GBM_BO_GET_FD_FOR_PLANE #if HAVE_GBM_BO_GET_FD_FOR_PLANE
if (!allowModifiers) { if (!allowModifiers) {
#else #else