vkr: remember application name

Remember it as the instance name.

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 3bebc4de7f
commit f3da589754
  1. 14
      src/venus/vkr_context.c
  2. 5
      src/venus/vkr_context.h
  3. 2
      src/venus/vkr_instance.c

@ -28,12 +28,19 @@
#include "vkr_transport.h" #include "vkr_transport.h"
void void
vkr_context_add_instance(struct vkr_context *ctx, struct vkr_instance *instance) vkr_context_add_instance(struct vkr_context *ctx,
struct vkr_instance *instance,
const char *name)
{ {
vkr_context_add_object(ctx, &instance->base); vkr_context_add_object(ctx, &instance->base);
assert(!ctx->instance); assert(!ctx->instance);
ctx->instance = instance; ctx->instance = instance;
if (name && name[0] != '\0') {
assert(!ctx->instance_name);
ctx->instance_name = strdup(name);
}
} }
void void
@ -42,6 +49,11 @@ vkr_context_remove_instance(struct vkr_context *ctx, struct vkr_instance *instan
assert(ctx->instance && ctx->instance == instance); assert(ctx->instance && ctx->instance == instance);
ctx->instance = NULL; ctx->instance = NULL;
if (ctx->instance_name) {
free(ctx->instance_name);
ctx->instance_name = NULL;
}
vkr_context_remove_object(ctx, &instance->base); vkr_context_remove_object(ctx, &instance->base);
} }

@ -62,6 +62,7 @@ struct vkr_context {
struct list_head signaled_syncs; struct list_head signaled_syncs;
struct vkr_instance *instance; struct vkr_instance *instance;
char *instance_name;
}; };
static inline void static inline void
@ -94,7 +95,9 @@ vkr_context_remove_objects(struct vkr_context *ctx, struct list_head *objects)
} }
void void
vkr_context_add_instance(struct vkr_context *ctx, struct vkr_instance *instance); vkr_context_add_instance(struct vkr_context *ctx,
struct vkr_instance *instance,
const char *name);
void void
vkr_context_remove_instance(struct vkr_context *ctx, struct vkr_instance *instance); vkr_context_remove_instance(struct vkr_context *ctx, struct vkr_instance *instance);

@ -222,7 +222,7 @@ vkr_dispatch_vkCreateInstance(struct vn_dispatch_context *dispatch,
} }
} }
vkr_context_add_instance(ctx, instance); vkr_context_add_instance(ctx, instance, app_info.pApplicationName);
} }
void void

Loading…
Cancel
Save