virgl: let proxy ignore iovs to allow classic 3d resource import

Use virgl_resource_get_size to fill the size so that supported classic
3d resource can have a valid size as well.

This change also links venus .clang-format into server and proxy.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Yiwei Zhang 3 years ago
parent fad66514d6
commit b04e55d18f
  1. 1
      server/.clang-format
  2. 1
      server/render_context.c
  3. 1
      src/proxy/.clang-format
  4. 8
      src/proxy/proxy_context.c

@ -0,0 +1 @@
../src/venus/.clang-format

@ -301,6 +301,7 @@ render_context_dispatch_attach_resource(struct render_context *ctx,
return false; return false;
} }
/* classic 3d resource with valid size reuses the blob import path here */
struct render_context_resource *res = struct render_context_resource *res =
render_context_resource_import(res_id, fd_type, fds[0], size); render_context_resource_import(res_id, fd_type, fds[0], size);
if (!res) { if (!res) {

@ -0,0 +1 @@
../venus/.clang-format

@ -400,11 +400,6 @@ proxy_context_attach_resource(struct virgl_context *base, struct virgl_resource
{ {
struct proxy_context *ctx = (struct proxy_context *)base; struct proxy_context *ctx = (struct proxy_context *)base;
if (res->iov_count) {
proxy_log("failed to attach resource with iov");
return;
}
enum virgl_resource_fd_type res_fd_type = res->fd_type; enum virgl_resource_fd_type res_fd_type = res->fd_type;
int res_fd = res->fd; int res_fd = res->fd;
bool close_res_fd = false; bool close_res_fd = false;
@ -418,11 +413,12 @@ proxy_context_attach_resource(struct virgl_context *base, struct virgl_resource
close_res_fd = true; close_res_fd = true;
} }
/* the proxy ignores iovs since transfer_3d is not supported */
const struct render_context_op_attach_resource_request req = { const struct render_context_op_attach_resource_request req = {
.header.op = RENDER_CONTEXT_OP_ATTACH_RESOURCE, .header.op = RENDER_CONTEXT_OP_ATTACH_RESOURCE,
.res_id = res->res_id, .res_id = res->res_id,
.fd_type = res_fd_type, .fd_type = res_fd_type,
.size = res->map_size, .size = virgl_resource_get_size(res),
}; };
if (!proxy_socket_send_request_with_fds(&ctx->socket, &req, sizeof(req), &res_fd, 1)) if (!proxy_socket_send_request_with_fds(&ctx->socket, &req, sizeof(req), &res_fd, 1))
proxy_log("failed to attach res %d", res->res_id); proxy_log("failed to attach res %d", res->res_id);

Loading…
Cancel
Save