]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UgaIo.h
Formalize comments for Protocols and PPIs.
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaIo.h
CommitLineData
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
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
d1f95000 57typedef 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
82UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r
83\r
d1f95000 84typedef 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
d16ce4dd 97 @param[in] This The EFI_UGA_IO_PROTOCOL instance.
bf231ea6
A
98 @param[in] ParentDevice ParentDevice specifies a pointer to the parent device of Device.
99 @param[in] DeviceData A pointer to UGA_DEVICE_DATA returned from a call to DispatchService()\r
100 with a UGA_DEVICE of Parent and an IoRequest of type UgaIoGetChildDevice.
101 @param[in] RunTimeContext Context to associate with Device.
102 @param[out] Device The Device returns a dynamically allocated child UGA_DEVICE object\r
103 for ParentDevice. The caller is responsible for deleting Device.
104
105 \r
106 @retval EFI_SUCCESS Device was returned.\r
107 @retval EFI_INVALID_PARAMETER One of the arguments was not valid.\r
108 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
d1f95000 109\r
bf231ea6 110**/\r
d1f95000 111typedef\r
112EFI_STATUS\r
8b13229b 113(EFIAPI *EFI_UGA_IO_PROTOCOL_CREATE_DEVICE)(\r
bf231ea6
A
114 IN EFI_UGA_IO_PROTOCOL *This,\r
115 IN UGA_DEVICE *ParentDevice,\r
116 IN UGA_DEVICE_DATA *DeviceData,\r
d1f95000 117 IN VOID *RunTimeContext,\r
118 OUT UGA_DEVICE **Device\r
119 );\r
120\r
d1f95000 121\r
bf231ea6
A
122/**
123 Delete a dynamically allocated child UGA_DEVICE object that was allocated via CreateDevice() .\r
124
125 @param[in] This The EFI_UGA_IO_PROTOCOL instance. Type EFI_UGA_IO_PROTOCOL is \r
126 defined in Section 10.7.
127 @param[in] Device The Device points to a UGA_DEVICE object that was dynamically\r
128 allocated via a CreateDevice() call.\r
129
130 \r
131 @retval EFI_SUCCESS Device was returned.\r
132 @retval EFI_INVALID_PARAMETER The Device was not allocated via CreateDevice().\r
d1f95000 133\r
bf231ea6 134**/\r
d1f95000 135typedef\r
136EFI_STATUS\r
8b13229b 137(EFIAPI *EFI_UGA_IO_PROTOCOL_DELETE_DEVICE)(\r
d1f95000 138 IN EFI_UGA_IO_PROTOCOL * This,\r
139 IN UGA_DEVICE * Device\r
140 );\r
141\r
bf231ea6 142/**\r
19bee90c 143 This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r
d1f95000 144\r
19bee90c 145 @param pDevice pDevice specifies a pointer to a device object associated with a \r
d1f95000 146 device enumerated by a pIoRequest->ioRequestCode of type \r
147 UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r
148 is represented by pDevice being set to NULL.\r
149\r
19bee90c
LG
150 @param pIoRequest \r
151 pIoRequest points to a caller allocated buffer that contains data\r
d1f95000 152 defined by pIoRequest->ioRequestCode. See Related Definitions for\r
153 a definition of UGA_IO_REQUEST_CODE s and their associated data \r
154 structures.\r
155\r
19bee90c 156 @return UGA_STATUS\r
d1f95000 157\r
bf231ea6 158**/\r
19bee90c
LG
159typedef UGA_STATUS \r
160(EFIAPI *PUGA_FW_SERVICE_DISPATCH)(\r
161 IN PUGA_DEVICE pDevice, \r
162 IN OUT PUGA_IO_REQUEST pIoRequest\r
163 );\r
164\r
44717a39 165///\r
166/// Provides a basic abstraction to send I/O requests to the graphics device and any of its children.\r
167///\r
d1f95000 168struct _EFI_UGA_IO_PROTOCOL {\r
169 EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r
170 EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r
171 PUGA_FW_SERVICE_DISPATCH DispatchService;\r
172};\r
173\r
174extern EFI_GUID gEfiUgaIoProtocolGuid;\r
175\r
176//\r
177// Data structure that is stored in the EFI Configuration Table with the\r
178// EFI_UGA_IO_PROTOCOL_GUID. The option ROMs listed in this table may have\r
179// EBC UGA drivers.\r
180//\r
181typedef struct {\r
182 UINT32 Version;\r
183 UINT32 HeaderSize;\r
184 UINT32 SizeOfEntries;\r
185 UINT32 NumberOfEntries;\r
186} EFI_DRIVER_OS_HANDOFF_HEADER;\r
187\r
188typedef enum {\r
189 EfiUgaDriverFromPciRom,\r
190 EfiUgaDriverFromSystem,\r
191 EfiDriverHandoffMax\r
192} EFI_DRIVER_HANOFF_ENUM;\r
193\r
194typedef struct {\r
195 EFI_DRIVER_HANOFF_ENUM Type;\r
196 EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r
197 VOID *PciRomImage;\r
198 UINT64 PciRomSize;\r
199} EFI_DRIVER_OS_HANDOFF;\r
200\r
201#endif\r