From bb9fe2ae8f6c59d4f964e3304f19c8c16bb3cea7 Mon Sep 17 00:00:00 2001 From: lukeyyyy Date: Wed, 22 Oct 2025 17:06:55 +0800 Subject: [PATCH] Xwayland: use default feedback if surface feedback is not ready Sometimes surface modifiers have not been obtained from compositor when client call xcb_dri3_get_supported_modifiers(), which causes num_window_modifiers as 0. It's better to return modifiers from default feedback in this case. This issue was observed when running vulkan cts (dEQP-VK.wsi.xlib.maintenance1.*) with RADV, which caused random failures with message: `vkd.acquireNextImageKHR(device, *swapchains[j], foreverNs, acquireSem.back(), VK_NULL_HANDLE, &imageIndex[j]): VK_SUBOPTIMAL_KHR at vktWsiMaintenance1Tests.cpp:954`. Since the num_window_modifiers could be 0 at the first query and non-zero later, RADV would assume the modifiers changed and return VK_SUBOPTIMAL_KHR. --- hw/xwayland/xwayland-dmabuf.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-dmabuf.c b/hw/xwayland/xwayland-dmabuf.c index 1676a82da..ef6b67239 100644 --- a/hw/xwayland/xwayland-dmabuf.c +++ b/hw/xwayland/xwayland-dmabuf.c @@ -370,10 +370,16 @@ xwl_glamor_get_drawable_modifiers_and_scanout(DrawablePtr drawable, main_dev = xwl_gbm_get_main_device(xwl_screen); + if (!xwl_window->feedback.feedback_done) { + /* Surface feedback is not known yet, use the default feedback instead */ + return xwl_dmabuf_get_modifiers_for_device(&xwl_screen->default_feedback, main_dev, + format, num_modifiers, modifiers, + supports_scanout); + } + return xwl_dmabuf_get_modifiers_for_device(&xwl_window->feedback, main_dev, format, num_modifiers, modifiers, supports_scanout); - } Bool