]> git.proxmox.com Git - mirror_edk2.git/blob - OvmfPkg/VirtioGpuDxe/VirtioGpu.h
OvmfPkg/VirtioGpuDxe: introduce with Component Name 2 and Driver Binding
[mirror_edk2.git] / OvmfPkg / VirtioGpuDxe / VirtioGpu.h
1 /** @file
2
3 Internal type and macro definitions for the Virtio GPU hybrid driver.
4
5 Copyright (C) 2016, Red Hat, Inc.
6
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
11
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.
14
15 **/
16
17 #ifndef _VIRTIO_GPU_DXE_H_
18 #define _VIRTIO_GPU_DXE_H_
19
20 #include <Library/DebugLib.h>
21 #include <Library/UefiLib.h>
22 #include <Protocol/VirtioDevice.h>
23
24 //
25 // Forward declaration of VGPU_GOP.
26 //
27 typedef struct VGPU_GOP_STRUCT VGPU_GOP;
28
29 //
30 // The abstraction that directly corresponds to a Virtio GPU device.
31 //
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
36 // implementation.
37 //
38 typedef struct {
39 //
40 // VirtIo represents access to the Virtio GPU device. Never NULL.
41 //
42 VIRTIO_DEVICE_PROTOCOL *VirtIo;
43
44 //
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.
48 //
49 EFI_UNICODE_STRING_TABLE *BusName;
50
51 //
52 // The Child field references the GOP wrapper structure. If this pointer is
53 // NULL, then the hybrid driver has bound (i.e., started) the
54 // VIRTIO_DEVICE_PROTOCOL controller without producing the child GOP
55 // controller (that is, after Start() was called with RemainingDevicePath
56 // pointing to and End of Device Path node). Child can be created and
57 // destroyed, even repeatedly, independently of VGPU_DEV.
58 //
59 // In practice, this field represents the single head (scanout) that we
60 // support.
61 //
62 VGPU_GOP *Child;
63 } VGPU_DEV;
64
65 //
66 // The Graphics Output Protocol wrapper structure.
67 //
68 #define VGPU_GOP_SIG SIGNATURE_64 ('V', 'G', 'P', 'U', '_', 'G', 'O', 'P')
69
70 struct VGPU_GOP_STRUCT {
71 UINT64 Signature;
72
73 //
74 // ParentBus points to the parent VGPU_DEV object. Never NULL.
75 //
76 VGPU_DEV *ParentBus;
77
78 //
79 // GopName carries a customized name for
80 // EFI_COMPONENT_NAME2_PROTOCOL.GetControllerName(). It is expressed in table
81 // form because it can theoretically support several languages. Never NULL.
82 //
83 EFI_UNICODE_STRING_TABLE *GopName;
84
85 //
86 // GopHandle is the UEFI child handle that carries the device path ending
87 // with the ACPI ADR node, and the Graphics Output Protocol. Never NULL.
88 //
89 EFI_HANDLE GopHandle;
90
91 //
92 // The GopDevicePath field is the device path installed on GopHandle,
93 // ending with an ACPI ADR node. Never NULL.
94 //
95 EFI_DEVICE_PATH_PROTOCOL *GopDevicePath;
96
97 //
98 // The Gop field is installed on the child handle as Graphics Output Protocol
99 // interface.
100 //
101 // For now it is just a placeholder.
102 //
103 UINT8 Gop;
104 };
105
106 #endif // _VIRTIO_GPU_DXE_H_