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