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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7014>
This commit is contained in:
Eric Anholt 2020-09-21 19:41:06 -07:00 committed by Marge Bot
parent 50f25da2b5
commit 5d3aeafa77
2 changed files with 3 additions and 6 deletions

View File

@ -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))

View File

@ -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)