turnip: fix display wsi fence timing out
authorJonathan Marek <jonathan@marek.ca>
Sun, 24 Nov 2019 14:42:43 +0000 (09:42 -0500)
committerJonathan Marek <jonathan@marek.ca>
Mon, 2 Dec 2019 19:29:47 +0000 (14:29 -0500)
Fixes: df9f2adf ("turnip: add display wsi")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/freedreno/vulkan/tu_fence.c

index 68c1f31c0b820c3dfb548118ed64e6a17cf6aef3..9e4a92370f88404f522423b00179199be00a3aa9 100644 (file)
@@ -211,6 +211,10 @@ tu_fence_init_poll_fds(uint32_t fence_count,
    for (uint32_t i = 0; i < fence_count; i++) {
       TU_FROM_HANDLE(tu_fence, fence, fences[i]);
 
+      /* skip wsi fences */
+      if (fence->fence_wsi)
+            continue;
+
       if (fence->signaled) {
          if (wait_all) {
             /* skip signaled fences */
@@ -292,6 +296,10 @@ tu_fence_update_fences_and_poll_fds(uint32_t fence_count,
    for (uint32_t i = 0; i < fence_count; i++) {
       TU_FROM_HANDLE(tu_fence, fence, fences[i]);
 
+      /* skip wsi fences */
+      if (fence->fence_wsi)
+            continue;
+
       /* no signaled fence in fds */
       if (fence->signaled)
          continue;
@@ -352,6 +360,9 @@ tu_WaitForFences(VkDevice _device,
    if (fds != stack_fds)
       vk_free(&device->alloc, fds);
 
+   if (result != VK_SUCCESS)
+      return result;
+
    for (uint32_t i = 0; i < fenceCount; ++i) {
       TU_FROM_HANDLE(tu_fence, fence, pFences[i]);
       if (fence->fence_wsi) {