Mesa (staging/22.1): Revert "wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes"

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 23 18:04:57 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 1c5552a3a725b6ec69ebbf4470fa972f597aba82
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1c5552a3a725b6ec69ebbf4470fa972f597aba82

Author: Renato Pereyra <renatopereyra at google.com>
Date:   Thu Jun  9 12:55:39 2022 -0700

Revert "wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes"

This reverts commit 44a20baeb8bb51c7ab99e30fd7f4bb19a0b555b6.

Signed-off-by: Renato Pereyra <renatopereyra at chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei at chromium.org>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17118>

---

 src/vulkan/wsi/wsi_common_x11.c | 34 ++++++++--------------------------
 1 file changed, 8 insertions(+), 26 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 6ab16b4e5e5..96e0be3d62a 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1493,9 +1493,6 @@ x11_manage_fifo_queues(void *state)
          goto fail;
 
       if (chain->has_acquire_queue) {
-        xcb_generic_event_t *event = NULL;
-        xcb_connection_t *conn = chain->conn;
-
          /* Assume this isn't a swapchain where we force 5 images, because those
           * don't end up with an acquire queue at the moment.
           */
@@ -1527,34 +1524,19 @@ x11_manage_fifo_queues(void *state)
                  * VUID-vkAcquireNextImageKHR-swapchain-01802 */
                 x11_driver_owned_images(chain) < forward_progress_guaranteed_acquired_images) {
 
-            event = xcb_poll_for_special_event(conn, chain->special_event);
-            if (event) {
-               result = x11_handle_dri3_present_event(chain, (void *)event);
-               /* Ensure that VK_SUBOPTIMAL_KHR is reported to the application */
-               result = x11_swapchain_result(chain, result);
-               free(event);
-               if (result < 0)
-                  goto fail;
-
-               continue;
-            }
-
-            if (chain->status < 0 || xcb_connection_has_error(conn)) {
+            xcb_generic_event_t *event =
+               xcb_wait_for_special_event(chain->conn, chain->special_event);
+            if (!event) {
                result = VK_ERROR_SURFACE_LOST_KHR;
                goto fail;
             }
 
-            /* poke the window to see if it got destroyed from under us, and
-             * to flush any pending special events out of the server
-             */
-            xcb_get_geometry_reply_t *geometry =
-               xcb_get_geometry_reply(conn,
-                                      xcb_get_geometry(conn, chain->window),
-                                      NULL);
-            if (geometry == NULL) {
-               result = VK_ERROR_SURFACE_LOST_KHR;
+            result = x11_handle_dri3_present_event(chain, (void *)event);
+            /* Ensure that VK_SUBOPTIMAL_KHR is reported to the application */
+            result = x11_swapchain_result(chain, result);
+            free(event);
+            if (result < 0)
                goto fail;
-            }
          }
       }
    }



More information about the mesa-commit mailing list