Skip to content

Commit

Permalink
virtio-gpu: add the ability to export resources
Browse files Browse the repository at this point in the history
Fixes: #76
Signed-off-by: David Stevens <stevensd@chromium.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
David Stevens authored and mstsirkin committed Sep 1, 2020
1 parent 68f66ff commit 162578b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions virtio-gpu.tex
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ \subsection{Feature bits}\label{sec:Device Types / GPU Device / Feature bits}
\begin{description}
\item[VIRTIO_GPU_F_VIRGL (0)] virgl 3D mode is supported.
\item[VIRTIO_GPU_F_EDID (1)] EDID is supported.
\item[VIRTIO_GPU_F_RESOURCE_UUID (2)] assigning resources UUIDs for export
to other virtio devices is supported.
\end{description}

\subsection{Device configuration layout}\label{sec:Device Types / GPU Device / Device configuration layout}
Expand Down Expand Up @@ -186,6 +188,7 @@ \subsubsection{Device Operation: Request header}\label{sec:Device Types / GPU De
VIRTIO_GPU_CMD_GET_CAPSET_INFO,
VIRTIO_GPU_CMD_GET_CAPSET,
VIRTIO_GPU_CMD_GET_EDID,
VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID,

/* 3d commands (OpenGL) */
VIRTIO_GPU_CMD_CTX_CREATE = 0x0200,
Expand All @@ -207,6 +210,7 @@ \subsubsection{Device Operation: Request header}\label{sec:Device Types / GPU De
VIRTIO_GPU_RESP_OK_CAPSET_INFO,
VIRTIO_GPU_RESP_OK_CAPSET,
VIRTIO_GPU_RESP_OK_EDID,
VIRTIO_GPU_RESP_OK_RESOURCE_UUID,

/* error responses */
VIRTIO_GPU_RESP_ERR_UNSPEC = 0x1200,
Expand Down Expand Up @@ -469,6 +473,32 @@ \subsubsection{Device Operation: controlq}\label{sec:Device Types / GPU Device /
This detaches any backing pages from a resource, to be used in case of
guest swapping or object destruction.

\item[VIRTIO_GPU_CMD_RESOURCE_ASSIGN_UUID] Creates an exported object from
a resource. Request data is \field{struct
virtio_gpu_resource_assign_uuid}. Response type is
VIRTIO_GPU_RESP_OK_RESOURCE_UUID, response data is \field{struct
virtio_gpu_resp_resource_uuid}. Support is optional and negotiated
using the VIRTIO_GPU_F_RESOURCE_UUID feature flag.

\begin{lstlisting}
struct virtio_gpu_resource_assign_uuid {
struct virtio_gpu_ctrl_hdr hdr;
le32 resource_id;
le32 padding;
};

struct virtio_gpu_resp_resource_uuid {
struct virtio_gpu_ctrl_hdr hdr;
u8 uuid[16];
};
\end{lstlisting}

The response contains a UUID which identifies the exported object created from
the host private resource. Note that if the resource has an attached backing,
modifications made to the host private resource through the exported object by
other devices are not visible in the attached backing until they are transferred
into the backing.

\end{description}

\subsubsection{Device Operation: controlq (3d)}\label{sec:Device Types / GPU Device / Device Operation / Device Operation: controlq (3d)}
Expand Down

0 comments on commit 162578b

Please sign in to comment.