]>
Commit | Line | Data |
---|---|---|
842f5579 | 1 | /** @file\r |
8a7d75b0 | 2 | UGA IO protocol from the EFI 1.10 specification.\r |
d1f95000 | 3 | \r |
4 | Abstraction of a very simple graphics device.\r | |
842f5579 | 5 | \r |
4ca9b6c4 | 6 | Copyright (c) 2006 - 2008, Intel Corporation \r |
842f5579 A |
7 | All rights reserved. This program and the accompanying materials \r |
8 | are licensed and made available under the terms and conditions of the BSD License \r | |
9 | which accompanies this distribution. The full text of the license may be found at \r | |
10 | http://opensource.org/licenses/bsd-license.php \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
d1f95000 | 14 | \r |
842f5579 | 15 | **/\r |
d1f95000 | 16 | \r |
17 | #ifndef __UGA_IO_H__\r | |
18 | #define __UGA_IO_H__\r | |
19 | \r | |
20 | #define EFI_UGA_IO_PROTOCOL_GUID \\r | |
842f5579 | 21 | { 0x61a4d49e, 0x6f68, 0x4f1b, { 0xb9, 0x22, 0xa8, 0x6e, 0xed, 0xb, 0x7, 0xa2 } }\r |
d1f95000 | 22 | \r |
23 | typedef struct _EFI_UGA_IO_PROTOCOL EFI_UGA_IO_PROTOCOL;\r | |
24 | \r | |
25 | typedef UINT32 UGA_STATUS;\r | |
26 | \r | |
27 | typedef enum {\r | |
28 | UgaDtParentBus = 1,\r | |
29 | UgaDtGraphicsController,\r | |
30 | UgaDtOutputController,\r | |
31 | UgaDtOutputPort,\r | |
32 | UgaDtOther\r | |
33 | }\r | |
34 | UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;\r | |
35 | \r | |
36 | typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;\r | |
37 | \r | |
38 | typedef struct {\r | |
39 | UGA_DEVICE_TYPE deviceType;\r | |
40 | UGA_DEVICE_ID deviceId;\r | |
41 | UINT32 ui32DeviceContextSize;\r | |
42 | UINT32 ui32SharedContextSize;\r | |
43 | }\r | |
44 | UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;\r | |
45 | \r | |
46 | typedef struct _UGA_DEVICE {\r | |
47 | VOID *pvDeviceContext;\r | |
48 | VOID *pvSharedContext;\r | |
49 | VOID *pvRunTimeContext;\r | |
50 | struct _UGA_DEVICE *pParentDevice;\r | |
51 | VOID *pvBusIoServices;\r | |
52 | VOID *pvStdIoServices;\r | |
53 | UGA_DEVICE_DATA deviceData;\r | |
54 | }\r | |
55 | UGA_DEVICE, *PUGA_DEVICE;\r | |
56 | \r | |
d1f95000 | 57 | typedef enum {\r |
58 | UgaIoGetVersion = 1,\r | |
59 | UgaIoGetChildDevice,\r | |
60 | UgaIoStartDevice,\r | |
61 | UgaIoStopDevice,\r | |
62 | UgaIoFlushDevice,\r | |
63 | UgaIoResetDevice,\r | |
64 | UgaIoGetDeviceState,\r | |
65 | UgaIoSetDeviceState,\r | |
66 | UgaIoSetPowerState,\r | |
67 | UgaIoGetMemoryConfiguration,\r | |
68 | UgaIoSetVideoMode,\r | |
69 | UgaIoCopyRectangle,\r | |
70 | UgaIoGetEdidSegment,\r | |
71 | UgaIoDeviceChannelOpen,\r | |
72 | UgaIoDeviceChannelClose,\r | |
73 | UgaIoDeviceChannelRead,\r | |
74 | UgaIoDeviceChannelWrite,\r | |
75 | UgaIoGetPersistentDataSize,\r | |
76 | UgaIoGetPersistentData,\r | |
77 | UgaIoSetPersistentData,\r | |
78 | UgaIoGetDevicePropertySize,\r | |
79 | UgaIoGetDeviceProperty,\r | |
80 | UgaIoBtPrivateInterface\r | |
81 | }\r | |
82 | UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r | |
83 | \r | |
d1f95000 | 84 | typedef struct {\r |
85 | IN UGA_IO_REQUEST_CODE ioRequestCode;\r | |
86 | IN VOID *pvInBuffer;\r | |
87 | IN UINT64 ui64InBufferSize;\r | |
88 | OUT VOID *pvOutBuffer;\r | |
89 | IN UINT64 ui64OutBufferSize;\r | |
90 | OUT UINT64 ui64BytesReturned;\r | |
bf231ea6 A |
91 | } UGA_IO_REQUEST, *PUGA_IO_REQUEST;\r |
92 | \r | |
93 | \r | |
94 | /** | |
95 | Dynamically allocate storage for a child UGA_DEVICE .\r | |
96 | ||
97 | @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r | |
98 | defined in Section 10.7. | |
99 | @param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device. | |
100 | @param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()\r | |
101 | with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice. | |
102 | @param[in] RunTimeContext Context to associate with Device. | |
103 | @param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object\r | |
104 | for ParentDevice. The caller is responsible for deleting Device. | |
105 | ||
106 | \r | |
107 | @retval EFI_SUCCESS Device was returned.\r | |
108 | @retval EFI_INVALID_PARAMETER One of the arguments was not valid.\r | |
109 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
d1f95000 | 110 | \r |
bf231ea6 | 111 | **/\r |
d1f95000 | 112 | typedef\r |
113 | EFI_STATUS\r | |
8b13229b | 114 | (EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(\r |
bf231ea6 A |
115 | IN EFI_UGA_IO_PROTOCOL *This,\r |
116 | IN UGA_DEVICE *ParentDevice,\r | |
117 | IN UGA_DEVICE_DATA *DeviceData,\r | |
d1f95000 | 118 | IN VOID *RunTimeContext,\r |
119 | OUT UGA_DEVICE **Device\r | |
120 | );\r | |
121 | \r | |
d1f95000 | 122 | \r |
bf231ea6 A |
123 | /** |
124 | Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice() .\r | |
125 | ||
126 | @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r | |
127 | defined in Section 10.7. | |
128 | @param[in] Device The Device points to a UGA_DEVICE object that was dynamically\r | |
129 | allocated via a CreateDevice() call.\r | |
130 | ||
131 | \r | |
132 | @retval EFI_SUCCESS Device was returned.\r | |
133 | @retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().\r | |
d1f95000 | 134 | \r |
bf231ea6 | 135 | **/\r |
d1f95000 | 136 | typedef\r |
137 | EFI_STATUS\r | |
8b13229b | 138 | (EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(\r |
d1f95000 | 139 | IN EFI_UGA_IO_PROTOCOL * This,\r |
140 | IN UGA_DEVICE * Device\r | |
141 | );\r | |
142 | \r | |
bf231ea6 | 143 | /**\r |
19bee90c | 144 | This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r |
d1f95000 | 145 | \r |
19bee90c | 146 | @param pDevice pDevice specifies a pointer to a device object associated with a \r |
d1f95000 | 147 | device enumerated by a pIoRequest->ioRequestCode of type \r |
148 | UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r | |
149 | is represented by pDevice being set to NULL.\r | |
150 | \r | |
19bee90c LG |
151 | @param pIoRequest \r |
152 | pIoRequest points to a caller allocated buffer that contains data\r | |
d1f95000 | 153 | defined by pIoRequest->ioRequestCode. See Related Definitions for\r |
154 | a definition of UGA_IO_REQUEST_CODE s and their associated data \r | |
155 | structures.\r | |
156 | \r | |
19bee90c | 157 | @return UGA_STATUS\r |
d1f95000 | 158 | \r |
bf231ea6 | 159 | **/\r |
19bee90c LG |
160 | typedef UGA_STATUS \r |
161 | (EFIAPI *PUGA_FW_SERVICE_DISPATCH)(\r | |
162 | IN PUGA_DEVICE pDevice, \r | |
163 | IN OUT PUGA_IO_REQUEST pIoRequest\r | |
164 | );\r | |
165 | \r | |
4ca9b6c4 LG |
166 | /** \r |
167 | @par Protocol Description:\r | |
168 | Provides a basic abstraction to send I/O requests to the graphics device and any of its children.\r | |
19bee90c | 169 | \r |
4ca9b6c4 LG |
170 | @param CreateDevice \r |
171 | Create a UGA_DEVICE object for a child device of a given parent UGA_DEVICE.\r | |
172 | \r | |
173 | @param DeleteDevice \r | |
174 | Delete the UGA_DEVICE returned from CreateDevice().\r | |
175 | \r | |
176 | @param DispatchService \r | |
177 | Dispatches I/O requests to the display device and its associate child devices.\r | |
178 | **/\r | |
d1f95000 | 179 | struct _EFI_UGA_IO_PROTOCOL {\r |
180 | EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r | |
181 | EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r | |
182 | PUGA_FW_SERVICE_DISPATCH DispatchService;\r | |
183 | };\r | |
184 | \r | |
185 | extern EFI_GUID gEfiUgaIoProtocolGuid;\r | |
186 | \r | |
187 | //\r | |
188 | // Data structure that is stored in the EFI Configuration Table with the\r | |
189 | // EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have\r | |
190 | // EBC UGA drivers.\r | |
191 | //\r | |
192 | typedef struct {\r | |
193 | UINT32 Version;\r | |
194 | UINT32 HeaderSize;\r | |
195 | UINT32 SizeOfEntries;\r | |
196 | UINT32 NumberOfEntries;\r | |
197 | } EFI_DRIVER_OS_HANDOFF_HEADER;\r | |
198 | \r | |
199 | typedef enum {\r | |
200 | EfiUgaDriverFromPciRom,\r | |
201 | EfiUgaDriverFromSystem,\r | |
202 | EfiDriverHandoffMax\r | |
203 | } EFI_DRIVER_HANOFF_ENUM;\r | |
204 | \r | |
205 | typedef struct {\r | |
206 | EFI_DRIVER_HANOFF_ENUM Type;\r | |
207 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
208 | VOID *PciRomImage;\r | |
209 | UINT64 PciRomSize;\r | |
210 | } EFI_DRIVER_OS_HANDOFF;\r | |
211 | \r | |
212 | #endif\r |