]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
2 | Graphics Output Protocol from the UEFI 2.0 specification.\r | |
3 | \r | |
4 | Abstraction of a very simple graphics device.\r | |
5 | \r | |
6 | Copyright (c) 2006, 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 | |
14 | \r | |
d1f95000 | 15 | **/\r |
16 | \r | |
17 | #ifndef __GRAPHICS_OUTPUT_H__\r | |
18 | #define __GRAPHICS_OUTPUT_H__\r | |
19 | \r | |
20 | #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \\r | |
21 | { \\r | |
22 | 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \\r | |
23 | }\r | |
24 | \r | |
25 | typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;\r | |
26 | \r | |
27 | typedef struct {\r | |
28 | UINT32 RedMask;\r | |
29 | UINT32 GreenMask;\r | |
30 | UINT32 BlueMask;\r | |
31 | UINT32 ReservedMask;\r | |
32 | } EFI_PIXEL_BITMASK;\r | |
33 | \r | |
34 | typedef enum {\r | |
35 | PixelRedGreenBlueReserved8BitPerColor,\r | |
36 | PixelBlueGreenRedReserved8BitPerColor,\r | |
37 | PixelBitMask,\r | |
38 | PixelBltOnly,\r | |
39 | PixelFormatMax\r | |
40 | } EFI_GRAPHICS_PIXEL_FORMAT;\r | |
41 | \r | |
42 | typedef struct {\r | |
43 | UINT32 Version;\r | |
44 | UINT32 HorizontalResolution;\r | |
45 | UINT32 VerticalResolution;\r | |
46 | EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;\r | |
47 | EFI_PIXEL_BITMASK PixelInformation;\r | |
48 | UINT32 PixelsPerScanLine;\r | |
49 | } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;\r | |
50 | \r | |
51 | /**\r | |
52 | Return the current video mode information.\r | |
53 | \r | |
54 | @param This Protocol instance pointer.\r | |
55 | @param ModeNumber The mode number to return information on.\r | |
56 | @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.\r | |
57 | @param Info A pointer to callee allocated buffer that returns information about ModeNumber.\r | |
58 | \r | |
59 | @retval EFI_SUCCESS Mode information returned.\r | |
60 | @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.\r | |
61 | @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.\r | |
62 | @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r | |
63 | @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r | |
64 | \r | |
65 | **/\r | |
66 | typedef\r | |
67 | EFI_STATUS\r | |
68 | (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (\r | |
69 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r | |
70 | IN UINT32 ModeNumber,\r | |
71 | OUT UINTN *SizeOfInfo,\r | |
72 | OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r | |
73 | )\r | |
74 | ;\r | |
75 | \r | |
76 | /**\r | |
77 | Return the current video mode information.\r | |
78 | \r | |
79 | @param This Protocol instance pointer.\r | |
80 | @param ModeNumber The mode number to be set.\r | |
81 | \r | |
82 | @retval EFI_SUCCESS Graphics mode was changed.\r | |
83 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
84 | @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.\r | |
85 | \r | |
86 | **/\r | |
87 | typedef\r | |
88 | EFI_STATUS\r | |
89 | (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (\r | |
90 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r | |
91 | IN UINT32 ModeNumber\r | |
92 | )\r | |
93 | ;\r | |
94 | \r | |
95 | typedef struct {\r | |
96 | UINT8 Blue;\r | |
97 | UINT8 Green;\r | |
98 | UINT8 Red;\r | |
99 | UINT8 Reserved;\r | |
100 | } EFI_GRAPHICS_OUTPUT_BLT_PIXEL;\r | |
101 | \r | |
102 | typedef union {\r | |
103 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;\r | |
104 | UINT32 Raw;\r | |
105 | } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;\r | |
106 | \r | |
107 | typedef enum {\r | |
108 | EfiBltVideoFill,\r | |
109 | EfiBltVideoToBltBuffer,\r | |
110 | EfiBltBufferToVideo, \r | |
111 | EfiBltVideoToVideo,\r | |
112 | EfiGraphicsOutputBltOperationMax\r | |
113 | } EFI_GRAPHICS_OUTPUT_BLT_OPERATION;\r | |
114 | \r | |
115 | /**\r | |
116 | The following table defines actions for BltOperations:\r | |
117 | \r | |
118 | <B>EfiBltVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY) \r | |
119 | directly to every pixel of the video display rectangle \r | |
120 | (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r | |
121 | Only one pixel will be used from the BltBuffer. Delta is NOT used.\r | |
122 | \r | |
123 | <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle \r | |
124 | (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r | |
125 | the BltBuffer rectangle (DestinationX, DestinationY ) \r | |
126 | (DestinationX + Width, DestinationY + Height). If DestinationX or \r | |
127 | DestinationY is not zero then Delta must be set to the length in bytes \r | |
128 | of a row in the BltBuffer.\r | |
129 | \r | |
130 | <B>EfiBltBufferToVideo</B> - Write data from the BltBuffer rectangle \r | |
131 | (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r | |
132 | video display rectangle (DestinationX, DestinationY) \r | |
133 | (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r | |
134 | not zero then Delta must be set to the length in bytes of a row in the \r | |
135 | BltBuffer.\r | |
136 | \r | |
137 | <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r | |
138 | (SourceX + Width, SourceY + Height) .to the video display rectangle \r | |
139 | (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r | |
140 | The BltBuffer and Delta are not used in this mode.\r | |
141 | \r | |
142 | @param This Protocol instance pointer.\r | |
143 | @param BltBuffer Buffer containing data to blit into video buffer. This\r | |
144 | buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r | |
145 | @param BltOperation Operation to perform on BlitBuffer and video memory\r | |
146 | @param SourceX X coordinate of source for the BltBuffer.\r | |
147 | @param SourceY Y coordinate of source for the BltBuffer.\r | |
148 | @param DestinationX X coordinate of destination for the BltBuffer.\r | |
149 | @param DestinationY Y coordinate of destination for the BltBuffer.\r | |
150 | @param Width Width of rectangle in BltBuffer in pixels.\r | |
151 | @param Height Hight of rectangle in BltBuffer in pixels.\r | |
152 | @param Delta OPTIONAL\r | |
153 | \r | |
154 | @retval EFI_SUCCESS The Blt operation completed.\r | |
155 | @retval EFI_INVALID_PARAMETER BltOperation is not valid.\r | |
156 | @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.\r | |
157 | \r | |
158 | **/\r | |
159 | typedef\r | |
160 | EFI_STATUS\r | |
161 | (EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (\r | |
162 | IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r | |
163 | IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r | |
164 | IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r | |
165 | IN UINTN SourceX,\r | |
166 | IN UINTN SourceY,\r | |
167 | IN UINTN DestinationX,\r | |
168 | IN UINTN DestinationY,\r | |
169 | IN UINTN Width,\r | |
170 | IN UINTN Height,\r | |
171 | IN UINTN Delta OPTIONAL\r | |
172 | );\r | |
173 | \r | |
174 | typedef struct {\r | |
175 | UINT32 MaxMode;\r | |
176 | UINT32 Mode;\r | |
177 | EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;\r | |
178 | UINTN SizeOfInfo;\r | |
179 | EFI_PHYSICAL_ADDRESS FrameBufferBase;\r | |
180 | UINTN FrameBufferSize;\r | |
181 | } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;\r | |
182 | \r | |
183 | struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {\r | |
184 | EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;\r | |
185 | EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;\r | |
186 | EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;\r | |
187 | EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;\r | |
188 | };\r | |
189 | \r | |
190 | extern EFI_GUID gEfiGraphicsOutputProtocolGuid;\r | |
191 | \r | |
192 | #endif\r |