vrend: Skip iov transfer if resource created from egl image.

If resource created from egl image we don't need to attach iov to it.
Therefore we don't need to do transfer iov to/from host for those
resources.

Signed-off-by: Yurii Danilovskyi <glyd@opensynergy.com>
Reviewed-by: maksym.wezdecki@collabora.com
macos/master
Yurii Danilovskyi 3 years ago committed by Yurii Danilovskyi
parent 526faef410
commit 8c140709bc
  1. 12
      src/vrend_renderer.c

@ -7205,6 +7205,7 @@ static int vrend_resource_alloc_texture(struct vrend_resource *gr,
glBindTexture(gr->target, 0);
return EINVAL;
}
gr->storage_bits |= VREND_STORAGE_EGL_IMAGE;
} else {
internalformat = tex_conv_table[format].internalformat;
glformat = tex_conv_table[format].glformat;
@ -8403,11 +8404,20 @@ int vrend_renderer_transfer_iov(struct vrend_context *ctx,
struct vrend_resource *res;
res = vrend_renderer_ctx_res_lookup(ctx, dst_handle);
if (!res || !check_transfer_iovec(res, info)) {
if (!res) {
vrend_report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, dst_handle);
return EINVAL;
}
if (!check_transfer_iovec(res, info)) {
if (has_bit(res->storage_bits, VREND_STORAGE_EGL_IMAGE))
return 0;
else {
vrend_report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, dst_handle);
return EINVAL;
}
}
return vrend_renderer_transfer_internal(ctx, res, info,
transfer_mode);
}

Loading…
Cancel
Save