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