<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Feb 21, 2018 at 6:05 AM, Daniel Stone <span dir="ltr"><<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The FIFO thread signals shutdown by pushing UINT32_MAX into the acquire<br>
queue, and shutdown is signaled to it by pushing UINT32_MAX into the<br>
present queue.<br>
<br>
Explicitly catch a push of UINT32_MAX in either direction and treat this<br>
as error.<br>
<br>
Signed-off-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
---<br>
src/vulkan/wsi/wsi_common_x11.<wbr>c | 4 ++--<br>
1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/vulkan/wsi/wsi_common_<wbr>x11.c b/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
index e84572810d3..dadada82ef1 100644<br>
--- a/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
+++ b/src/vulkan/wsi/wsi_common_<wbr>x11.c<br>
@@ -832,7 +832,7 @@ x11_acquire_next_image_from_<wbr>queue(struct x11_swapchain *chain,<br>
VkResult result = wsi_queue_pull(&chain-><wbr>acquire_queue,<br>
&image_index, timeout);<br>
/* On error, the thread has shut down, so safe to update chain->status */<br>
- if (result < 0)<br>
+ if (result < 0 || image_index == UINT32_MAX)<br></blockquote><div><br></div><div>This only fixes an issue created by the previous patch.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
return x11_swapchain_result(chain, result);<br>
<br>
assert(image_index < chain->base.image_count);<br>
@@ -938,7 +938,7 @@ x11_manage_fifo_queues(void *state)<br>
result = wsi_queue_pull(&chain-><wbr>present_queue, &image_index, INT64_MAX);<br>
if (result < 0) {<br>
goto fail;<br>
- } else if (chain->status < 0) {<br>
+ } else if (chain->status < 0 || image_index == UINT32_MAX) {<br></blockquote><div><br></div><div>The one time UINT32_MAX is pushed onto the queue, chain->status is set to VK_ERROR_OUT_OF_DATE_KHR.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
/* The status can change underneath us if the swapchain is destroyed<br>
* from another thread.<br>
*/<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.14.3<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></div>