]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/GraphicsOutput.h
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / MdePkg / Include / Protocol / GraphicsOutput.h
CommitLineData
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
4ca9b6c4 6 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 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
3f748e52 20#include <PiDxe.h>\r
21\r
d1f95000 22#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \\r
23 { \\r
24 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \\r
25 }\r
26\r
27typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;\r
28\r
29typedef struct {\r
30 UINT32 RedMask;\r
31 UINT32 GreenMask;\r
32 UINT32 BlueMask;\r
33 UINT32 ReservedMask;\r
34} EFI_PIXEL_BITMASK;\r
35\r
36typedef enum {\r
37 PixelRedGreenBlueReserved8BitPerColor,\r
38 PixelBlueGreenRedReserved8BitPerColor,\r
39 PixelBitMask,\r
40 PixelBltOnly,\r
41 PixelFormatMax\r
42} EFI_GRAPHICS_PIXEL_FORMAT;\r
43\r
44typedef struct {\r
45 UINT32 Version;\r
46 UINT32 HorizontalResolution;\r
47 UINT32 VerticalResolution;\r
48 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;\r
49 EFI_PIXEL_BITMASK PixelInformation;\r
50 UINT32 PixelsPerScanLine;\r
51} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;\r
52\r
53/**\r
54 Return the current video mode information.\r
55\r
56 @param This Protocol instance pointer.\r
57 @param ModeNumber The mode number to return information on.\r
58 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.\r
59 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.\r
60\r
61 @retval EFI_SUCCESS Mode information returned.\r
62 @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.\r
63 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.\r
64 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
65 @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
66\r
67**/\r
68typedef\r
69EFI_STATUS\r
8b13229b 70(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)(\r
d1f95000 71 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
72 IN UINT32 ModeNumber,\r
73 OUT UINTN *SizeOfInfo,\r
74 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r
ed66e1bc 75 );\r
d1f95000 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
8b13229b 90(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)(\r
d1f95000 91 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
92 IN UINT32 ModeNumber\r
ed66e1bc 93 );\r
d1f95000 94\r
95typedef 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
102typedef union {\r
103 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;\r
104 UINT32 Raw;\r
105} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;\r
106\r
107typedef 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
159typedef\r
160EFI_STATUS\r
8b13229b 161(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT)(\r
d1f95000 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
174typedef 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
4ca9b6c4
LG
183/**\r
184 @par Protocol Description:\r
185 Provides a basic abstraction to set video modes and copy pixels to and from \r
186 the graphics controller's frame buffer. The linear address of the hardware \r
187 frame buffer is also exposed so software can write directly to the video hardware.\r
188\r
189 @param QueryMode\r
190 Returns information for an available graphics mode that the graphics device \r
191 and the set of active video output devices supports.\r
192 \r
193 @param SetMode \r
194 Set the video device into the specified mode and clears the visible portions \r
195 of the output display to black.\r
196 \r
197 @param Blt\r
198 Software abstraction to draw on the video device's frame buffer.\r
199 \r
200 @param Mode\r
201 Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.\r
202\r
203**/\r
d1f95000 204struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {\r
205 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;\r
206 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;\r
207 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;\r
208 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;\r
209};\r
210\r
211extern EFI_GUID gEfiGraphicsOutputProtocolGuid;\r
212\r
213#endif\r