Commit 592d9fba authored by David Stevens's avatar David Stevens Committed by Gerd Hoffmann

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: default avatarDavid Stevens <stevensd@chromium.org>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20200818071343.3461203-3-stevensd@chromium.orgSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent a0308938
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
* VIRTIO_GPU_CMD_GET_EDID * VIRTIO_GPU_CMD_GET_EDID
*/ */
#define VIRTIO_GPU_F_EDID 1 #define VIRTIO_GPU_F_EDID 1
/*
* VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID
*/
#define VIRTIO_GPU_F_RESOURCE_UUID 2
enum virtio_gpu_ctrl_type { enum virtio_gpu_ctrl_type {
VIRTIO_GPU_UNDEFINED = 0, VIRTIO_GPU_UNDEFINED = 0,
...@@ -66,6 +70,7 @@ enum virtio_gpu_ctrl_type { ...@@ -66,6 +70,7 @@ enum virtio_gpu_ctrl_type {
VIRTIO_GPU_CMD_GET_CAPSET_INFO, VIRTIO_GPU_CMD_GET_CAPSET_INFO,
VIRTIO_GPU_CMD_GET_CAPSET, VIRTIO_GPU_CMD_GET_CAPSET,
VIRTIO_GPU_CMD_GET_EDID, VIRTIO_GPU_CMD_GET_EDID,
VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID,
/* 3d commands */ /* 3d commands */
VIRTIO_GPU_CMD_CTX_CREATE = 0x0200, VIRTIO_GPU_CMD_CTX_CREATE = 0x0200,
...@@ -87,6 +92,7 @@ enum virtio_gpu_ctrl_type { ...@@ -87,6 +92,7 @@ enum virtio_gpu_ctrl_type {
VIRTIO_GPU_RESP_OK_CAPSET_INFO, VIRTIO_GPU_RESP_OK_CAPSET_INFO,
VIRTIO_GPU_RESP_OK_CAPSET, VIRTIO_GPU_RESP_OK_CAPSET,
VIRTIO_GPU_RESP_OK_EDID, VIRTIO_GPU_RESP_OK_EDID,
VIRTIO_GPU_RESP_OK_RESOURCE_UUID,
/* error responses */ /* error responses */
VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200, VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200,
...@@ -340,4 +346,17 @@ enum virtio_gpu_formats { ...@@ -340,4 +346,17 @@ enum virtio_gpu_formats {
VIRTIO_GPU_FORMAT_R8G8B8X8_UNORM = 134, 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 #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment