summaryrefslogtreecommitdiff
path: root/include/uapi
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2020-04-16 11:56:27 -0700
committerAlistair Delva <adelva@google.com>2020-04-17 15:31:01 -0700
commit8c6da983ea97c2d9ee39205e4e6541928b5b53e1 (patch)
tree56b34b9131f94a1984139e3bc223763c029ec752 /include/uapi
parentc2d015d2d8a6e1575369f4cf3de867bceef6e2d4 (diff)
CHROMIUM: virtio-gpu: add VIRTIO_GPU_F_RESOURCE_UUID feature
This feature allows the guest to request a UUID from the host for a particular virtio_gpu resource. The UUID can then be shared with other virtio devices, to allow the other host devices to access the virtio_gpu's corresponding host resource. Signed-off-by: David Stevens <stevensd@chromium.org> (am from https://patchwork.kernel.org/patch/11431391/) Fixes: - Renumber out-of-tree virtio_gpu resource v2 feature bits. Although that is technically a breaking change with respect to crosvm, all usage of the bits is currently hidden behind flags which aren't enabled outside of local builds. BUG=b:136269340 TEST=boot ARCVM and launch play store Signed-off-by: Keiichi Watanabe <keiichiw@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2090952 Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Bug: 153580313 Signed-off-by: Lingfeng Yang <lfy@google.com> Change-Id: Ie48129c56b521ded1d33c4b4d3ea6ae05104447d
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/virtio_gpu.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h
index f483dff166e3..3c3bb3342b7b 100644
--- a/include/uapi/linux/virtio_gpu.h
+++ b/include/uapi/linux/virtio_gpu.h
@@ -50,20 +50,24 @@
* VIRTIO_GPU_CMD_GET_EDID
*/
#define VIRTIO_GPU_F_EDID 1
+/*
+ * VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID
+ */
+#define VIRTIO_GPU_F_RESOURCE_UUID 2
/*
* VIRTIO_GPU_CMD_ALLOCATION_METADATA
* VIRTIO_GPU_CMD_RESOURCE_CREATE_V2
*/
-#define VIRTIO_GPU_F_RESOURCE_V2 2
+#define VIRTIO_GPU_F_RESOURCE_V2 3
/*
* Ability to turn guest pages into host buffers.
*/
-#define VIRTIO_GPU_F_SHARED_GUEST 3
+#define VIRTIO_GPU_F_SHARED_GUEST 4
/*
* Can inject host pages into guest.
*/
-#define VIRTIO_GPU_F_HOST_COHERENT 4
+#define VIRTIO_GPU_F_HOST_COHERENT 5
enum virtio_gpu_ctrl_type {
VIRTIO_GPU_UNDEFINED = 0,
@@ -79,6 +83,7 @@ enum virtio_gpu_ctrl_type {
VIRTIO_GPU_CMD_GET_CAPSET_INFO,
VIRTIO_GPU_CMD_GET_CAPSET,
VIRTIO_GPU_CMD_GET_EDID,
+ VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID,
/* 3d commands */
VIRTIO_GPU_CMD_CTX_CREATE = 0x0200,
@@ -103,6 +108,7 @@ enum virtio_gpu_ctrl_type {
VIRTIO_GPU_RESP_OK_CAPSET_INFO,
VIRTIO_GPU_RESP_OK_CAPSET,
VIRTIO_GPU_RESP_OK_EDID,
+ VIRTIO_GPU_RESP_OK_RESOURCE_UUID,
/* CHROMIUM: legacy responses */
VIRTIO_GPU_RESP_OK_RESOURCE_PLANE_INFO_LEGACY = 0x1104,
@@ -441,4 +447,17 @@ enum virtio_gpu_formats {
VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM = 134,
};
+/* VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID */
+struct virtio_gpu_resource_assign_uuid {
+ struct virtio_gpu_ctrl_hdr hdr;
+ __le32 resource_id;
+ __le32 padding;
+};
+
+/* VIRTIO_GPU_RESP_OK_RESOURCE_UUID */
+struct virtio_gpu_resp_resource_uuid {
+ struct virtio_gpu_ctrl_hdr hdr;
+ __u8 uuid[16];
+};
+
#endif