From a23c091988f30fd432b5e1a68aedc95c307efa34 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 9 Apr 2019 17:55:40 +0000 Subject: virgl: handle fence_server_sync in winsys It does not need help from the driver. This also fixes one issue where the fence is ignored when the transfer queue is full. Signed-off-by: Chia-I Wu Reviewed-by: Emil Velikov --- src/gallium/drivers/virgl/virgl_context.c | 6 +----- src/gallium/drivers/virgl/virgl_transfer_queue.c | 2 +- src/gallium/drivers/virgl/virgl_winsys.h | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c index 6f546553204..f9591e214b5 100644 --- a/src/gallium/drivers/virgl/virgl_context.c +++ b/src/gallium/drivers/virgl/virgl_context.c @@ -759,7 +759,7 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure, ctx->num_transfers = ctx->num_draws = ctx->num_compute = 0; virgl_transfer_queue_clear(&ctx->queue, ctx->cbuf); - rs->vws->submit_cmd(rs->vws, ctx->cbuf, ctx->cbuf->in_fence_fd, + rs->vws->submit_cmd(rs->vws, ctx->cbuf, ctx->cbuf->needs_out_fence_fd ? &out_fence_fd : NULL); if (fence) @@ -786,10 +786,6 @@ static void virgl_flush_from_st(struct pipe_context *ctx, virgl_flush_eq(vctx, vctx, fence); - if (vctx->cbuf->in_fence_fd != -1) { - close(vctx->cbuf->in_fence_fd); - vctx->cbuf->in_fence_fd = -1; - } vctx->cbuf->needs_out_fence_fd = false; } diff --git a/src/gallium/drivers/virgl/virgl_transfer_queue.c b/src/gallium/drivers/virgl/virgl_transfer_queue.c index 25267d4bc82..6551d6a2cdb 100644 --- a/src/gallium/drivers/virgl/virgl_transfer_queue.c +++ b/src/gallium/drivers/virgl/virgl_transfer_queue.c @@ -206,7 +206,7 @@ static void add_internal(struct virgl_transfer_queue *queue, iter.data = queue->tbuf; perform_action(queue, &iter); - vws->submit_cmd(vws, queue->tbuf, -1, NULL); + vws->submit_cmd(vws, queue->tbuf, NULL); queue->num_dwords = 0; } } diff --git a/src/gallium/drivers/virgl/virgl_winsys.h b/src/gallium/drivers/virgl/virgl_winsys.h index e7f15327db0..d37454513cd 100644 --- a/src/gallium/drivers/virgl/virgl_winsys.h +++ b/src/gallium/drivers/virgl/virgl_winsys.h @@ -41,7 +41,6 @@ struct virgl_drm_caps { struct virgl_cmd_buf { unsigned cdw; uint32_t *buf; - int in_fence_fd; bool needs_out_fence_fd; }; @@ -89,7 +88,7 @@ struct virgl_winsys { void (*emit_res)(struct virgl_winsys *vws, struct virgl_cmd_buf *buf, struct virgl_hw_res *res, boolean write_buffer); int (*submit_cmd)(struct virgl_winsys *vws, struct virgl_cmd_buf *buf, - int32_t in_fence_fd, int32_t *out_fence_fd); + int32_t *out_fence_fd); boolean (*res_is_referenced)(struct virgl_winsys *vws, struct virgl_cmd_buf *buf, -- cgit v1.2.3