virgl: Fix flush in virgl_encoder_inline_write.

The current code is buggy: if there are only 12 dwords left in cbuf,
we emit a zero data length command which will be rejected by virglrenderer.
Fix it by calling flush in this case.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Lepton Wu 2018-07-16 18:56:32 -07:00 committed by Dave Airlie
parent b5db3aa6e8
commit 04e278f793
1 changed files with 1 additions and 1 deletions

View File

@ -528,7 +528,7 @@ int virgl_encoder_inline_write(struct virgl_context *ctx,
left_bytes = size;
while (left_bytes) {
if (ctx->cbuf->cdw + 12 > VIRGL_MAX_CMDBUF_DWORDS)
if (ctx->cbuf->cdw + 12 >= VIRGL_MAX_CMDBUF_DWORDS)
ctx->base.flush(&ctx->base, NULL, 0);
thispass = (VIRGL_MAX_CMDBUF_DWORDS - ctx->cbuf->cdw - 12) * 4;