virgl/vtest: bump up protocol version + support encoded transfers
authorGurchetan Singh <gurchetansingh@chromium.org>
Sat, 15 Dec 2018 00:07:19 +0000 (16:07 -0800)
committerGurchetan Singh <gurchetansingh@chromium.org>
Thu, 18 Apr 2019 22:39:23 +0000 (15:39 -0700)
This more accurately reflects what the drm winsys does.

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
src/gallium/winsys/virgl/vtest/virgl_vtest_winsys.h
src/gallium/winsys/virgl/vtest/vtest_protocol.h

index 687f4f3052825167177fe6a6fecadf8fac776ace..7d6761410706bce3812939d8dea534fad89579fe 100644 (file)
@@ -559,6 +559,14 @@ static struct virgl_cmd_buf *virgl_vtest_cmd_buf_create(struct virgl_winsys *vws
       FREE(cbuf);
       return NULL;
    }
+
+   cbuf->buf = CALLOC(size, sizeof(uint32_t));
+   if (!cbuf->buf) {
+      FREE(cbuf->res_bo);
+      FREE(cbuf);
+      return NULL;
+   }
+
    cbuf->ws = vws;
    cbuf->base.buf = cbuf->buf;
    return &cbuf->base;
@@ -570,6 +578,7 @@ static void virgl_vtest_cmd_buf_destroy(struct virgl_cmd_buf *_cbuf)
 
    virgl_vtest_release_all_res(virgl_vtest_winsys(cbuf->ws), cbuf);
    FREE(cbuf->res_bo);
+   FREE(cbuf->buf);
    FREE(cbuf);
 }
 
@@ -760,7 +769,7 @@ virgl_vtest_winsys_wrap(struct sw_winsys *sws)
    vtws->base.fence_wait = virgl_fence_wait;
    vtws->base.fence_reference = virgl_fence_reference;
    vtws->base.supports_fences =  0;
-   vtws->base.supports_encoded_transfers = 0;
+   vtws->base.supports_encoded_transfers = (vtws->protocol_version >= 2);
 
    vtws->base.flush_frontbuffer = virgl_vtest_flush_frontbuffer;
 
index f5d8eb26e7cfc21745bd36d16e827f8ef72326a1..c6b1589d7dbfba0035e8e1dc76ce0588851e9127 100644 (file)
@@ -77,7 +77,7 @@ struct virgl_hw_res {
 
 struct virgl_vtest_cmd_buf {
    struct virgl_cmd_buf base;
-   uint32_t buf[VIRGL_MAX_CMDBUF_DWORDS];
+   uint32_t *buf;
    unsigned nres;
    unsigned cres;
    struct virgl_winsys *ws;
index 9b39020c0ae632a9f0a66cf0cf7f81b64b28f0d7..9360213ac45770b728b3330dd4323d799bc3d2d9 100644 (file)
@@ -24,7 +24,7 @@
 #define VTEST_PROTOCOL
 
 #define VTEST_DEFAULT_SOCKET_NAME "/tmp/.virgl_test"
-#define VTEST_PROTOCOL_VERSION 0
+#define VTEST_PROTOCOL_VERSION 2
 
 /* 32-bit length field */
 /* 32-bit cmd field */