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>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
12 #ifndef __GRAPHICS_OUTPUT_H__
13 #define __GRAPHICS_OUTPUT_H__
15 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
17 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \
20 typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL
;
30 PixelRedGreenBlueReserved8BitPerColor
,
31 PixelBlueGreenRedReserved8BitPerColor
,
35 } EFI_GRAPHICS_PIXEL_FORMAT
;
39 UINT32 HorizontalResolution
;
40 UINT32 VerticalResolution
;
41 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat
;
42 EFI_PIXEL_BITMASK PixelInformation
;
43 UINT32 PixelsPerScanLine
;
44 } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
;
47 Return the current video mode information.
49 @param This Protocol instance pointer.
50 @param ModeNumber The mode number to return information on.
51 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.
52 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.
54 @retval EFI_SUCCESS Mode information returned.
55 @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
56 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.
57 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
58 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
63 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE
) (
64 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
66 OUT UINTN
*SizeOfInfo
,
67 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
**Info
72 Return the current video mode information.
74 @param This Protocol instance pointer.
75 @param ModeNumber The mode number to be set.
77 @retval EFI_SUCCESS Graphics mode was changed.
78 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
79 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
84 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE
) (
85 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
95 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL
;
98 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel
;
100 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION
;
104 EfiBltVideoToBltBuffer
,
107 EfiGraphicsOutputBltOperationMax
108 } EFI_GRAPHICS_OUTPUT_BLT_OPERATION
;
111 The following table defines actions for BltOperations:
113 <B>EfiBltVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)
114 directly to every pixel of the video display rectangle
115 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
116 Only one pixel will be used from the BltBuffer. Delta is NOT used.
118 <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle
119 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
120 the BltBuffer rectangle (DestinationX, DestinationY )
121 (DestinationX + Width, DestinationY + Height). If DestinationX or
122 DestinationY is not zero then Delta must be set to the length in bytes
123 of a row in the BltBuffer.
125 <B>EfiBltBufferToVideo</B> - Write data from the BltBuffer rectangle
126 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
127 video display rectangle (DestinationX, DestinationY)
128 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
129 not zero then Delta must be set to the length in bytes of a row in the
132 <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)
133 (SourceX + Width, SourceY + Height) .to the video display rectangle
134 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
135 The BltBuffer and Delta are not used in this mode.
137 @param This Protocol instance pointer.
138 @param BltBuffer Buffer containing data to blit into video buffer. This
139 buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
140 @param BltOperation Operation to perform on BlitBuffer and video memory
141 @param SourceX X coordinate of source for the BltBuffer.
142 @param SourceY Y coordinate of source for the BltBuffer.
143 @param DestinationX X coordinate of destination for the BltBuffer.
144 @param DestinationY Y coordinate of destination for the BltBuffer.
145 @param Width Width of rectangle in BltBuffer in pixels.
146 @param Height Height of rectangle in BltBuffer in pixels.
147 @param Delta OPTIONAL
149 @retval EFI_SUCCESS The Blt operation completed.
150 @retval EFI_INVALID_PARAMETER BltOperation is not valid.
151 @retval EFI_DEVICE_ERROR A hardware error occurred writing to the video buffer.
156 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT
) (
157 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
158 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
*BltBuffer
, OPTIONAL
159 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation
,
162 IN UINTN DestinationX
,
163 IN UINTN DestinationY
,
166 IN UINTN Delta OPTIONAL
172 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
*Info
;
174 EFI_PHYSICAL_ADDRESS FrameBufferBase
;
175 UINTN FrameBufferSize
;
176 } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
;
178 struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
{
179 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
;
180 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode
;
181 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt
;
182 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
*Mode
;
185 extern EFI_GUID gEfiGraphicsOutputProtocolGuid
;