Mesa (staging/21.2): anv: Set CONTEXT_PARAM_RECOVERABLE to false

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 24 23:01:10 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: e64eeb52401a9f93ed0c7d035b5a106ddf83df7d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e64eeb52401a9f93ed0c7d035b5a106ddf83df7d

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>
(cherry picked from commit a6a449837b1753a70894a6d532262df2ec0de873)

---

 .pick_status.json             | 2 +-
 src/intel/vulkan/anv_device.c | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index ffd7d661f99..72d09ae36b1 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1282,7 +1282,7 @@
         "description": "anv: Set CONTEXT_PARAM_RECOVERABLE to false",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 583a9d8f7c0..83ea7bd2560 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -3203,6 +3203,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