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:
parent
b5db3aa6e8
commit
04e278f793
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue