virgl/vtest: wait after issuing a transfer get
authorGurchetan Singh <gurchetansingh@chromium.org>
Sat, 15 Dec 2018 00:36:07 +0000 (16:36 -0800)
committerGurchetan Singh <gurchetansingh@chromium.org>
Thu, 18 Apr 2019 22:39:18 +0000 (15:39 -0700)
Otherwise, there's artifacts when running Unigine Valley with
protocol version 2.

We can get away with not waiting for most buffers, but let's
be conservative.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Piotr Rak <p.rak@samsung.com>
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.c

index 48f9c306a0e359ea51c1c55ca3b923cca1a3513d..687f4f3052825167177fe6a6fecadf8fac776ace 100644 (file)
@@ -113,6 +113,9 @@ virgl_vtest_transfer_get_internal(struct virgl_winsys *vws,
                                  level, stride, layer_stride,
                                  box, size, buf_offset);
 
+   if (flush_front_buffer || vtws->protocol_version >= 2)
+      virgl_vtest_busy_wait(vtws, res->res_handle, VCMD_BUSY_WAIT_FLAG_WAIT);
+
    if (vtws->protocol_version >= 2) {
       if (flush_front_buffer) {
          if (box->depth > 1 || box->z > 1) {
@@ -702,8 +705,6 @@ static void virgl_vtest_flush_frontbuffer(struct virgl_winsys *vws,
       box.depth = 1;
    }
 
-   virgl_vtest_busy_wait(vtws, res->res_handle, VCMD_BUSY_WAIT_FLAG_WAIT);
-
    virgl_vtest_transfer_get_internal(vws, res, &box, res->stride, 0, offset,
                                      level, true);