<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 25, 2016 at 8:13 PM, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
<br>
This just moves this up a level as x11 will need it to<br>
implement things properly.<br>
<br>
Signed-off-by: Dave Airlie <<a href="mailto:airlied@redhat.com">airlied@redhat.com</a>><br>
---<br>
 src/vulkan/wsi/wsi_common.h         | 1 +<br>
 src/vulkan/wsi/wsi_common_<wbr>wayland.c | 6 +++---<br>
 src/vulkan/wsi/wsi_common_x11.<wbr>c     | 1 +<br>
 3 files changed, 5 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h<br>
index ee67511..a1f5a40 100644<br>
--- a/src/vulkan/wsi/wsi_common.h<br>
+++ b/src/vulkan/wsi/wsi_common.h<br>
@@ -53,6 +53,7 @@ struct wsi_swapchain {<br>
    VkAllocationCallbacks alloc;<br>
    const struct wsi_image_fns *image_fns;<br>
    VkFence fences[3];<br>
+   VkPresentModeKHR present_mode;<br>
<br>
    VkResult (*destroy)(struct wsi_swapchain *swapchain,<br>
                        const VkAllocationCallbacks *pAllocator);<br>
diff --git a/src/vulkan/wsi/wsi_common_<wbr>wayland.c b/src/vulkan/wsi/wsi_common_<wbr>wayland.c<br>
index fc13bde..75af4cf 100644<br>
--- a/src/vulkan/wsi/wsi_common_<wbr>wayland.c<br>
+++ b/src/vulkan/wsi/wsi_common_<wbr>wayland.c<br>
@@ -559,7 +559,7 @@ wsi_wl_swapchain_queue_<wbr>present(struct wsi_swapchain *wsi_chain,<br>
 {<br>
    struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain;<br>
<br>
-   if (chain->present_mode == VK_PRESENT_MODE_FIFO_KHR) {<br>
+   if (chain->base.present_mode == VK_PRESENT_MODE_FIFO_KHR) {<br>
       while (!chain->fifo_ready) {<br>
          int ret = wl_display_dispatch_queue(<wbr>chain->display->display,<br>
                                              chain->queue);<br>
@@ -572,7 +572,7 @@ wsi_wl_swapchain_queue_<wbr>present(struct wsi_swapchain *wsi_chain,<br>
    wl_surface_attach(chain-><wbr>surface, chain->images[image_index].<wbr>buffer, 0, 0);<br>
    wl_surface_damage(chain-><wbr>surface, 0, 0, INT32_MAX, INT32_MAX);<br>
<br>
-   if (chain->present_mode == VK_PRESENT_MODE_FIFO_KHR) {<br>
+   if (chain->base.present_mode == VK_PRESENT_MODE_FIFO_KHR) {<br>
       struct wl_callback *frame = wl_surface_frame(chain-><wbr>surface);<br>
       wl_proxy_set_queue((struct wl_proxy *)frame, chain->queue);<br>
       wl_callback_add_listener(<wbr>frame, &frame_listener, chain);<br>
@@ -708,12 +708,12 @@ wsi_wl_surface_create_<wbr>swapchain(VkIcdSurfaceBase *icd_surface,<br>
    chain->base.acquire_next_image = wsi_wl_swapchain_acquire_next_<wbr>image;<br>
    chain->base.queue_present = wsi_wl_swapchain_queue_<wbr>present;<br>
    chain->base.image_fns = image_fns;<br>
+   chain->base.present_mode = pCreateInfo->presentMode;<br>
    chain->surface = surface->surface;<br>
    chain->extent = pCreateInfo->imageExtent;<br>
    chain->vk_format = pCreateInfo->imageFormat;<br>
    chain->drm_format = wl_drm_format_for_vk_format(<wbr>chain->vk_format, false);<br>
<br>
-   chain->present_mode = pCreateInfo->presentMode;<br>
    chain->fifo_ready = true;<br>
<br>
    chain->image_count = num_images;<br>
diff --git a/src/vulkan/wsi/wsi_common_<wbr>x11.c b/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
index 76c147e..bae1d18 100644<br>
--- a/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
+++ b/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
@@ -815,6 +815,7 @@ x11_surface_create_swapchain(<wbr>VkIcdSurfaceBase *icd_surface,<br>
    chain->base.acquire_next_image = x11_acquire_next_image;<br>
    chain->base.queue_present = x11_queue_present;<br>
    chain->base.image_fns = image_fns;<br>
+   chain->base.present_mode = pCreateInfo->presentMode;<br>
    chain->conn = x11_surface_get_connection(<wbr>icd_surface);<br>
    chain->window = x11_surface_get_window(icd_<wbr>surface);<br>
    chain->extent = pCreateInfo->imageExtent;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>