Mesa (master): wsi/x11: Hook up VK_PRESENT_MODE_FIFO_RELAXED_KHR

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 10 18:33:58 UTC 2020


Module: Mesa
Branch: master
Commit: 77d256279337ae873a85974ce5f60d414f8f45c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=77d256279337ae873a85974ce5f60d414f8f45c9

Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Sep  9 17:03:11 2020 -0400

wsi/x11: Hook up VK_PRESENT_MODE_FIFO_RELAXED_KHR

This is just PresentOptionAsync.

Fixes: mesa/mesa#3483
Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6673>

---

 docs/relnotes/new_features.txt  | 1 +
 src/vulkan/wsi/wsi_common.c     | 2 ++
 src/vulkan/wsi/wsi_common_x11.c | 4 +++-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt
index b9fbf62bece..705d69cc9d3 100644
--- a/docs/relnotes/new_features.txt
+++ b/docs/relnotes/new_features.txt
@@ -2,3 +2,4 @@ GL 4.5 on llvmpipe
 GL_NV_copy_depth_to_color for NIR
 GL_NV_half_float
 EGL_KHR_swap_buffers_with_damage on X11 (DRI3)
+VK_PRESENT_MODE_FIFO_RELAXED on X11
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 671690df9cc..a80d7ba0bb7 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -129,6 +129,8 @@ wsi_device_init(struct wsi_device *wsi,
    if (present_mode) {
       if (!strcmp(present_mode, "fifo")) {
          wsi->override_present_mode = VK_PRESENT_MODE_FIFO_KHR;
+      } else if (!strcmp(present_mode, "relaxed")) {
+          wsi->override_present_mode = VK_PRESENT_MODE_FIFO_RELAXED_KHR;
       } else if (!strcmp(present_mode, "mailbox")) {
          wsi->override_present_mode = VK_PRESENT_MODE_MAILBOX_KHR;
       } else if (!strcmp(present_mode, "immediate")) {
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 961704f2057..9d9f29f2b76 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -270,6 +270,7 @@ static const VkPresentModeKHR present_modes[] = {
    VK_PRESENT_MODE_IMMEDIATE_KHR,
    VK_PRESENT_MODE_MAILBOX_KHR,
    VK_PRESENT_MODE_FIFO_KHR,
+   VK_PRESENT_MODE_FIFO_RELAXED_KHR,
 };
 
 static xcb_screen_t *
@@ -1008,7 +1009,8 @@ x11_present_to_x11_dri3(struct x11_swapchain *chain, uint32_t image_index,
    int64_t divisor = 0;
    int64_t remainder = 0;
 
-   if (chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR)
+   if (chain->base.present_mode == VK_PRESENT_MODE_IMMEDIATE_KHR ||
+       chain->base.present_mode == VK_PRESENT_MODE_FIFO_RELAXED_KHR)
       options |= XCB_PRESENT_OPTION_ASYNC;
 
 #ifdef HAVE_DRI3_MODIFIERS



More information about the mesa-commit mailing list