...
 
Commits (1)
  • Gert Wollny's avatar
    virgl: skip flushing empty command chains · 45c2c1f9
    Gert Wollny authored
    After each flush the command chain is set up again to contain the
    SET_SUB_CTX command, and currently, this command is always send
    whenever the buffers are flusahed and a fence is set or the transfer
    buffers are not empty.
    
    Skip sending the command buffer and clearing the transfer queue when
    the command buffer doesn't contain any additional commands to avoid
    VM exists.
    
    v2: Always send command queue when a fence is requested (Alexandros)
    
    Fixes:
      virgl/virglrenderer#107Signed-off-by: Gert Wollny's avatarGert Wollny <gert.wollny@collabora.com>
    45c2c1f9
......@@ -768,14 +768,16 @@ static void virgl_flush_eq(struct virgl_context *ctx, void *closure,
/* send the buffer to the remote side for decoding */
ctx->num_draws = ctx->num_compute = 0;
virgl_transfer_queue_clear(&ctx->queue, ctx->cbuf);
rs->vws->submit_cmd(rs->vws, ctx->cbuf, fence);
if (ctx->cbuf->cdw != ctx->cbuf_initial_cdw || fence) {
virgl_transfer_queue_clear(&ctx->queue, ctx->cbuf);
rs->vws->submit_cmd(rs->vws, ctx->cbuf, fence);
/* Reserve some space for transfers. */
if (ctx->encoded_transfers)
ctx->cbuf->cdw = VIRGL_MAX_TBUF_DWORDS;
/* Reserve some space for transfers. */
if (ctx->encoded_transfers)
ctx->cbuf->cdw = VIRGL_MAX_TBUF_DWORDS;
virgl_encoder_set_sub_ctx(ctx, ctx->hw_sub_ctx_id);
virgl_encoder_set_sub_ctx(ctx, ctx->hw_sub_ctx_id);
}
ctx->cbuf_initial_cdw = ctx->cbuf->cdw;
......