vulkan/wsi/x11: Consistently update and return swapchain status
authorDaniel Stone <daniels@collabora.com>
Tue, 20 Feb 2018 20:56:02 +0000 (20:56 +0000)
committerDaniel Stone <daniels@collabora.com>
Wed, 21 Feb 2018 22:37:10 +0000 (22:37 +0000)
commitc7e22483febd2f21452f8dff8f987c998f9a75f5
tree9ed1ddca53d58b0ad75e02ee9ffb603549d51ea8
parent6937c613242d646b8c37f01ffd6a02a9b64c8d6c
vulkan/wsi/x11: Consistently update and return swapchain status

Use a helper function for updating the swapchain status. This will be
used later to handle VK_SUBOPTIMAL_KHR, where we need to make a
non-error status stick to the swapchain until recreation.  Instead of
direct comparisons to VK_SUCCESS to check for error, test for negative
numbers meaning an error status, and positive numbers indicating
non-error statuses.

v2 (Jason Ekstrand):
 - Use a pattern of "return x11_swapchain_result(chain, VK_WHATEVER)"
 - Handle wsi_queue_pull returning VK_TIMEOUT
 - Call x11_swapchain_result in x11_present_to_x11

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/vulkan/wsi/wsi_common_x11.c