From 7b19c9d19be2734741538eb57f9079e779a4112d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 28 Oct 2021 11:40:02 -0500 Subject: [PATCH] vulkan/device: Log the timeline mode when lost Reviewed-by: Lionel Landwerlin Acked-by: Bas Nieuwenhuizen Part-of: --- src/vulkan/runtime/vk_device.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/vulkan/runtime/vk_device.c b/src/vulkan/runtime/vk_device.c index 3bbe89a1381..94b17b44fb3 100644 --- a/src/vulkan/runtime/vk_device.c +++ b/src/vulkan/runtime/vk_device.c @@ -188,6 +188,20 @@ vk_device_flush(struct vk_device *device) return VK_SUCCESS; } +static const char * +timeline_mode_str(struct vk_device *device) +{ + switch (device->timeline_mode) { +#define CASE(X) case VK_DEVICE_TIMELINE_MODE_##X: return #X; + CASE(NONE) + CASE(EMULATED) + CASE(ASSISTED) + CASE(NATIVE) +#undef CASE + default: return "UNKNOWN"; + } +} + void _vk_device_report_lost(struct vk_device *device) { @@ -202,6 +216,9 @@ _vk_device_report_lost(struct vk_device *device) "%s", queue->_lost.error_msg); } } + + vk_logd(VK_LOG_OBJS(device), "Timeline mode is %s.", + timeline_mode_str(device)); } VkResult @@ -221,6 +238,9 @@ _vk_device_set_lost(struct vk_device *device, __vk_errorv(device, VK_ERROR_DEVICE_LOST, file, line, msg, ap); va_end(ap); + vk_logd(VK_LOG_OBJS(device), "Timeline mode is %s.", + timeline_mode_str(device)); + if (env_var_as_boolean("MESA_VK_ABORT_ON_DEVICE_LOSS", false)) abort();