virgl: pass blob size in get_blob

We will need it to allocate a mmapable fd.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Chia-I Wu 3 years ago
parent 3464655e84
commit 7990977ebf
  1. 4
      src/venus/vkr_context.c
  2. 1
      src/virgl_context.h
  3. 2
      src/virglrenderer.c
  4. 1
      src/vrend_decode.c

@ -267,6 +267,7 @@ vkr_context_submit_cmd(struct virgl_context *base, const void *buffer, size_t si
static int
vkr_context_get_blob_locked(struct virgl_context *base,
uint64_t blob_id,
UNUSED uint64_t blob_size,
uint32_t flags,
struct virgl_context_blob *blob)
{
@ -356,6 +357,7 @@ vkr_context_get_blob_locked(struct virgl_context *base,
static int
vkr_context_get_blob(struct virgl_context *base,
uint64_t blob_id,
uint64_t blob_size,
uint32_t flags,
struct virgl_context_blob *blob)
{
@ -363,7 +365,7 @@ vkr_context_get_blob(struct virgl_context *base,
int ret;
mtx_lock(&ctx->mutex);
ret = vkr_context_get_blob_locked(base, blob_id, flags, blob);
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);

@ -96,6 +96,7 @@ struct virgl_context {
*/
int (*get_blob)(struct virgl_context *ctx,
uint64_t blob_id,
uint64_t blob_size,
uint32_t blob_flags,
struct virgl_context_blob *blob);
void (*get_blob_done)(struct virgl_context *ctx,

@ -877,7 +877,7 @@ int virgl_renderer_resource_create_blob(const struct virgl_renderer_resource_cre
if (!ctx)
return -EINVAL;
ret = ctx->get_blob(ctx, args->blob_id, args->blob_flags, &blob);
ret = ctx->get_blob(ctx, args->blob_id, args->size, args->blob_flags, &blob);
if (ret)
return ret;

@ -1579,6 +1579,7 @@ static int vrend_decode_ctx_transfer_3d(struct virgl_context *ctx,
static int vrend_decode_ctx_get_blob(struct virgl_context *ctx,
uint64_t blob_id,
UNUSED uint64_t blob_size,
UNUSED uint32_t blob_flags,
struct virgl_context_blob *blob)
{

Loading…
Cancel
Save