summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_context.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-04-09 18:18:43 +0000
committerGurchetan Singh <[email protected]>2019-04-15 23:25:47 +0000
commit334103efbfcd37488eed49e16871f46d56d8e9a8 (patch)
tree2c93f4d1f96ec57a3bb6fcd8186fd0d90e15baeb /src/gallium/drivers/virgl/virgl_context.c
parenta23c091988f30fd432b5e1a68aedc95c307efa34 (diff)
virgl: hide fence internals from the driver
Fence fds are cheaper than resources. We want to let winsys make the decision and use fence fds whenever they are supported. This commit prepares the work. For the moment, we create a resource _and_ a fence fd when supports_fences is true. This will be fixed such that we create a resource _or_ a fence fd. (And because of a version check bug that we will fix later, supports_fences is actually never true). Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_context.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index f9591e214b5..5e608e47fd0 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -750,7 +750,6 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
struct pipe_fence_handle **fence)
{
struct virgl_screen *rs = virgl_screen(ctx->base.screen);
- int out_fence_fd = -1;
if (ctx->num_draws)
u_upload_unmap(ctx->uploader);
@@ -759,11 +758,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->needs_out_fence_fd ? &out_fence_fd : NULL);
-
- if (fence)
- *fence = rs->vws->cs_create_fence(rs->vws, out_fence_fd);
+ rs->vws->submit_cmd(rs->vws, ctx->cbuf, fence);
/* Reserve some space for transfers. */
if (ctx->encoded_transfers)
@@ -781,12 +776,7 @@ static void virgl_flush_from_st(struct pipe_context *ctx,
{
struct virgl_context *vctx = virgl_context(ctx);
- if (flags & PIPE_FLUSH_FENCE_FD)
- vctx->cbuf->needs_out_fence_fd = true;
-
virgl_flush_eq(vctx, vctx, fence);
-
- vctx->cbuf->needs_out_fence_fd = false;
}
static struct pipe_sampler_view *virgl_create_sampler_view(struct pipe_context *ctx,