Mesa (master): virgl: add protocol for resource transfers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 15 10:40:17 UTC 2019


Module: Mesa
Branch: master
Commit: 0fcd48bac51f344b805e9cdc32156b0a8efdbba0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0fcd48bac51f344b805e9cdc32156b0a8efdbba0

Author: Gurchetan Singh <gurchetansingh at chromium.org>
Date:   Mon Nov 19 10:28:26 2018 -0800

virgl: add protocol for resource transfers

Mostly similar to VIRGL_CCMD_RESOURCE_INLINE_WRITE.  However, this
uses the resource's already attached iovecs rather than the command
buffer to transfer the data.

v2: Used (1 << 16) not (1 << 15) [@gerddie]
Reviewed-by: Gert Wollny <gert.wollny at collabora.com>

---

 src/gallium/drivers/virgl/virgl_hw.h       |  1 +
 src/gallium/drivers/virgl/virgl_protocol.h | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h
index 8759e577077..fec9ce857d7 100644
--- a/src/gallium/drivers/virgl/virgl_hw.h
+++ b/src/gallium/drivers/virgl/virgl_hw.h
@@ -234,6 +234,7 @@ enum virgl_formats {
 #define VIRGL_CAP_GUEST_MAY_INIT_LOG   (1 << 14)
 #define VIRGL_CAP_SRGB_WRITE_CONTROL   (1 << 15)
 #define VIRGL_CAP_QBO                  (1 << 16)
+#define VIRGL_CAP_TRANSFER             (1 << 17)
 
 /* virgl bind flags - these are compatible with mesa 10.5 gallium.
  * but are fixed, no other should be passed to virgl either.
diff --git a/src/gallium/drivers/virgl/virgl_protocol.h b/src/gallium/drivers/virgl/virgl_protocol.h
index 57333553d77..62b28bd5d00 100644
--- a/src/gallium/drivers/virgl/virgl_protocol.h
+++ b/src/gallium/drivers/virgl/virgl_protocol.h
@@ -94,6 +94,8 @@ enum virgl_context_cmd {
    VIRGL_CCMD_SET_ATOMIC_BUFFERS,
    VIRGL_CCMD_SET_DEBUG_FLAGS,
    VIRGL_CCMD_GET_QUERY_RESULT_QBO,
+   VIRGL_CCMD_TRANSFER3D,
+   VIRGL_CCMD_END_TRANSFERS,
 };
 
 /*
@@ -565,4 +567,13 @@ enum virgl_context_cmd {
 #define VIRGL_QUERY_RESULT_QBO_OFFSET 5
 #define VIRGL_QUERY_RESULT_QBO_INDEX 6
 
+#define VIRGL_TRANSFER_TO_HOST   1
+#define VIRGL_TRANSFER_FROM_HOST 2
+
+/* Transfer */
+#define VIRGL_TRANSFER3D_SIZE 13
+/* The first 11 dwords are the same as VIRGL_RESOURCE_IW_*  */
+#define VIRGL_TRANSFER3D_DATA_OFFSET 12
+#define VIRGL_TRANSFER3D_DIRECTION 13
+
 #endif




More information about the mesa-commit mailing list