vrend: remove iov from vrend_renderer_resource_create

Remove iov from vrend_renderer_resource_create and make a separate
call to virgl_renderer_resource_attach_iov.  In practice, this
changes nothing because iov is always NULL.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Chia-I Wu 5 years ago
parent d471b7d1ba
commit dbf20dac33
  1. 15
      src/virglrenderer.c
  2. 4
      src/vrend_renderer.c
  3. 3
      src/vrend_renderer.h

@ -55,13 +55,24 @@ static struct virgl_glx *glx_info;
int virgl_renderer_resource_create(struct virgl_renderer_resource_create_args *args, struct iovec *iov, uint32_t num_iovs) int virgl_renderer_resource_create(struct virgl_renderer_resource_create_args *args, struct iovec *iov, uint32_t num_iovs)
{ {
return vrend_renderer_resource_create((struct vrend_renderer_resource_create_args *)args, iov, num_iovs, NULL); int ret;
ret = vrend_renderer_resource_create((struct vrend_renderer_resource_create_args *)args, NULL);
if (!ret && num_iovs) {
ret = virgl_renderer_resource_attach_iov(args->handle, iov, num_iovs);
if (ret) {
virgl_resource_remove(args->handle);
return ret;
}
}
return ret;
} }
int virgl_renderer_resource_import_eglimage(struct virgl_renderer_resource_create_args *args, void *image) int virgl_renderer_resource_import_eglimage(struct virgl_renderer_resource_create_args *args, void *image)
{ {
#ifdef HAVE_EPOXY_EGL_H #ifdef HAVE_EPOXY_EGL_H
return vrend_renderer_resource_create((struct vrend_renderer_resource_create_args *)args, 0, 0, image); return vrend_renderer_resource_create((struct vrend_renderer_resource_create_args *)args, image);
#else #else
return EINVAL; return EINVAL;
#endif #endif

@ -6654,7 +6654,7 @@ static int vrend_renderer_resource_allocate_texture(struct vrend_resource *gr,
} }
int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *args, int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *args,
struct iovec *iov, uint32_t num_iovs, void *image_oes) void *image_oes)
{ {
struct vrend_resource *gr; struct vrend_resource *gr;
int ret; int ret;
@ -6671,8 +6671,6 @@ int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *a
return ENOMEM; return ENOMEM;
vrend_renderer_resource_copy_args(args, gr); vrend_renderer_resource_copy_args(args, gr);
gr->iov = iov;
gr->num_iovs = num_iovs;
gr->storage_bits = VREND_STORAGE_GUEST_MEMORY; gr->storage_bits = VREND_STORAGE_GUEST_MEMORY;
if (args->flags & VIRGL_RESOURCE_Y_0_TOP) if (args->flags & VIRGL_RESOURCE_Y_0_TOP)

@ -182,7 +182,8 @@ struct vrend_renderer_resource_create_args {
uint32_t flags; uint32_t flags;
}; };
int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *args, struct iovec *iov, uint32_t num_iovs, void *image_eos); int vrend_renderer_resource_create(struct vrend_renderer_resource_create_args *args,
void *image_eos);
int vrend_create_surface(struct vrend_context *ctx, int vrend_create_surface(struct vrend_context *ctx,
uint32_t handle, uint32_t handle,

Loading…
Cancel
Save