summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_context.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2019-04-18 15:34:46 -0700
committerChia-I Wu <[email protected]>2019-04-23 19:07:48 +0000
commitcc53815ae10dc39c7e56a3801568794a6ad8b539 (patch)
tree101c9b44e073d24ab5efc58b1bb409f687074b75 /src/gallium/drivers/virgl/virgl_context.c
parentec686a66dbf2180631564a3877884b1e4d0c8ea4 (diff)
virgl: skip empty cmdbufs
Several empty cmdbufs are submitted by app/xserver per frame, from glamor_block_handler for example. Let's skip them. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_context.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index 69b56bfd036..b3119ee95cc 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -756,6 +756,12 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
{
struct virgl_screen *rs = virgl_screen(ctx->base.screen);
+ /* skip empty cbuf */
+ if (ctx->cbuf->cdw == ctx->cbuf_initial_cdw &&
+ ctx->queue.num_dwords == 0 &&
+ !fence)
+ return;
+
if (ctx->num_draws)
u_upload_unmap(ctx->uploader);
@@ -773,6 +779,8 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
/* add back current framebuffer resources to reference list? */
virgl_reemit_res(ctx);
+
+ ctx->cbuf_initial_cdw = ctx->cbuf->cdw;
}
static void virgl_flush_from_st(struct pipe_context *ctx,