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 - 2018, Intel Corporation. All rights reserved.<BR>
7  SPDX-License-Identifier: BSD-2-Clause-Patent
8 
9 **/
10 
11 #ifndef __GRAPHICS_OUTPUT_H__
12 #define __GRAPHICS_OUTPUT_H__
13 
14 FILE_LICENCE ( BSD2_PATENT );
15 FILE_SECBOOT ( PERMITTED );
16 
17 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
18  { \
19  0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
20  }
21 
23 
24 typedef struct {
30 
31 typedef enum {
32  ///
33  /// A pixel is 32-bits and byte zero represents red, byte one represents green,
34  /// byte two represents blue, and byte three is reserved. This is the definition
35  /// for the physical frame buffer. The byte values for the red, green, and blue
36  /// components represent the color intensity. This color intensity value range
37  /// from a minimum intensity of 0 to maximum intensity of 255.
38  ///
40  ///
41  /// A pixel is 32-bits and byte zero represents blue, byte one represents green,
42  /// byte two represents red, and byte three is reserved. This is the definition
43  /// for the physical frame buffer. The byte values for the red, green, and blue
44  /// components represent the color intensity. This color intensity value range
45  /// from a minimum intensity of 0 to maximum intensity of 255.
46  ///
48  ///
49  /// The Pixel definition of the physical frame buffer.
50  ///
52  ///
53  /// This mode does not support a physical frame buffer.
54  ///
56  ///
57  /// Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value.
58  ///
61 
62 typedef struct {
63  ///
64  /// The version of this data structure. A value of zero represents the
65  /// EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure as defined in this specification.
66  ///
68  ///
69  /// The size of video screen in pixels in the X dimension.
70  ///
72  ///
73  /// The size of video screen in pixels in the Y dimension.
74  ///
76  ///
77  /// Enumeration that defines the physical format of the pixel. A value of PixelBltOnly
78  /// implies that a linear frame buffer is not available for this mode.
79  ///
81  ///
82  /// This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask.
83  /// A bit being set defines what bits are used for what purpose such as Red, Green, Blue, or Reserved.
84  ///
86  ///
87  /// Defines the number of pixel elements per video memory line.
88  ///
91 
92 /**
93  Returns information for an available graphics mode that the graphics device
94  and the set of active video output devices supports.
95 
96  @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
97  @param ModeNumber The mode number to return information on.
98  @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
99  @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
100 
101  @retval EFI_SUCCESS Valid mode information was returned.
102  @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
103  @retval EFI_INVALID_PARAMETER ModeNumber is not valid.
104 
105 **/
106 typedef
110  IN UINT32 ModeNumber,
111  OUT UINTN *SizeOfInfo,
113  );
114 
115 /**
116  Set the video device into the specified mode and clears the visible portions of
117  the output display to black.
118 
119  @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
120  @param ModeNumber Abstraction that defines the current video mode.
121 
122  @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
123  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
124  @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
125 
126 **/
127 typedef
131  IN UINT32 ModeNumber
132  );
133 
134 typedef struct {
140 
141 typedef union {
145 
146 ///
147 /// actions for BltOperations
148 ///
149 typedef enum {
150  ///
151  /// Write data from the BltBuffer pixel (0, 0)
152  /// directly to every pixel of the video display rectangle
153  /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
154  /// Only one pixel will be used from the BltBuffer. Delta is NOT used.
155  ///
157 
158  ///
159  /// Read data from the video display rectangle
160  /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
161  /// the BltBuffer rectangle (DestinationX, DestinationY )
162  /// (DestinationX + Width, DestinationY + Height). If DestinationX or
163  /// DestinationY is not zero then Delta must be set to the length in bytes
164  /// of a row in the BltBuffer.
165  ///
167 
168  ///
169  /// Write data from the BltBuffer rectangle
170  /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
171  /// video display rectangle (DestinationX, DestinationY)
172  /// (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
173  /// not zero then Delta must be set to the length in bytes of a row in the
174  /// BltBuffer.
175  ///
177 
178  ///
179  /// Copy from the video display rectangle (SourceX, SourceY)
180  /// (SourceX + Width, SourceY + Height) to the video display rectangle
181  /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
182  /// The BltBuffer and Delta are not used in this mode.
183  ///
185 
188 
189 /**
190  Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
191 
192  @param This Protocol instance pointer.
193  @param BltBuffer The data to transfer to the graphics screen.
194  Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
195  @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen.
196  @param SourceX The X coordinate of source for the BltOperation.
197  @param SourceY The Y coordinate of source for the BltOperation.
198  @param DestinationX The X coordinate of destination for the BltOperation.
199  @param DestinationY The Y coordinate of destination for the BltOperation.
200  @param Width The width of a rectangle in the blt rectangle in pixels.
201  @param Height The height of a rectangle in the blt rectangle in pixels.
202  @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation.
203  If a Delta of zero is used, the entire BltBuffer is being operated on.
204  If a subrectangle of the BltBuffer is being used then Delta
205  represents the number of bytes in a row of the BltBuffer.
206 
207  @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen.
208  @retval EFI_INVALID_PARAMETER BltOperation is not valid.
209  @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
210 
211 **/
212 typedef
218  IN UINTN SourceX,
219  IN UINTN SourceY,
220  IN UINTN DestinationX,
221  IN UINTN DestinationY,
222  IN UINTN Width,
223  IN UINTN Height,
224  IN UINTN Delta OPTIONAL
225  );
226 
227 typedef struct {
228  ///
229  /// The number of modes supported by QueryMode() and SetMode().
230  ///
232  ///
233  /// Current Mode of the graphics device. Valid mode numbers are 0 to MaxMode -1.
234  ///
236  ///
237  /// Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data.
238  ///
240  ///
241  /// Size of Info structure in bytes.
242  ///
244  ///
245  /// Base address of graphics linear frame buffer.
246  /// Offset zero in FrameBufferBase represents the upper left pixel of the display.
247  ///
249  ///
250  /// Amount of frame buffer needed to support the active mode as defined by
251  /// PixelsPerScanLine xVerticalResolution x PixelElementSize.
252  ///
255 
256 ///
257 /// Provides a basic abstraction to set video modes and copy pixels to and from
258 /// the graphics controller's frame buffer. The linear address of the hardware
259 /// frame buffer is also exposed so software can write directly to the video hardware.
260 ///
265  ///
266  /// Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
267  ///
269 };
270 
272 
273 #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:293
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:216
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:99
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
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
Definition: UefiBaseType.h:53
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.
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.
UINT32 VerticalResolution
The size of video screen in pixels in the Y dimension.
EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
FILE_LICENCE(BSD2_PATENT)
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
FILE_SECBOOT(PERMITTED)
#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.
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:32
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.