vkr: log for resource lookup failures

Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/722>
macos/master
Chia-I Wu 3 years ago committed by Marge Bot
parent f648073d62
commit dd174873ca
  1. 2
      src/venus/vkr_device_memory.c
  2. 5
      src/venus/vkr_transport.c

@ -52,6 +52,7 @@ vkr_get_fd_info_from_resource_info(struct vkr_context *ctx,
att = vkr_context_get_resource(ctx, res_info->resourceId); att = vkr_context_get_resource(ctx, res_info->resourceId);
if (!att) { if (!att) {
vkr_log("failed to import resource: invalid res_id %u", res_info->resourceId);
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return false; return false;
} }
@ -270,6 +271,7 @@ vkr_dispatch_vkGetMemoryResourcePropertiesMESA(
struct vkr_resource_attachment *att = vkr_context_get_resource(ctx, args->resourceId); struct vkr_resource_attachment *att = vkr_context_get_resource(ctx, args->resourceId);
if (!att) { if (!att) {
vkr_log("failed to query resource props: invalid res_id %u", args->resourceId);
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return; return;
} }

@ -22,6 +22,7 @@ vkr_dispatch_vkSetReplyCommandStreamMESA(
att = vkr_context_get_resource(ctx, args->pStream->resourceId); att = vkr_context_get_resource(ctx, args->pStream->resourceId);
if (!att) { if (!att) {
vkr_log("failed to set reply stream: invalid res_id %u", args->pStream->resourceId);
vkr_cs_decoder_set_fatal(&ctx->decoder); vkr_cs_decoder_set_fatal(&ctx->decoder);
return; return;
} }
@ -45,8 +46,10 @@ copy_command_stream(struct vkr_context *ctx, const VkCommandStreamDescriptionMES
struct vkr_resource_attachment *att; struct vkr_resource_attachment *att;
att = vkr_context_get_resource(ctx, stream->resourceId); att = vkr_context_get_resource(ctx, stream->resourceId);
if (!att) if (!att) {
vkr_log("failed to copy command stream: invalid res_id %u", stream->resourceId);
return NULL; return NULL;
}
/* seek to offset */ /* seek to offset */
size_t iov_offset = stream->offset; size_t iov_offset = stream->offset;

Loading…
Cancel
Save