]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/GraphicsOutput.h
Formalize comments for Protocols and PPIs.
[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
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
25typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;\r
26\r
27typedef 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
34typedef 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
42typedef 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
66typedef\r
67EFI_STATUS\r
8b13229b 68(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)(\r
d1f95000 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
ed66e1bc 73 );\r
d1f95000 74\r
75/**\r
76 Return the current video mode information.\r
77\r
78 @param This Protocol instance pointer.\r
79 @param ModeNumber The mode number to be set.\r
80\r
81 @retval EFI_SUCCESS Graphics mode was changed.\r
82 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
83 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.\r
84\r
85**/\r
86typedef\r
87EFI_STATUS\r
8b13229b 88(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)(\r
d1f95000 89 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
90 IN UINT32 ModeNumber\r
ed66e1bc 91 );\r
d1f95000 92\r
93typedef struct {\r
94 UINT8 Blue;\r
95 UINT8 Green;\r
96 UINT8 Red;\r
97 UINT8 Reserved;\r
98} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;\r
99\r
100typedef union {\r
101 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;\r
102 UINT32 Raw;\r
103} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;\r
104\r
a4e0b060 105///\r
106/// actions for BltOperations\r
107///\r
d1f95000 108typedef enum {\r
a4e0b060 109 ///\r
110 /// Write data from the BltBuffer pixel (SourceX, SourceY) \r
111 /// directly to every pixel of the video display rectangle \r
112 /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
113 /// Only one pixel will be used from the BltBuffer. Delta is NOT used. \r
114 ///\r
d1f95000 115 EfiBltVideoFill,\r
a4e0b060 116 \r
117 ///\r
118 /// Read data from the video display rectangle \r
119 /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
120 /// the BltBuffer rectangle (DestinationX, DestinationY ) \r
121 /// (DestinationX + Width, DestinationY + Height). If DestinationX or \r
122 /// DestinationY is not zero then Delta must be set to the length in bytes \r
123 /// of a row in the BltBuffer. \r
124 ///\r
d1f95000 125 EfiBltVideoToBltBuffer,\r
a4e0b060 126 \r
127 ///\r
128 /// Write data from the BltBuffer rectangle \r
129 /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
130 /// video display rectangle (DestinationX, DestinationY) \r
131 /// (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
132 /// not zero then Delta must be set to the length in bytes of a row in the \r
133 /// BltBuffer.\r
134 ///\r
d1f95000 135 EfiBltBufferToVideo, \r
a4e0b060 136 \r
137 ///\r
138 /// 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 /// EfiBltVideoToVideo,\r
143 ///\r
d1f95000 144 EfiBltVideoToVideo,\r
a4e0b060 145 \r
d1f95000 146 EfiGraphicsOutputBltOperationMax\r
147} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;\r
148\r
149/**\r
a4e0b060 150 Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.\r
151 \r
d1f95000 152 @param This Protocol instance pointer.\r
153 @param BltBuffer Buffer containing data to blit into video buffer. This\r
154 buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
155 @param BltOperation Operation to perform on BlitBuffer and video memory\r
156 @param SourceX X coordinate of source for the BltBuffer.\r
157 @param SourceY Y coordinate of source for the BltBuffer.\r
158 @param DestinationX X coordinate of destination for the BltBuffer.\r
159 @param DestinationY Y coordinate of destination for the BltBuffer.\r
160 @param Width Width of rectangle in BltBuffer in pixels.\r
161 @param Height Hight of rectangle in BltBuffer in pixels.\r
162 @param Delta OPTIONAL\r
163\r
164 @retval EFI_SUCCESS The Blt operation completed.\r
165 @retval EFI_INVALID_PARAMETER BltOperation is not valid.\r
166 @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.\r
167\r
168**/\r
169typedef\r
170EFI_STATUS\r
8b13229b 171(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT)(\r
d1f95000 172 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
173 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
174 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
175 IN UINTN SourceX,\r
176 IN UINTN SourceY,\r
177 IN UINTN DestinationX,\r
178 IN UINTN DestinationY,\r
179 IN UINTN Width,\r
180 IN UINTN Height,\r
181 IN UINTN Delta OPTIONAL\r
182 );\r
183\r
184typedef struct {\r
185 UINT32 MaxMode;\r
186 UINT32 Mode;\r
187 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;\r
188 UINTN SizeOfInfo;\r
189 EFI_PHYSICAL_ADDRESS FrameBufferBase;\r
190 UINTN FrameBufferSize;\r
191} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;\r
192\r
44717a39 193///\r
194/// Provides a basic abstraction to set video modes and copy pixels to and from \r
195/// the graphics controller's frame buffer. The linear address of the hardware \r
196/// frame buffer is also exposed so software can write directly to the video hardware.\r
197///\r
d1f95000 198struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {\r
199 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;\r
200 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;\r
201 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;\r
44717a39 202 ///\r
203 /// Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.\r
204 ///\r
d1f95000 205 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;\r
206};\r
207\r
208extern EFI_GUID gEfiGraphicsOutputProtocolGuid;\r
209\r
210#endif\r