From 5d3aeafa77211efdc8836095f95d5776c11a708d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 21 Sep 2020 19:41:06 -0700 Subject: [PATCH] turnip: Report device loss through _mesa_loge() instead of fprintf. We drop the file/line, but there are only a couple of places calling this and they have unique strings anyway. Part-of: --- src/freedreno/vulkan/tu_device.c | 4 +--- src/freedreno/vulkan/tu_private.h | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c index fbc8d60bac6..c98ca46a670 100644 --- a/src/freedreno/vulkan/tu_device.c +++ b/src/freedreno/vulkan/tu_device.c @@ -1197,7 +1197,6 @@ tu_DestroyDevice(VkDevice _device, const VkAllocationCallbacks *pAllocator) VkResult _tu_device_set_lost(struct tu_device *device, - const char *file, int line, const char *msg, ...) { /* Set the flag indicating that waits should return in finite time even @@ -1206,10 +1205,9 @@ _tu_device_set_lost(struct tu_device *device, p_atomic_inc(&device->_lost); /* TODO: Report the log message through VkDebugReportCallbackEXT instead */ - fprintf(stderr, "%s:%d: ", file, line); va_list ap; va_start(ap, msg); - vfprintf(stderr, msg, ap); + mesa_loge_v(msg, ap); va_end(ap); if (env_var_as_boolean("TU_ABORT_ON_DEVICE_LOSS", false)) diff --git a/src/freedreno/vulkan/tu_private.h b/src/freedreno/vulkan/tu_private.h index 1f82a8f2e66..ca2d863c238 100644 --- a/src/freedreno/vulkan/tu_private.h +++ b/src/freedreno/vulkan/tu_private.h @@ -406,10 +406,9 @@ struct tu_device }; VkResult _tu_device_set_lost(struct tu_device *device, - const char *file, int line, - const char *msg, ...) PRINTFLIKE(4, 5); + const char *msg, ...) PRINTFLIKE(2, 3); #define tu_device_set_lost(dev, ...) \ - _tu_device_set_lost(dev, __FILE__, __LINE__, __VA_ARGS__) + _tu_device_set_lost(dev, __VA_ARGS__) static inline bool tu_device_is_lost(struct tu_device *device)