vkr: prefer instance name over debug name

While crosvm gets the legit debug name from the guest kernel, it does
not pass it to virglrenderer.  We prefer the instance name anyway.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
macos/master
Chia-I Wu 3 years ago
parent f3da589754
commit 55de875721
  1. 2
      src/venus/vkr_context.c
  2. 10
      src/venus/vkr_context.h

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

@ -94,6 +94,16 @@ vkr_context_remove_objects(struct vkr_context *ctx, struct list_head *objects)
/* objects should be reinitialized if to be reused */
}
static inline const char *
vkr_context_get_name(const struct vkr_context *ctx)
{
/* ctx->instance_name is the application name while ctx->debug_name is
* usually the guest process name or the hypervisor name. This never
* returns NULL because ctx->debug_name is never NULL.
*/
return ctx->instance_name ? ctx->instance_name : ctx->debug_name;
}
void
vkr_context_add_instance(struct vkr_context *ctx,
struct vkr_instance *instance,

Loading…
Cancel
Save