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