vkr: improve clean up logging

Log the context id/name when a context is destroyed with an instance.
Log before vkDeviceWaitIdle when a device is destroyed with objects.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Chia-I Wu 3 years ago
parent e473430d1f
commit 47b8232e41
  1. 3
      src/venus/vkr_context.c
  2. 10
      src/venus/vkr_device.c

@ -504,7 +504,8 @@ vkr_context_destroy(struct virgl_context *base)
} }
if (ctx->instance) { if (ctx->instance) {
vkr_log("destroying context with a valid instance"); vkr_log("destroying context %d (%s) with a valid instance", ctx->base.ctx_id,
ctx->debug_name);
vkr_instance_destroy(ctx, ctx->instance); vkr_instance_destroy(ctx, ctx->instance);
} }

@ -336,13 +336,15 @@ void
vkr_device_destroy(struct vkr_context *ctx, struct vkr_device *dev) vkr_device_destroy(struct vkr_context *ctx, struct vkr_device *dev)
{ {
VkDevice device = dev->base.handle.device; VkDevice device = dev->base.handle.device;
VkResult ret = vkDeviceWaitIdle(device);
if (ret != VK_SUCCESS)
vkr_log("vkDeviceWaitIdle(%p) failed(%d)", dev, (int32_t)ret);
if (!LIST_IS_EMPTY(&dev->objects)) { if (!LIST_IS_EMPTY(&dev->objects))
vkr_log("destroying device with valid objects"); vkr_log("destroying device with valid objects");
VkResult result = vkDeviceWaitIdle(device);
if (result != VK_SUCCESS)
vkr_log("vkDeviceWaitIdle(%p) failed(%d)", dev, (int32_t)result);
if (!LIST_IS_EMPTY(&dev->objects)) {
struct vkr_object *obj, *obj_tmp; struct vkr_object *obj, *obj_tmp;
LIST_FOR_EACH_ENTRY_SAFE (obj, obj_tmp, &dev->objects, track_head) LIST_FOR_EACH_ENTRY_SAFE (obj, obj_tmp, &dev->objects, track_head)
vkr_device_object_destroy(ctx, dev, obj); vkr_device_object_destroy(ctx, dev, obj);

Loading…
Cancel
Save