iPXE
GraphicsOutput.h
Go to the documentation of this file.
1 /** @file
2  Graphics Output Protocol from the UEFI 2.0 specification.
3 
4  Abstraction of a very simple graphics device.
5 
6  Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
7  This program and the accompanying materials
8  are licensed and made available under the terms and conditions of the BSD License
9  which accompanies this distribution. The full text of the license may be found at
10  http://opensource.org/licenses/bsd-license.php
11 
12  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 
15 **/
16 
17 #ifndef __GRAPHICS_OUTPUT_H__
18 #define __GRAPHICS_OUTPUT_H__
19 
20 FILE_LICENCE ( BSD3 );
21 
22 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
23  { \
24  0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
25  }
26 
28 
29 typedef struct {
35 
36 typedef enum {
37  ///
38  /// A pixel is 32-bits and byte zero represents red, byte one represents green,
39  /// byte two represents blue, and byte three is reserved. This is the definition
40  /// for the physical frame buffer. The byte values for the red, green, and blue
41  /// components represent the color intensity. This color intensity value range
42  /// from a minimum intensity of 0 to maximum intensity of 255.
43  ///
45  ///
46  /// A pixel is 32-bits and byte zero represents blue, byte one represents green,
47  /// byte two represents red, and byte three is reserved. This is the definition
48  /// for the physical frame buffer. The byte values for the red, green, and blue
49  /// components represent the color intensity. This color intensity value range
50  /// from a minimum intensity of 0 to maximum intensity of 255.
51  ///
53  ///
54  /// The Pixel definition of the physical frame buffer.
55  ///
57  ///
58  /// This mode does not support a physical frame buffer.
59  ///
61  ///
62  /// Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value.
63  ///
66 
67 typedef struct {
68  ///
69  /// The version of this data structure. A value of zero represents the
70  /// EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure as defined in this specification.
71  ///
73  ///
74  /// The size of video screen in pixels in the X dimension.
75  ///
77  ///
78  /// The size of video screen in pixels in the Y dimension.
79  ///
81  ///
82  /// Enumeration that defines the physical format of the pixel. A value of PixelBltOnly
83  /// implies that a linear frame buffer is not available for this mode.
84  ///
86  ///
87  /// This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask.
88  /// A bit being set defines what bits are used for what purpose such as Red, Green, Blue, or Reserved.
89  ///
91  ///
92  /// Defines the number of pixel elements per video memory line.
93  ///
96 
97 /**
98  Returns information for an available graphics mode that the graphics device
99  and the set of active video output devices supports.
100 
101  @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
102  @param ModeNumber The mode number to return information on.
103  @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
104  @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
105 
106  @retval EFI_SUCCESS Valid mode information was returned.
107  @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
108  @retval EFI_INVALID_PARAMETER ModeNumber is not valid.
109 
110 **/
111 typedef
115  IN UINT32 ModeNumber,
116  OUT UINTN *SizeOfInfo,
118  );
119 
120 /**
121  Set the video device into the specified mode and clears the visible portions of
122  the output display to black.
123 
124  @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
125  @param ModeNumber Abstraction that defines the current video mode.
126 
127  @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
128  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
129  @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
130 
131 **/
132 typedef
136  IN UINT32 ModeNumber
137  );
138 
139 typedef struct {
145 
146 typedef union {
150 
151 ///
152 /// actions for BltOperations
153 ///
154 typedef enum {
155  ///
156  /// Write data from the BltBuffer pixel (0, 0)
157  /// directly to every pixel of the video display rectangle
158  /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
159  /// Only one pixel will be used from the BltBuffer. Delta is NOT used.
160  ///
162 
163  ///
164  /// Read data from the video display rectangle
165  /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
166  /// the BltBuffer rectangle (DestinationX, DestinationY )
167  /// (DestinationX + Width, DestinationY + Height). If DestinationX or
168  /// DestinationY is not zero then Delta must be set to the length in bytes
169  /// of a row in the BltBuffer.
170  ///
172 
173  ///
174  /// Write data from the BltBuffer rectangle
175  /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
176  /// video display rectangle (DestinationX, DestinationY)
177  /// (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
178  /// not zero then Delta must be set to the length in bytes of a row in the
179  /// BltBuffer.
180  ///
182 
183  ///
184  /// Copy from the video display rectangle (SourceX, SourceY)
185  /// (SourceX + Width, SourceY + Height) to the video display rectangle
186  /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
187  /// The BltBuffer and Delta are not used in this mode.
188  ///
190 
193 
194 /**
195  Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
196 
197  @param This Protocol instance pointer.
198  @param BltBuffer The data to transfer to the graphics screen.
199  Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
200  @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen.
201  @param SourceX The X coordinate of source for the BltOperation.
202  @param SourceY The Y coordinate of source for the BltOperation.
203  @param DestinationX The X coordinate of destination for the BltOperation.
204  @param DestinationY The Y coordinate of destination for the BltOperation.
205  @param Width The width of a rectangle in the blt rectangle in pixels.
206  @param Height The height of a rectangle in the blt rectangle in pixels.
207  @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation.
208  If a Delta of zero is used, the entire BltBuffer is being operated on.
209  If a subrectangle of the BltBuffer is being used then Delta
210  represents the number of bytes in a row of the BltBuffer.
211 
212  @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen.
213  @retval EFI_INVALID_PARAMETER BltOperation is not valid.
214  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
215 
216 **/
217 typedef
223  IN UINTN SourceX,
224  IN UINTN SourceY,
225  IN UINTN DestinationX,
226  IN UINTN DestinationY,
227  IN UINTN Width,
228  IN UINTN Height,
229  IN UINTN Delta OPTIONAL
230  );
231 
232 typedef struct {
233  ///
234  /// The number of modes supported by QueryMode() and SetMode().
235  ///
237  ///
238  /// Current Mode of the graphics device. Valid mode numbers are 0 to MaxMode -1.
239  ///
241  ///
242  /// Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data.
243  ///
245  ///
246  /// Size of Info structure in bytes.
247  ///
249  ///
250  /// Base address of graphics linear frame buffer.
251  /// Offset zero in FrameBufferBase represents the upper left pixel of the display.
252  ///
254  ///
255  /// Amount of frame buffer needed to support the active mode as defined by
256  /// PixelsPerScanLine xVerticalResolution x PixelElementSize.
257  ///
260 
261 ///
262 /// Provides a basic abstraction to set video modes and copy pixels to and from
263 /// the graphics controller's frame buffer. The linear address of the hardware
264 /// frame buffer is also exposed so software can write directly to the video hardware.
265 ///
270  ///
271  /// Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
272  ///
274 };
275 
277 
278 #endif
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition: Base.h:340
UINT32 HorizontalResolution
The size of video screen in pixels in the X dimension.
The Pixel definition of the physical frame buffer.
EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * Mode
Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
Write data from the BltBuffer pixel (0, 0) directly to every pixel of the video display rectangle (De...
Write data from the BltBuffer rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) direct...
EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt
Read data from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) and...
unsigned int UINT32
Definition: ProcessorBind.h:56
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel
Copy from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) to the v...
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION * Info
Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data.
unsigned char UINT8
Definition: ProcessorBind.h:62
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
Definition: UefiBaseType.h:56
A pixel is 32-bits and byte zero represents blue, byte one represents green, byte two represents red,...
UINT32 Version
The version of this data structure.
UINT32 VerticalResolution
The size of video screen in pixels in the Y dimension.
EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
EFI_STATUS(EFIAPI * EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE)(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN UINT32 ModeNumber)
Set the video device into the specified mode and clears the visible portions of the output display to...
Provides a basic abstraction to set video modes and copy pixels to and from the graphics controller's...
EFI_GUID gEfiGraphicsOutputProtocolGuid
#define OUT
Definition: mlx_utils.h:29
UINT32 PixelsPerScanLine
Defines the number of pixel elements per video memory line.
UINTN FrameBufferSize
Amount of frame buffer needed to support the active mode as defined by PixelsPerScanLine xVerticalRes...
Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value.
EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode
#define EFIAPI
EFI_PIXEL_BITMASK PixelInformation
This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask.
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
A pixel is 32-bits and byte zero represents red, byte one represents green, byte two represents blue,...
UINT32 MaxMode
The number of modes supported by QueryMode() and SetMode().
EFI_PHYSICAL_ADDRESS FrameBufferBase
Base address of graphics linear frame buffer.
UINT32 Mode
Current Mode of the graphics device.
#define IN
Definition: mlx_utils.h:28
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
EFI_STATUS(EFIAPI * EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE)(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN UINT32 ModeNumber, OUT UINTN *SizeOfInfo, OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info)
Returns information for an available graphics mode that the graphics device and the set of active vid...
EFI_GRAPHICS_PIXEL_FORMAT PixelFormat
Enumeration that defines the physical format of the pixel.
EFI_GRAPHICS_PIXEL_FORMAT
EFI_GRAPHICS_OUTPUT_BLT_OPERATION
actions for BltOperations
This mode does not support a physical frame buffer.
UINTN SizeOfInfo
Size of Info structure in bytes.
EFI_STATUS(EFIAPI * EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT)(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, IN UINTN SourceX, IN UINTN SourceY, IN UINTN DestinationX, IN UINTN DestinationY, IN UINTN Width, IN UINTN Height, IN UINTN Delta OPTIONAL)
Blt a rectangle of pixels on the graphics screen.
FILE_LICENCE(BSD3)