]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UgaIo.h
Fixed comments to follow coding standard.
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaIo.h
CommitLineData
842f5579 1/** @file\r
d1f95000 2 UGA IO protocol from the EFI 1.1 specification.\r
3\r
4 Abstraction of a very simple graphics device.\r
842f5579
A
5 \r
6 Copyright (c) 2006 - 2007, Intel Corporation\r
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
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}\r
34UGA_DEVICE_TYPE, *PUGA_DEVICE_TYPE;\r
35\r
36typedef UINT32 UGA_DEVICE_ID, *PUGA_DEVICE_ID;\r
37\r
38typedef struct {\r
39 UGA_DEVICE_TYPE deviceType;\r
40 UGA_DEVICE_ID deviceId;\r
41 UINT32 ui32DeviceContextSize;\r
42 UINT32 ui32SharedContextSize;\r
43}\r
44UGA_DEVICE_DATA, *PUGA_DEVICE_DATA;\r
45\r
46typedef 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
55UGA_DEVICE, *PUGA_DEVICE;\r
56\r
57#ifndef UGA_IO_REQUEST_CODE\r
58//\r
59// Prevent conflicts with UGA typedefs.\r
60//\r
61typedef enum {\r
62 UgaIoGetVersion = 1,\r
63 UgaIoGetChildDevice,\r
64 UgaIoStartDevice,\r
65 UgaIoStopDevice,\r
66 UgaIoFlushDevice,\r
67 UgaIoResetDevice,\r
68 UgaIoGetDeviceState,\r
69 UgaIoSetDeviceState,\r
70 UgaIoSetPowerState,\r
71 UgaIoGetMemoryConfiguration,\r
72 UgaIoSetVideoMode,\r
73 UgaIoCopyRectangle,\r
74 UgaIoGetEdidSegment,\r
75 UgaIoDeviceChannelOpen,\r
76 UgaIoDeviceChannelClose,\r
77 UgaIoDeviceChannelRead,\r
78 UgaIoDeviceChannelWrite,\r
79 UgaIoGetPersistentDataSize,\r
80 UgaIoGetPersistentData,\r
81 UgaIoSetPersistentData,\r
82 UgaIoGetDevicePropertySize,\r
83 UgaIoGetDeviceProperty,\r
84 UgaIoBtPrivateInterface\r
85}\r
86UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r
87\r
88#endif\r
89\r
90typedef struct {\r
91 IN UGA_IO_REQUEST_CODE ioRequestCode;\r
92 IN VOID *pvInBuffer;\r
93 IN UINT64 ui64InBufferSize;\r
94 OUT VOID *pvOutBuffer;\r
95 IN UINT64 ui64OutBufferSize;\r
96 OUT UINT64 ui64BytesReturned;\r
bf231ea6
A
97} UGA_IO_REQUEST, *PUGA_IO_REQUEST;\r
98\r
99\r
100/**
101 Dynamically allocate storage for a child UGA_DEVICE .\r
102
103 @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r
104 defined in Section 10.7.
105 @param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device.
106 @param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()\r
107 with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
108 @param[in] RunTimeContext Context to associate with Device.
109 @param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object\r
110 for ParentDevice. The caller is responsible for deleting Device.
111
112 \r
113 @retval EFI_SUCCESS Device was returned.\r
114 @retval EFI_INVALID_PARAMETER One of the arguments was not valid.\r
115 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
d1f95000 116\r
bf231ea6 117**/\r
d1f95000 118typedef\r
119EFI_STATUS\r
120(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE) (\r
bf231ea6
A
121 IN EFI_UGA_IO_PROTOCOL *This,\r
122 IN UGA_DEVICE *ParentDevice,\r
123 IN UGA_DEVICE_DATA *DeviceData,\r
d1f95000 124 IN VOID *RunTimeContext,\r
125 OUT UGA_DEVICE **Device\r
126 );\r
127\r
d1f95000 128\r
bf231ea6
A
129/**
130 Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice() .\r
131
132 @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r
133 defined in Section 10.7.
134 @param[in] Device The Device points to a UGA_DEVICE object that was dynamically\r
135 allocated via a CreateDevice() call.\r
136
137 \r
138 @retval EFI_SUCCESS Device was returned.\r
139 @retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().\r
d1f95000 140\r
bf231ea6 141**/\r
d1f95000 142typedef\r
143EFI_STATUS\r
144(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE) (\r
145 IN EFI_UGA_IO_PROTOCOL * This,\r
146 IN UGA_DEVICE * Device\r
147 );\r
148\r
d1f95000 149\r
d1f95000 150typedef UGA_STATUS (EFIAPI *PUGA_FW_SERVICE_DISPATCH) (IN PUGA_DEVICE pDevice, IN OUT PUGA_IO_REQUEST pIoRequest);\r
151\r
bf231ea6 152/**\r
d1f95000 153\r
154 Routine Description:\r
155\r
156 This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r
157\r
158 Arguments:\r
159\r
160 pDevice - pDevice specifies a pointer to a device object associated with a \r
161 device enumerated by a pIoRequest->ioRequestCode of type \r
162 UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r
163 is represented by pDevice being set to NULL.\r
164\r
165 pIoRequest - pIoRequest points to a caller allocated buffer that contains data\r
166 defined by pIoRequest->ioRequestCode. See Related Definitions for\r
167 a definition of UGA_IO_REQUEST_CODE s and their associated data \r
168 structures.\r
169\r
170 Returns:\r
171\r
172 Varies depending on pIoRequest.\r
173\r
bf231ea6 174**/\r
d1f95000 175struct _EFI_UGA_IO_PROTOCOL {\r
176 EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r
177 EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r
178 PUGA_FW_SERVICE_DISPATCH DispatchService;\r
179};\r
180\r
181extern EFI_GUID gEfiUgaIoProtocolGuid;\r
182\r
183//\r
184// Data structure that is stored in the EFI Configuration Table with the\r
185// EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have\r
186// EBC UGA drivers.\r
187//\r
188typedef struct {\r
189 UINT32 Version;\r
190 UINT32 HeaderSize;\r
191 UINT32 SizeOfEntries;\r
192 UINT32 NumberOfEntries;\r
193} EFI_DRIVER_OS_HANDOFF_HEADER;\r
194\r
195typedef enum {\r
196 EfiUgaDriverFromPciRom,\r
197 EfiUgaDriverFromSystem,\r
198 EfiDriverHandoffMax\r
199} EFI_DRIVER_HANOFF_ENUM;\r
200\r
201typedef struct {\r
202 EFI_DRIVER_HANOFF_ENUM Type;\r
203 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
204 VOID *PciRomImage;\r
205 UINT64 PciRomSize;\r
206} EFI_DRIVER_OS_HANDOFF;\r
207\r
208#endif\r