diff options
author | Chia-I Wu <[email protected]> | 2019-04-09 17:55:40 +0000 |
---|---|---|
committer | Gurchetan Singh <[email protected]> | 2019-04-15 23:25:47 +0000 |
commit | a23c091988f30fd432b5e1a68aedc95c307efa34 (patch) | |
tree | cd3dddd5930a34110259f18b005aa045821ad2ae /src/gallium/drivers | |
parent | 88e0bbf24aa82000195d10c7873f881d190b825b (diff) |
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 <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_context.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/virgl/virgl_transfer_queue.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/virgl/virgl_winsys.h | 3 |
3 files changed, 3 insertions, 8 deletions
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, |