From 2b66582c3285cb96c6b41ef49a77155801e91460 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Mon, 13 Dec 2021 23:32:52 +0000 Subject: [PATCH] virglrenderer: drop get_blob_done vkr no longer needs it to support transfer_3d. Signed-off-by: Yiwei Zhang Reviewed-by: Chia-I Wu --- src/proxy/proxy_context.c | 1 - src/venus/vkr_context.c | 22 +++------------------- src/virgl_context.h | 6 +----- src/virglrenderer.c | 3 --- src/vrend_decode.c | 1 - 5 files changed, 4 insertions(+), 29 deletions(-) diff --git a/src/proxy/proxy_context.c b/src/proxy/proxy_context.c index 057994f..46b80a0 100644 --- a/src/proxy/proxy_context.c +++ b/src/proxy/proxy_context.c @@ -481,7 +481,6 @@ proxy_context_init_base(struct proxy_context *ctx) ctx->base.detach_resource = proxy_context_detach_resource; ctx->base.transfer_3d = proxy_context_transfer_3d; ctx->base.get_blob = proxy_context_get_blob; - ctx->base.get_blob_done = NULL; ctx->base.submit_cmd = proxy_context_submit_cmd; ctx->base.get_fencing_fd = proxy_context_get_fencing_fd; diff --git a/src/venus/vkr_context.c b/src/venus/vkr_context.c index 37b1e57..4dfcbb2 100644 --- a/src/venus/vkr_context.c +++ b/src/venus/vkr_context.c @@ -354,6 +354,8 @@ vkr_context_get_blob_locked(struct virgl_context *base, ret = vkr_device_memory_export_fd(mem, handle_type, &fd); if (ret) return ret; + + mem->exported = true; } blob->type = fd_type; @@ -392,28 +394,11 @@ vkr_context_get_blob(struct virgl_context *base, mtx_lock(&ctx->mutex); ret = vkr_context_get_blob_locked(base, blob_id, blob_size, flags, blob); - /* XXX unlock in vkr_context_get_blob_done on success */ - if (ret) - mtx_unlock(&ctx->mutex); + mtx_unlock(&ctx->mutex); return ret; } -static void -vkr_context_get_blob_done(struct virgl_context *base, - uint32_t res_id, - struct virgl_context_blob *blob) -{ - struct vkr_context *ctx = (struct vkr_context *)base; - struct vkr_device_memory *mem = blob->renderer_data; - - if (mem) - mem->exported = true; - - /* XXX locked in vkr_context_get_blob */ - mtx_unlock(&ctx->mutex); -} - static int vkr_context_transfer_3d(struct virgl_context *base, struct virgl_resource *res, @@ -563,7 +548,6 @@ vkr_context_init_base(struct vkr_context *ctx) ctx->base.detach_resource = vkr_context_detach_resource; ctx->base.transfer_3d = vkr_context_transfer_3d; ctx->base.get_blob = vkr_context_get_blob; - ctx->base.get_blob_done = vkr_context_get_blob_done; ctx->base.submit_cmd = vkr_context_submit_cmd; ctx->base.get_fencing_fd = vkr_context_get_fencing_fd; diff --git a/src/virgl_context.h b/src/virgl_context.h index 8a7fed2..d033156 100644 --- a/src/virgl_context.h +++ b/src/virgl_context.h @@ -88,8 +88,7 @@ struct virgl_context { /* These are used to create a virgl_resource from a context object. * * get_blob returns a virgl_context_blob from which a virgl_resource can be - * created. get_blob_done is optional and allows the context to associate - * the newly created resource with the context object. + * created. * * Note that get_blob is a one-time thing. The context object might be * destroyed or reject subsequent get_blob calls. @@ -99,9 +98,6 @@ struct virgl_context { uint64_t blob_size, uint32_t blob_flags, struct virgl_context_blob *blob); - void (*get_blob_done)(struct virgl_context *ctx, - uint32_t res_id, - struct virgl_context_blob *blob); int (*submit_cmd)(struct virgl_context *ctx, const void *buffer, diff --git a/src/virglrenderer.c b/src/virglrenderer.c index 1f37fd9..2f65f24 100644 --- a/src/virglrenderer.c +++ b/src/virglrenderer.c @@ -938,9 +938,6 @@ int virgl_renderer_resource_create_blob(const struct virgl_renderer_resource_cre res->map_info = blob.map_info; res->map_size = args->size; - if (ctx->get_blob_done) - ctx->get_blob_done(ctx, args->res_handle, &blob); - return 0; } diff --git a/src/vrend_decode.c b/src/vrend_decode.c index 46b76c2..72fb6f9 100644 --- a/src/vrend_decode.c +++ b/src/vrend_decode.c @@ -1786,7 +1786,6 @@ static void vrend_decode_ctx_init_base(struct vrend_decode_ctx *dctx, ctx->detach_resource = vrend_decode_ctx_detach_resource; ctx->transfer_3d = vrend_decode_ctx_transfer_3d; ctx->get_blob = vrend_decode_ctx_get_blob; - ctx->get_blob_done = NULL; ctx->submit_cmd = vrend_decode_ctx_submit_cmd; ctx->get_fencing_fd = vrend_decode_ctx_get_fencing_fd;