From e64eeb52401a9f93ed0c7d035b5a106ddf83df7d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 19 Aug 2021 10:51:17 -0500 Subject: [PATCH] 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 Reviewed-by: Kenneth Graunke Cc: mesa-stable@lists.freedesktop.org Part-of: (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 =