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