diff --git a/src/virglrenderer.c b/src/virglrenderer.c index d5cc44b..286de7e 100644 --- a/src/virglrenderer.c +++ b/src/virglrenderer.c @@ -133,7 +133,7 @@ int virgl_renderer_transfer_write_iov(uint32_t handle, transfer_info.iovec_cnt = iovec_cnt; transfer_info.context0 = true; - return vrend_renderer_transfer_iov(&transfer_info, VREND_TRANSFER_WRITE); + return vrend_renderer_transfer_iov(&transfer_info, VIRGL_TRANSFER_TO_HOST); } int virgl_renderer_transfer_read_iov(uint32_t handle, uint32_t ctx_id, @@ -156,7 +156,7 @@ int virgl_renderer_transfer_read_iov(uint32_t handle, uint32_t ctx_id, transfer_info.iovec_cnt = iovec_cnt; transfer_info.context0 = true; - return vrend_renderer_transfer_iov(&transfer_info, VREND_TRANSFER_READ); + return vrend_renderer_transfer_iov(&transfer_info, VIRGL_TRANSFER_FROM_HOST); } int virgl_renderer_resource_attach_iov(int res_handle, struct iovec *iov, diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index b0d89c8..b43e507 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -6864,10 +6864,15 @@ int vrend_renderer_transfer_iov(const struct vrend_transfer_info *info, ctx = NULL; } - if (transfer_mode == VREND_TRANSFER_WRITE) + switch (transfer_mode) { + case VIRGL_TRANSFER_TO_HOST: return vrend_renderer_transfer_write_iov(ctx, res, iov, num_iovs, info); - else + case VIRGL_TRANSFER_FROM_HOST: return vrend_renderer_transfer_send_iov(res, iov, num_iovs, info); + + default: + assert(0); + } } int vrend_transfer_inline_write(struct vrend_context *ctx, @@ -8810,7 +8815,7 @@ void vrend_renderer_get_rect(int res_handle, struct iovec *iov, unsigned int num transfer_info.iovec = iov; transfer_info.iovec_cnt = num_iovs; transfer_info.context0 = true; - vrend_renderer_transfer_iov(&transfer_info, VREND_TRANSFER_READ); + vrend_renderer_transfer_iov(&transfer_info, VIRGL_TRANSFER_FROM_HOST); } void vrend_renderer_resource_set_priv(uint32_t res_handle, void *priv) diff --git a/src/vrend_renderer.h b/src/vrend_renderer.h index 4e34391..7708bed 100644 --- a/src/vrend_renderer.h +++ b/src/vrend_renderer.h @@ -266,8 +266,6 @@ void vrend_set_framebuffer_state_no_attach(struct vrend_context *ctx, uint32_t layers, uint32_t samples); void vrend_texture_barrier(struct vrend_context *ctx, unsigned flags); -#define VREND_TRANSFER_WRITE 1 -#define VREND_TRANSFER_READ 2 int vrend_renderer_transfer_iov(const struct vrend_transfer_info *info, int transfer_mode); void vrend_renderer_resource_copy_region(struct vrend_context *ctx,