From c5c4360da7d776a3722698a01e9b4479fdb656e9 Mon Sep 17 00:00:00 2001 From: Alessandro Astone Date: Thu, 28 Dec 2023 20:11:07 +0100 Subject: [PATCH] Disable zink fallback in EGL In mesa 23.3.x zink broke on nvidia, crashing in eglCreateContext. In the same release, zink was added as a fallback between the hardware drivers and swrast. Any application that was previously falling back to swrast now instead crashes, when using the nvidia vulkan driver. How exactly do you reach zink or previously swrast when using nvidia you may ask? One common path may be EGL applications using EGL_EXT_platform_xcb. The nvidia driver does not support it, thus GLVND tries the next driver which is mesa, mesa doesn't find any suitable hardware driver and thus falls back to zink or swrast. Until zink is stable again on nvidia, we should disable the zink fallback to prevent applications crashing instead of falling back to swrast. There should be no need to also disable the GLX fallback to zink as i'm not aware of a call path that would lead to using mesa when the nvidia drivers are installed. RHBZ 2255599 RHBZ 2255768 MESA 10340 MESA 10341 --- disable-zink-egl-fallback.patch | 26 ++++++++++++++++++++++++++ mesa.spec | 1 + 2 files changed, 27 insertions(+) create mode 100644 disable-zink-egl-fallback.patch diff --git a/disable-zink-egl-fallback.patch b/disable-zink-egl-fallback.patch new file mode 100644 index 0000000..c036ace --- /dev/null +++ b/disable-zink-egl-fallback.patch @@ -0,0 +1,26 @@ +diff --git a/src/egl/main/eglapi.c b/src/egl/main/eglapi.c +index d50be23e871..e3697622635 100644 +--- a/src/egl/main/eglapi.c ++++ b/src/egl/main/eglapi.c +@@ -695,17 +695,21 @@ eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor) + if (disp->Options.ForceSoftware) + RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); + else { ++#if 0 + bool success = false; + if (!disp->Options.Zink && !getenv("GALLIUM_DRIVER")) { + disp->Options.Zink = EGL_TRUE; + success = _eglDriver.Initialize(disp); + } + if (!success) { ++#endif + disp->Options.Zink = EGL_FALSE; + disp->Options.ForceSoftware = EGL_TRUE; + if (!_eglDriver.Initialize(disp)) + RETURN_EGL_ERROR(disp, EGL_NOT_INITIALIZED, EGL_FALSE); ++#if 0 + } ++#endif + } + } + diff --git a/mesa.spec b/mesa.spec index f50fd34..3cedbdc 100644 --- a/mesa.spec +++ b/mesa.spec @@ -76,6 +76,7 @@ Source1: Mesa-MLAA-License-Clarification-Email.txt Patch10: gnome-shell-glthread-disable.patch Patch11: 0001-intel-compiler-reemit-boolean-resolve-for-inverted-i.patch Patch12: 0001-intel-compiler-fix-release-build-unused-variable.patch +Patch13: disable-zink-egl-fallback.patch BuildRequires: meson >= 1.2.0 BuildRequires: gcc