Mesa (main): anv: Set CONTEXT_PARAM_RECOVERABLE to false

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 19 19:49:55 UTC 2021


Module: Mesa
Branch: main
Commit: a6a449837b1753a70894a6d532262df2ec0de873
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a6a449837b1753a70894a6d532262df2ec0de873

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Aug 19 10:51:17 2021 -0500

anv: Set CONTEXT_PARAM_RECOVERABLE to false

We want the kernel to ban our context immediately instead of foolhardily
attempting to recover.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: mesa-stable at lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12476>

---

 src/intel/vulkan/anv_device.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index ef02557c4f1..3eb71eeb095 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -3283,6 +3283,15 @@ VkResult anv_CreateDevice(
       goto fail_fd;
    }
 
+   /* Here we tell the kernel not to attempt to recover our context but
+    * immediately (on the next batchbuffer submission) report that the
+    * context is lost, and we will do the recovery ourselves.  In the case
+    * of Vulkan, recovery means throwing VK_ERROR_DEVICE_LOST and letting
+    * the client clean up the pieces.
+    */
+   anv_gem_set_context_param(device->fd, device->context_id,
+                             I915_CONTEXT_PARAM_RECOVERABLE, false);
+
    device->has_thread_submit = physical_device->has_thread_submit;
 
    device->queues =



More information about the mesa-commit mailing list