vulkan/wsi/x11: Explicitly discard errors from xcb_present_pixmap.

Errors produced by the call to `xcb_present_pixmap` should be explicitly
discarded to ensure they don't leak into the application event loop.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>

Fixes: 2b885b23 ("vk/wsi/x11: stop roundtripping on presentation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28402>
(cherry picked from commit 82ed8aadea)
This commit is contained in:
David Stern 2024-03-26 12:27:44 -04:00 committed by Eric Engestrom
parent 3a181751ee
commit f8bfdc4bbb
2 changed files with 18 additions and 16 deletions

View file

@ -2524,7 +2524,7 @@
"description": "vulkan/wsi/x11: Explicitly discard errors from xcb_present_pixmap.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "2b885b233f7a6300ae88732c179888c02788493d",
"notes": null

View file

@ -1625,21 +1625,23 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
image->present_queued = true;
image->serial = (uint32_t) chain->send_sbc;
xcb_present_pixmap(chain->conn,
chain->window,
image->pixmap,
image->serial,
0, /* valid */
image->update_area, /* update */
0, /* x_off */
0, /* y_off */
XCB_NONE, /* target_crtc */
XCB_NONE,
image->sync_fence,
options,
target_msc,
divisor,
remainder, 0, NULL);
xcb_void_cookie_t cookie =
xcb_present_pixmap(chain->conn,
chain->window,
image->pixmap,
image->serial,
0, /* valid */
image->update_area, /* update */
0, /* x_off */
0, /* y_off */
XCB_NONE, /* target_crtc */
XCB_NONE,
image->sync_fence,
options,
target_msc,
divisor,
remainder, 0, NULL);
xcb_discard_reply(chain->conn, cookie.sequence);
xcb_flush(chain->conn);
return x11_swapchain_result(chain, VK_SUCCESS);
}