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
14FILE_LICENCE ( BSD2_PATENT );
15FILE_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
30
31typedef 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
62typedef 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**/
106typedef
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**/
127typedef
131 IN UINT32 ModeNumber
132 );
133
140
145
146///
147/// actions for BltOperations
148///
149typedef 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**/
212typedef
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
227typedef 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///
270
272
273#endif
UINT64 UINTN
Unsigned value of native width.
#define EFIAPI
unsigned char UINT8
1-byte unsigned value.
unsigned int UINT32
4-byte unsigned value.
#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
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.
EFI_GRAPHICS_OUTPUT_BLT_OPERATION
actions for BltOperations
@ EfiBltVideoToBltBuffer
Read data from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) and...
@ EfiBltBufferToVideo
Write data from the BltBuffer rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) direct...
@ EfiGraphicsOutputBltOperationMax
@ EfiBltVideoFill
Write data from the BltBuffer pixel (0, 0) directly to every pixel of the video display rectangle (De...
@ EfiBltVideoToVideo
Copy from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) to the v...
EFI_GRAPHICS_PIXEL_FORMAT
@ PixelBitMask
The Pixel definition of the physical frame buffer.
@ PixelRedGreenBlueReserved8BitPerColor
A pixel is 32-bits and byte zero represents red, byte one represents green, byte two represents blue,...
@ PixelBlueGreenRedReserved8BitPerColor
A pixel is 32-bits and byte zero represents blue, byte one represents green, byte two represents red,...
@ PixelBltOnly
This mode does not support a physical frame buffer.
@ PixelFormatMax
Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value.
struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL
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_GUID gEfiGraphicsOutputProtocolGuid
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...
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define IN
Definition mlx_utils.h:28
#define OUT
Definition mlx_utils.h:29
UINT32 VerticalResolution
The size of video screen in pixels in the Y dimension.
UINT32 Version
The version of this data structure.
EFI_GRAPHICS_PIXEL_FORMAT PixelFormat
Enumeration that defines the physical format of the pixel.
UINT32 HorizontalResolution
The size of video screen in pixels in the X dimension.
EFI_PIXEL_BITMASK PixelInformation
This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask.
UINT32 PixelsPerScanLine
Defines the number of pixel elements per video memory line.
UINT32 Mode
Current Mode of the graphics device.
EFI_PHYSICAL_ADDRESS FrameBufferBase
Base address of graphics linear frame buffer.
UINT32 MaxMode
The number of modes supported by QueryMode() and SetMode().
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION * Info
Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data.
UINTN FrameBufferSize
Amount of frame buffer needed to support the active mode as defined by PixelsPerScanLine xVerticalRes...
UINTN SizeOfInfo
Size of Info structure in bytes.
Provides a basic abstraction to set video modes and copy pixels to and from the graphics controller's...
EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * Mode
Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt
EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel