From d0c12ac54de6799606d552a16f8d70780110d083 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 8 Feb 2022 20:09:08 +0100 Subject: [PATCH] backends/drm: ignore modifier env var if modifiers are not supported Otherwise we might crash --- src/backends/drm/egl_gbm_backend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/drm/egl_gbm_backend.cpp b/src/backends/drm/egl_gbm_backend.cpp index 36a6f0a5c1..50b0fde98c 100644 --- a/src/backends/drm/egl_gbm_backend.cpp +++ b/src/backends/drm/egl_gbm_backend.cpp @@ -162,7 +162,7 @@ bool EglGbmBackend::resetOutput(Output &output) QSharedPointer gbmSurface; bool modifiersEnvSet = false; 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 (!allowModifiers) { #else