diff options
author | Lepton Wu <[email protected]> | 2018-07-16 18:56:32 -0700 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2018-07-17 14:56:25 +1000 |
commit | 04e278f79334c36f2afa315d3dcfcbec055a4d2a (patch) | |
tree | a28ef0fe775a6e9b8b0e6cd4333b3e050ff310de /src/gallium/drivers/virgl/virgl_encode.c | |
parent | b5db3aa6e8173600037b68e7ec4351bd2c1aade4 (diff) |
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: [email protected]
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_encode.c')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_encode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c index c7c6b1e7d34..c1af01b6fdf 100644 --- a/src/gallium/drivers/virgl/virgl_encode.c +++ b/src/gallium/drivers/virgl/virgl_encode.c @@ -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; |