<div dir="ltr"><div>Is this the same thing that happens on VT switch?  If so, we may want to return SURFACE_LOST for leases and OUT_OF_DATE for things running directly on the display.</div><div><br></div><div>--Jason<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 26, 2018 at 4:23 PM, Keith Packard <span dir="ltr"><<a href="mailto:keithp@keithp.com" target="_blank">keithp@keithp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Instead of encouraging the client to re-create the swapchain and keep<br>
going with an OUT_OF_DATE error, tell the client that further use of<br>
the current surface will not succeed as the associated kernel objects<br>
are no longer valid.<br>
<br>
In particular, when a DRM lease is revoked, then the client needs to<br>
get another lease and create a new surface for that.<br>
<br>
Signed-off-by: Keith Packard <<a href="mailto:keithp@keithp.com">keithp@keithp.com</a>><br>
Cc: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
---<br>
 src/vulkan/wsi/wsi_common_<wbr>display.c | 14 +++++++-------<br>
 1 file changed, 7 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/vulkan/wsi/wsi_common_<wbr>display.c b/src/vulkan/wsi/wsi_common_<wbr>display.c<br>
index c36b87c18c3..4a2d88ff77e 100644<br>
--- a/src/vulkan/wsi/wsi_common_<wbr>display.c<br>
+++ b/src/vulkan/wsi/wsi_common_<wbr>display.c<br>
@@ -1092,7 +1092,7 @@ wsi_display_acquire_next_<wbr>image(struct wsi_swapchain *drv_chain,<br>
       ret = wsi_display_wait_for_event(<wbr>wsi, timeout);<br>
<br>
       if (ret && ret != ETIMEDOUT) {<br>
-         result = VK_ERROR_OUT_OF_DATE_KHR;<br>
+         result = VK_ERROR_SURFACE_LOST_KHR;<br>
          goto done;<br>
       }<br>
    }<br>
@@ -1200,7 +1200,7 @@ wsi_display_setup_connector(<wbr>wsi_display_connector *connector,<br>
       if (errno == ENOMEM)<br>
          result = VK_ERROR_OUT_OF_HOST_MEMORY;<br>
       else<br>
-         result = VK_ERROR_OUT_OF_DATE_KHR;<br>
+         result = VK_ERROR_SURFACE_LOST_KHR;<br>
       goto bail;<br>
    }<br>
<br>
@@ -1211,7 +1211,7 @@ wsi_display_setup_connector(<wbr>wsi_display_connector *connector,<br>
       if (errno == ENOMEM)<br>
          result = VK_ERROR_OUT_OF_HOST_MEMORY;<br>
       else<br>
-         result = VK_ERROR_OUT_OF_DATE_KHR;<br>
+         result = VK_ERROR_SURFACE_LOST_KHR;<br>
       goto bail_mode_res;<br>
    }<br>
<br>
@@ -1220,7 +1220,7 @@ wsi_display_setup_connector(<wbr>wsi_display_connector *connector,<br>
       connector->crtc_id = wsi_display_select_crtc(<wbr>connector,<br>
                                                    mode_res, drm_connector);<br>
       if (!connector->crtc_id) {<br>
-         result = VK_ERROR_OUT_OF_DATE_KHR;<br>
+         result = VK_ERROR_SURFACE_LOST_KHR;<br>
          goto bail_connector;<br>
       }<br>
    }<br>
@@ -1238,7 +1238,7 @@ wsi_display_setup_connector(<wbr>wsi_display_connector *connector,<br>
       }<br>
<br>
       if (!drm_mode) {<br>
-         result = VK_ERROR_OUT_OF_DATE_KHR;<br>
+         result = VK_ERROR_SURFACE_LOST_KHR;<br>
          goto bail_connector;<br>
       }<br>
<br>
@@ -1425,7 +1425,7 @@ _wsi_display_queue_next(struct wsi_swapchain *drv_chain)<br>
    wsi_display_connector *connector = display_mode->connector;<br>
<br>
    if (wsi->fd < 0)<br>
-      return VK_ERROR_OUT_OF_DATE_KHR;<br>
+      return VK_ERROR_SURFACE_LOST_KHR;<br>
<br>
    if (display_mode != connector->current_mode)<br>
       connector->active = false;<br>
@@ -1497,7 +1497,7 @@ _wsi_display_queue_next(struct wsi_swapchain *drv_chain)<br>
       if (ret != -EACCES) {<br>
          connector->active = false;<br>
          image->state = WSI_IMAGE_IDLE;<br>
-         return VK_ERROR_OUT_OF_DATE_KHR;<br>
+         return VK_ERROR_SURFACE_LOST_KHR;<br>
       }<br>
<br>
       /* Some other VT is currently active. Sit here waiting for<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.17.1<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>