Mesa (staging/21.0): wsi/x11: Wait for fences with IMMEDIATE on Xwayland
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 8 17:07:40 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: dde2e324effef280fefcf5b65d6c65131d615fdd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dde2e324effef280fefcf5b65d6c65131d615fdd
Author: Michel Dänzer <mdaenzer at redhat.com>
Date: Tue Apr 6 12:15:45 2021 +0200
wsi/x11: Wait for fences with IMMEDIATE on Xwayland
The commit below was already meant to do this, but accidentally missed
this part.
Fixes stutter when the frame-rate drops below the refresh rate.
Fixes: e8f50bd60087 "wsi/x11: Treat IMMEDIATE present mode the same as
MAILBOX for Xwayland"
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10026>
(cherry picked from commit 8ec530d9828e01ac12918c7abb9b4e4aaf9a38cf)
---
.pick_status.json | 2 +-
src/vulkan/wsi/wsi_common_x11.c | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index f7d3ab67770..cc3aa948500 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -148,7 +148,7 @@
"description": "wsi/x11: Wait for fences with IMMEDIATE on Xwayland",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "e8f50bd60087805aa89144ecdd6e5a9b4368b532"
},
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 165b366e2df..bf53dbc055f 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -1202,6 +1202,8 @@ static void *
x11_manage_fifo_queues(void *state)
{
struct x11_swapchain *chain = state;
+ struct wsi_x11_connection *wsi_conn =
+ wsi_x11_get_connection((struct wsi_device*)chain->base.wsi, chain->conn);
VkResult result = VK_SUCCESS;
assert(chain->has_present_queue);
@@ -1225,7 +1227,9 @@ x11_manage_fifo_queues(void *state)
return NULL;
}
- if (chain->base.present_mode == VK_PRESENT_MODE_MAILBOX_KHR) {
+ if (chain->base.present_mode == VK_PRESENT_MODE_MAILBOX_KHR ||
+ (chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR &&
+ wsi_conn->is_xwayland)) {
result = chain->base.wsi->WaitForFences(chain->base.device, 1,
&chain->base.fences[image_index],
true, UINT64_MAX);
More information about the mesa-commit
mailing list