Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

3.2 Network Device

...


3.3 GPU Device

The virtio-gpu is a virtio based graphics adapter. It can operate in 2D mode and in 3D (virgl) mode. The device architecture is based around the concept of resources private to the host, the guest must DMA transfer into these resources. This is a design requirement in order to interface with 3D rendering.


3.3.1 GPU Device in 2D Mode

In the unaccelerated 2D mode there is no support for DMA transfers from resources, just to them. Resources are initially simple 2D resources, consisting of a width, height and format along with an identifier. The guest must then attach backing store to the resources in order for DMA transfers to work.


(lightbulb) REQ-1:   Requirement according to chapter  The device ID MUST be set according to the requirement in chapter 5.7.1 in [VIRTIO-GPU].

(lightbulb) REQ-2:   Requirement according to chapter  The virtqueues MUST be set up according to the requirement in chapter 5.7.2 in [VIRTIO-GPU].

(lightbulb) REQ-3:   The VIRTIO_GPU_F_VIRGL flag, described in chapter 5.7.3 in [VIRTIO-GPU], SHALL NOT be set.

(lightbulb) REQ-4:   Requirement according    The implementation MUST use the device configuration layout according to chapter 5.7.4 in [VIRTIO-GPU].

(lightbulb)      REQ-4.1: The implementation SHALL NOT touch the reserved structure field as it is used for the 3D mode.

(lightbulb) REQ-5:   Requirement    The implementation MUST suport the device operation conceprt (the command set and the operation flow) according to chapter 5.7.6 in [VIRTIO-GPU].

(lightbulb)      REQ-5.1: The implementation MUST support scatter-gather operations to fulfil the requirement in chapter 5.7.6.1 in [VIRTIO-GPU].

(lightbulb)      REQ-5.2: The implementation MUST be capable  to perform DMA operations to client's attached resources to fulfil the requirement in chapter 5.7.6.1 in [VIRTIO-GPU].

(lightbulb) REQ-6:   Requirement VGA compatibility, as described in chapter 5.7.7 in [VIRTIO-GPU], is optional.

...

3.3.2 GPU Device in 3D Mode

3D mode will offload rendering ops to the host gpu and therefore requires a gpu with 3D support on the host machine. The guest side requires additional software in order to convert OpenGL commands to the raw graphics stack state (Gallium state) and channel them through virtio-gpu to the host. Currently the 'mesa' library is used for this purpose. The backend then receives the raw graphics stack state and interprets it using the virglrenderer library from the raw state into an OpenGL form, which can be executed as entirely normal OpenGL on the host machine. The host also translates shaders from the TGSI format used by Gallium into the GLSL format used by OpenGL.


(lightbulb) REQ-1:   Requirement according to chapter  The device ID MUST be set according to the requirement in chapter 5.7.1 in [VIRTIO-GPU].

(lightbulb) REQ-2:   Requirement according to chapter  The virtqueues MUST be set up according to the requirement in chapter 5.7.2 in [VIRTIO-GPU].

(lightbulb) REQ-3:   The  implementation MUST set the VIRTIO_GPU_F_VIRGL flag, described in chapter 5.7.3 in [VIRTIO-GPU].

(lightbulb) REQ-4:   Requirement according    The implementation MUST use the device configuration layout according to chapter 5.7.4 in [VIRTIO-GPU].

(lightbulb)      REQ-4.1: The implementation MUST use the previously reserved config structure field to report the number of capsets supported by the virglrenderer library.

(lightbulb)            REQ-4.1.1: The implementation SHALL NOT report the value of '0' as it is treated as absence of 3D support.

(lightbulb) REQ-5:   Requirement  The implementation MUST suport the device operation conceprt (the command set and the operation flow) according to chapter 5.7.6 in [VIRTIO-GPU].

(lightbulb)      REQ-5.1: The implementation MUST support scatter-gather operations to fulfil the requirement in chapter 5.7.6.1 in [VIRTIO-GPU].

...

(lightbulb)      REQ-5.6: The implementation MUST be capable  to perform DMA operations to and from client's attached resources to fulfil the requirement in chapter 5.7.6.1 in [VIRTIO-GPU] and in 'Virtio-GPU | Virgl3D commands' in [VIRTIO-VIRGL].

(lightbulb) REQ-6:   Requirement VGA compatibility, as described in chapter 5.7.7 in [VIRTIO-GPU], is optional.

(lightbulb) REQ-7:  In addition to the command set and features, defined in [VIRTIO-GPU] and [VIRTIO-VIRGL], the implementation MAY provide:

...