radv/wsi: fix app that acquire multiple images up front
authorDave Airlie <airlied@redhat.com>
Thu, 13 Oct 2016 02:38:49 +0000 (12:38 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 13 Oct 2016 18:45:11 +0000 (04:45 +1000)
dota2 does multiple acquires followed by multiple queues,
this bug manifested itself as a hang in the xshmfence code
randomly when dota2 was doing it's menus. It also occured
when running dota2 under phoronix-test-suite.

The fix is once the image is acquired to mark it busy then
so nobody else can acquire. We have to trust vulkan apps
that they will eventually submit it.

Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_wsi_wayland.c
src/amd/vulkan/radv_wsi_x11.c

index 2b4a3d32a45c7b7b204fdd3a58fc603a3757b9ea..5ce2e9e7915bdbf87878f02e285535b4e04525b3 100644 (file)
@@ -521,6 +521,7 @@ wsi_wl_swapchain_acquire_next_image(struct radv_swapchain *radv_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 0aae2a3530d1b315bf12fe764aaa1f7ef48bda2a..9cd0db0a6850e2956481736c9647767313847193 100644 (file)
@@ -579,6 +579,7 @@ x11_acquire_next_image(struct radv_swapchain *radv_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;
                        }
                }