2 Graphics Output Protocol from the UEFI 2.0 specification.
4 Abstraction of a very simple graphics device.
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #ifndef __GRAPHICS_OUTPUT_H__
12 #define __GRAPHICS_OUTPUT_H__
14 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
16 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
19 typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL
;
30 /// A pixel is 32-bits and byte zero represents red, byte one represents green,
31 /// byte two represents blue, and byte three is reserved. This is the definition
32 /// for the physical frame buffer. The byte values for the red, green, and blue
33 /// components represent the color intensity. This color intensity value range
34 /// from a minimum intensity of 0 to maximum intensity of 255.
36 PixelRedGreenBlueReserved8BitPerColor
,
38 /// A pixel is 32-bits and byte zero represents blue, byte one represents green,
39 /// byte two represents red, 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.
44 PixelBlueGreenRedReserved8BitPerColor
,
46 /// The Pixel definition of the physical frame buffer.
50 /// This mode does not support a physical frame buffer.
54 /// Valid EFI_GRAPHICS_PIXEL_FORMAT enum values are less than this value.
57 } EFI_GRAPHICS_PIXEL_FORMAT
;
61 /// The version of this data structure. A value of zero represents the
62 /// EFI_GRAPHICS_OUTPUT_MODE_INFORMATION structure as defined in this specification.
66 /// The size of video screen in pixels in the X dimension.
68 UINT32 HorizontalResolution
;
70 /// The size of video screen in pixels in the Y dimension.
72 UINT32 VerticalResolution
;
74 /// Enumeration that defines the physical format of the pixel. A value of PixelBltOnly
75 /// implies that a linear frame buffer is not available for this mode.
77 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat
;
79 /// This bit-mask is only valid if PixelFormat is set to PixelPixelBitMask.
80 /// A bit being set defines what bits are used for what purpose such as Red, Green, Blue, or Reserved.
82 EFI_PIXEL_BITMASK PixelInformation
;
84 /// Defines the number of pixel elements per video memory line.
86 UINT32 PixelsPerScanLine
;
87 } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
;
90 Returns information for an available graphics mode that the graphics device
91 and the set of active video output devices supports.
93 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
94 @param ModeNumber The mode number to return information on.
95 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
96 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
98 @retval EFI_SUCCESS Valid mode information was returned.
99 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
100 @retval EFI_INVALID_PARAMETER ModeNumber is not valid.
105 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE
)(
106 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
107 IN UINT32 ModeNumber
,
108 OUT UINTN
*SizeOfInfo
,
109 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
**Info
113 Set the video device into the specified mode and clears the visible portions of
114 the output display to black.
116 @param This The EFI_GRAPHICS_OUTPUT_PROTOCOL instance.
117 @param ModeNumber Abstraction that defines the current video mode.
119 @retval EFI_SUCCESS The graphics mode specified by ModeNumber was selected.
120 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
121 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
126 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE
)(
127 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
136 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL
;
139 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel
;
141 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION
;
144 /// actions for BltOperations
148 /// Write data from the BltBuffer pixel (0, 0)
149 /// directly to every pixel of the video display rectangle
150 /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
151 /// Only one pixel will be used from the BltBuffer. Delta is NOT used.
156 /// Read data from the video display rectangle
157 /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
158 /// the BltBuffer rectangle (DestinationX, DestinationY )
159 /// (DestinationX + Width, DestinationY + Height). If DestinationX or
160 /// DestinationY is not zero then Delta must be set to the length in bytes
161 /// of a row in the BltBuffer.
163 EfiBltVideoToBltBuffer
,
166 /// Write data from the BltBuffer rectangle
167 /// (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
168 /// video display rectangle (DestinationX, DestinationY)
169 /// (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
170 /// not zero then Delta must be set to the length in bytes of a row in the
176 /// Copy from the video display rectangle (SourceX, SourceY)
177 /// (SourceX + Width, SourceY + Height) to the video display rectangle
178 /// (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
179 /// The BltBuffer and Delta are not used in this mode.
183 EfiGraphicsOutputBltOperationMax
184 } EFI_GRAPHICS_OUTPUT_BLT_OPERATION
;
187 Blt a rectangle of pixels on the graphics screen. Blt stands for BLock Transfer.
189 @param This Protocol instance pointer.
190 @param BltBuffer The data to transfer to the graphics screen.
191 Size is at least Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL).
192 @param BltOperation The operation to perform when copying BltBuffer on to the graphics screen.
193 @param SourceX The X coordinate of source for the BltOperation.
194 @param SourceY The Y coordinate of source for the BltOperation.
195 @param DestinationX The X coordinate of destination for the BltOperation.
196 @param DestinationY The Y coordinate of destination for the BltOperation.
197 @param Width The width of a rectangle in the blt rectangle in pixels.
198 @param Height The height of a rectangle in the blt rectangle in pixels.
199 @param Delta Not used for EfiBltVideoFill or the EfiBltVideoToVideo operation.
200 If a Delta of zero is used, the entire BltBuffer is being operated on.
201 If a subrectangle of the BltBuffer is being used then Delta
202 represents the number of bytes in a row of the BltBuffer.
204 @retval EFI_SUCCESS BltBuffer was drawn to the graphics screen.
205 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
206 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
211 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT
)(
212 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
213 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer OPTIONAL
,
214 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation
,
217 IN UINTN DestinationX
,
218 IN UINTN DestinationY
,
221 IN UINTN Delta OPTIONAL
226 /// The number of modes supported by QueryMode() and SetMode().
230 /// Current Mode of the graphics device. Valid mode numbers are 0 to MaxMode -1.
234 /// Pointer to read-only EFI_GRAPHICS_OUTPUT_MODE_INFORMATION data.
236 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
*Info
;
238 /// Size of Info structure in bytes.
242 /// Base address of graphics linear frame buffer.
243 /// Offset zero in FrameBufferBase represents the upper left pixel of the display.
245 EFI_PHYSICAL_ADDRESS FrameBufferBase
;
247 /// Amount of frame buffer needed to support the active mode as defined by
248 /// PixelsPerScanLine xVerticalResolution x PixelElementSize.
250 UINTN FrameBufferSize
;
251 } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
;
254 /// Provides a basic abstraction to set video modes and copy pixels to and from
255 /// the graphics controller's frame buffer. The linear address of the hardware
256 /// frame buffer is also exposed so software can write directly to the video hardware.
258 struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
{
259 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
;
260 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode
;
261 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt
;
263 /// Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
265 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
*Mode
;
268 extern EFI_GUID gEfiGraphicsOutputProtocolGuid
;