]>
git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/VirtioGpuDxe/VirtioGpu.h
97767dba709f9e9eef43221207ef7d72921deba2
3 Internal type and macro definitions for the Virtio GPU hybrid driver.
5 Copyright (C) 2016, Red Hat, Inc.
7 This program and the accompanying materials are licensed and made available
8 under the terms and conditions of the BSD License which accompanies this
9 distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
13 WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #ifndef _VIRTIO_GPU_DXE_H_
18 #define _VIRTIO_GPU_DXE_H_
20 #include <Library/DebugLib.h>
21 #include <Library/UefiLib.h>
22 #include <Protocol/VirtioDevice.h>
25 // Forward declaration of VGPU_GOP.
27 typedef struct VGPU_GOP_STRUCT VGPU_GOP
;
30 // The abstraction that directly corresponds to a Virtio GPU device.
32 // This structure will be installed on the handle that has the VirtIo Device
33 // Protocol interface, with GUID gEfiCallerIdGuid. A similar trick is employed
34 // in TerminalDxe, and it is necessary so that we can look up VGPU_DEV just
35 // from the VirtIo Device Protocol handle in the Component Name 2 Protocol
40 // VirtIo represents access to the Virtio GPU device. Never NULL.
42 VIRTIO_DEVICE_PROTOCOL
*VirtIo
;
45 // BusName carries a customized name for
46 // EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName(). It is expressed in table
47 // form because it can theoretically support several languages. Never NULL.
49 EFI_UNICODE_STRING_TABLE
*BusName
;
52 // VirtIo ring used for VirtIo communication.
57 // Event to be signaled at ExitBootServices().
62 // The Child field references the GOP wrapper structure. If this pointer is
63 // NULL, then the hybrid driver has bound (i.e., started) the
64 // VIRTIO_DEVICE_PROTOCOL controller without producing the child GOP
65 // controller (that is, after Start() was called with RemainingDevicePath
66 // pointing to and End of Device Path node). Child can be created and
67 // destroyed, even repeatedly, independently of VGPU_DEV.
69 // In practice, this field represents the single head (scanout) that we
76 // The Graphics Output Protocol wrapper structure.
78 #define VGPU_GOP_SIG SIGNATURE_64 ('V', 'G', 'P', 'U', '_', 'G', 'O', 'P')
80 struct VGPU_GOP_STRUCT
{
84 // ParentBus points to the parent VGPU_DEV object. Never NULL.
89 // GopName carries a customized name for
90 // EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName(). It is expressed in table
91 // form because it can theoretically support several languages. Never NULL.
93 EFI_UNICODE_STRING_TABLE
*GopName
;
96 // GopHandle is the UEFI child handle that carries the device path ending
97 // with the ACPI ADR node, and the Graphics Output Protocol. Never NULL.
102 // The GopDevicePath field is the device path installed on GopHandle,
103 // ending with an ACPI ADR node. Never NULL.
105 EFI_DEVICE_PATH_PROTOCOL
*GopDevicePath
;
108 // The Gop field is installed on the child handle as Graphics Output Protocol
111 // For now it is just a placeholder.
117 // VirtIo GPU initialization, and commands (primitives) for the GPU device.
120 Configure the VirtIo GPU device that underlies VgpuDev.
122 @param[in,out] VgpuDev The VGPU_DEV object to set up VirtIo messaging for.
123 On input, the caller is responsible for having
124 initialized VgpuDev->VirtIo. On output, VgpuDev->Ring
125 has been initialized, and synchronous VirtIo GPU
126 commands (primitives) can be submitted to the device.
128 @retval EFI_SUCCESS VirtIo GPU configuration successful.
130 @retval EFI_UNSUPPORTED The host-side configuration of the VirtIo GPU is not
131 supported by this driver.
133 @retval Error codes from underlying functions.
137 IN OUT VGPU_DEV
*VgpuDev
141 De-configure the VirtIo GPU device that underlies VgpuDev.
143 @param[in,out] VgpuDev The VGPU_DEV object to tear down VirtIo messaging
144 for. On input, the caller is responsible for having
145 called VirtioGpuInit(). On output, VgpuDev->Ring has
146 been uninitialized; VirtIo GPU commands (primitives)
147 can no longer be submitted to the device.
151 IN OUT VGPU_DEV
*VgpuDev
155 EFI_EVENT_NOTIFY function for the VGPU_DEV.ExitBoot event. It resets the
156 VirtIo device, causing it to release its resources and to forget its
159 This function may only be called (that is, VGPU_DEV.ExitBoot may only be
160 signaled) after VirtioGpuInit() returns and before VirtioGpuUninit() is
163 @param[in] Event Event whose notification function is being invoked.
165 @param[in] Context Pointer to the associated VGPU_DEV object.
174 #endif // _VIRTIO_GPU_DXE_H_