driconf: add override for Xwayland
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 22 Mar 2022 19:32:33 +0000 (15:32 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 7 Apr 2022 00:17:40 +0000 (00:17 +0000)
zink needs this to avoid deadlocking on startup

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14541>

src/gallium/drivers/zink/driinfo_zink.h
src/gallium/drivers/zink/zink_instance.py
src/gallium/drivers/zink/zink_screen.c
src/util/00-mesa-defaults.conf

index e1cf6d7d559619e2fb0a311234432f77cdb3ea6e..9687285060c9b50ee75e13603f06719fe885ebeb 100644 (file)
@@ -3,6 +3,8 @@
 DRI_CONF_SECTION_DEBUG
    DRI_CONF_DUAL_COLOR_BLEND_BY_LOCATION(false)
    DRI_CONF_OPT_B(radeonsi_inline_uniforms, false, "Optimize shaders by replacing uniforms with literals")
+   DRI_CONF_OPT_B(disable_xcb_surface, false, \
+                  "disable ext")
 DRI_CONF_SECTION_END
 
 DRI_CONF_SECTION_PERFORMANCE
index 20002c4727beeda03cfcac5f58e58070088f7c58..632cf3c4bfcc42d9774ef235e2034ee24719b116 100644 (file)
@@ -43,7 +43,8 @@ EXTENSIONS = [
     Extension("VK_KHR_surface"),
     Extension("VK_EXT_headless_surface"),
     Extension("VK_KHR_wayland_surface"),
-    Extension("VK_KHR_xcb_surface"),
+    Extension("VK_KHR_xcb_surface",
+              conditions=["!instance_info->disable_xcb_surface"]),
 ]
 
 # constructor: Layer(name, conditions=[])
@@ -73,10 +74,12 @@ header_code = """
 #include "MoltenVK/vk_mvk_moltenvk.h"
 #endif
 
+struct pipe_screen;
 struct zink_screen;
 
 struct zink_instance_info {
    uint32_t loader_version;
+   bool disable_xcb_surface;
 
 %for ext in extensions:
    bool have_${ext.name_with_vendor()};
index eb8df6b66a681e2b23e04cc5c00c53dc886794c2..a5e2f1010d251c901cf1efcbc4a2fdca95e28760 100644 (file)
@@ -2113,6 +2113,7 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
                           NULL, NULL, NULL, 0, NULL, 0);
       screen->driconf.dual_color_blend_by_location = driQueryOptionb(config->options, "dual_color_blend_by_location");
       //screen->driconf.inline_uniforms = driQueryOptionb(config->options, "radeonsi_inline_uniforms");
+      screen->instance_info.disable_xcb_surface = driQueryOptionb(config->options, "disable_xcb_surface");
    }
 #endif
    screen->instance = zink_create_instance(&screen->instance_info);
index 1d44381b697ed355d3857a1d70e45cb51f9d4e10..59de17e2110b7685bce7fb48c34f77f30925887b 100644 (file)
@@ -70,6 +70,11 @@ TODO: document the other workarounds.
             <option name="disable_arb_gpu_shader5" value="true" />
         </application>
 
+        <!-- using vulkan wsi for xservers causes deadlocks -->
+        <application name="Xwayland" executable="Xwayland">
+            <option name="disable_xcb_surface" value="true" />
+        </application>
+
         <application name="Unigine Heaven (32-bit)" executable="heaven_x86">
             <option name="allow_glsl_extension_directive_midshader" value="true" />
             <!-- remove dual_color_blend_by_location if 4.1 ever comes out -->