anv/wsi: fix apps that acquire multiple images up front
authorDave Airlie <airlied@redhat.com>
Thu, 13 Oct 2016 02:43:07 +0000 (12:43 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 13 Oct 2016 18:45:11 +0000 (04:45 +1000)
This fix was found in the radv codebase when running dota2,
no idea if anyone has reported it on anv, but the same problem
occurs.

Once an image is acquired we need to mark it busy.

Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/intel/vulkan/anv_wsi_wayland.c
src/intel/vulkan/anv_wsi_x11.c

index afce96f2df4ca9a2b3c6a706ee456a0e6fa9efbc..e6cc09ff216f8b797f4967f929360c16eca0c1d4 100644 (file)
@@ -523,6 +523,7 @@ wsi_wl_swapchain_acquire_next_image(struct anv_swapchain *anv_chain,
          if (!chain->images[i].busy) {
             /* We found a non-busy image */
             *image_index = i;
+            chain->images[image_index].busy = true;
             return VK_SUCCESS;
          }
       }
index 010c86c4f262046cc8c4f19986ec0c6f8d9e6006..57485060322b45829e863b88e125993a8d4eb3d8 100644 (file)
@@ -574,6 +574,7 @@ x11_acquire_next_image(struct anv_swapchain *anv_chain,
             /* We found a non-busy image */
             xshmfence_await(chain->images[i].shm_fence);
             *image_index = i;
+            chain->images[i].busy = true;
             return VK_SUCCESS;
          }
       }