Module: Mesa
Branch: staging/18.1
Commit: c4d9eca6e56c641fbaf28e4d79cb006d9460d863
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c4d9eca6e56c641fbaf28e4d79cb006d9460d863

Author: Lepton Wu <[email protected]>
Date:   Mon Jul 16 18:56:32 2018 -0700

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]>
(cherry picked from commit 04e278f79334c36f2afa315d3dcfcbec055a4d2a)

---

 src/gallium/drivers/virgl/virgl_encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/virgl/virgl_encode.c 
b/src/gallium/drivers/virgl/virgl_encode.c
index a6f6d13f85..209e163ac2 100644
--- a/src/gallium/drivers/virgl/virgl_encode.c
+++ b/src/gallium/drivers/virgl/virgl_encode.c
@@ -524,7 +524,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;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to