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