2 UGA Draw protocol from the EFI 1.10 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 __UGA_DRAW_H__
12 #define __UGA_DRAW_H__
15 #define EFI_UGA_DRAW_PROTOCOL_GUID \
17 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
20 typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL
;
23 Return the current video mode information.
25 @param This The EFI_UGA_DRAW_PROTOCOL instance.
26 @param HorizontalResolution The size of video screen in pixels in the X dimension.
27 @param VerticalResolution The size of video screen in pixels in the Y dimension.
28 @param ColorDepth Number of bits per pixel, currently defined to be 32.
29 @param RefreshRate The refresh rate of the monitor in Hertz.
31 @retval EFI_SUCCESS Mode information returned.
32 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
33 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
38 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_GET_MODE
)(
39 IN EFI_UGA_DRAW_PROTOCOL
*This
,
40 OUT UINT32
*HorizontalResolution
,
41 OUT UINT32
*VerticalResolution
,
42 OUT UINT32
*ColorDepth
,
43 OUT UINT32
*RefreshRate
47 Set the current video mode information.
49 @param This The EFI_UGA_DRAW_PROTOCOL instance.
50 @param HorizontalResolution The size of video screen in pixels in the X dimension.
51 @param VerticalResolution The size of video screen in pixels in the Y dimension.
52 @param ColorDepth Number of bits per pixel, currently defined to be 32.
53 @param RefreshRate The refresh rate of the monitor in Hertz.
55 @retval EFI_SUCCESS Mode information returned.
56 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
61 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_SET_MODE
)(
62 IN EFI_UGA_DRAW_PROTOCOL
*This
,
63 IN UINT32 HorizontalResolution
,
64 IN UINT32 VerticalResolution
,
79 } EFI_UGA_PIXEL_UNION
;
82 /// Enumration value for actions of Blt operations.
85 EfiUgaVideoFill
, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
86 ///< directly to every pixel of the video display rectangle
87 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
88 ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
90 EfiUgaVideoToBltBuffer
, ///< Read data from the video display rectangle
91 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
92 ///< the BltBuffer rectangle (DestinationX, DestinationY )
93 ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
94 ///< DestinationY is not zero then Delta must be set to the length in bytes
95 ///< of a row in the BltBuffer.
97 EfiUgaBltBufferToVideo
, ///< Write data from the BltBuffer rectangle
98 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
99 ///< video display rectangle (DestinationX, DestinationY)
100 ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
101 ///< not zero then Delta must be set to the length in bytes of a row in the
104 EfiUgaVideoToVideo
, ///< Copy from the video display rectangle (SourceX, SourceY)
105 ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
106 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
107 ///< The BltBuffer and Delta are not used in this mode.
109 EfiUgaBltMax
///< Maxmimum value for enumration value of Blt operation. If a Blt operation
110 ///< larger or equal to this enumration value, it is invalid.
111 } EFI_UGA_BLT_OPERATION
;
114 Blt a rectangle of pixels on the graphics screen.
116 @param[in] This - Protocol instance pointer.
117 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
118 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
119 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
120 @param[in] SourceX - X coordinate of source for the BltBuffer.
121 @param[in] SourceY - Y coordinate of source for the BltBuffer.
122 @param[in] DestinationX - X coordinate of destination for the BltBuffer.
123 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
124 @param[in] Width - Width of rectangle in BltBuffer in pixels.
125 @param[in] Height - Hight of rectangle in BltBuffer in pixels.
126 @param[in] Delta - OPTIONAL
128 @retval EFI_SUCCESS - The Blt operation completed.
129 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
130 @retval EFI_DEVICE_ERROR - A hardware error occurred writting to the video buffer.
135 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_BLT
)(
136 IN EFI_UGA_DRAW_PROTOCOL
* This
,
137 IN EFI_UGA_PIXEL
* BltBuffer OPTIONAL
,
138 IN EFI_UGA_BLT_OPERATION BltOperation
,
141 IN UINTN DestinationX
,
142 IN UINTN DestinationY
,
145 IN UINTN Delta OPTIONAL
149 /// This protocol provides a basic abstraction to set video modes and
150 /// copy pixels to and from the graphics controller's frame buffer.
152 struct _EFI_UGA_DRAW_PROTOCOL
{
153 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
;
154 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
;
155 EFI_UGA_DRAW_PROTOCOL_BLT Blt
;
158 extern EFI_GUID gEfiUgaDrawProtocolGuid
;