iPXE
UgaDraw.h
Go to the documentation of this file.
1#ifndef _IPXE_EFI_UGADRAW_H
2#define _IPXE_EFI_UGADRAW_H
3
4/** @file
5 UGA Draw protocol from the EFI 1.10 specification.
6
7 Abstraction of a very simple graphics device.
8
9 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
10 SPDX-License-Identifier: BSD-2-Clause-Patent
11
12**/
13
14#ifndef __UGA_DRAW_H__
15#define __UGA_DRAW_H__
16
17FILE_LICENCE ( BSD2_PATENT );
18FILE_SECBOOT ( PERMITTED );
19
20#define EFI_UGA_DRAW_PROTOCOL_GUID \
21 { \
22 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
23 }
24
26
27/**
28 Return the current video mode information.
29
30 @param This The EFI_UGA_DRAW_PROTOCOL instance.
31 @param HorizontalResolution The size of video screen in pixels in the X dimension.
32 @param VerticalResolution The size of video screen in pixels in the Y dimension.
33 @param ColorDepth Number of bits per pixel, currently defined to be 32.
34 @param RefreshRate The refresh rate of the monitor in Hertz.
35
36 @retval EFI_SUCCESS Mode information returned.
37 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
38 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
39
40**/
41typedef
45 OUT UINT32 *HorizontalResolution,
46 OUT UINT32 *VerticalResolution,
47 OUT UINT32 *ColorDepth,
48 OUT UINT32 *RefreshRate
49 );
50
51/**
52 Set the current video mode information.
53
54 @param This The EFI_UGA_DRAW_PROTOCOL instance.
55 @param HorizontalResolution The size of video screen in pixels in the X dimension.
56 @param VerticalResolution The size of video screen in pixels in the Y dimension.
57 @param ColorDepth Number of bits per pixel, currently defined to be 32.
58 @param RefreshRate The refresh rate of the monitor in Hertz.
59
60 @retval EFI_SUCCESS Mode information returned.
61 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
62
63**/
64typedef
68 IN UINT32 HorizontalResolution,
69 IN UINT32 VerticalResolution,
70 IN UINT32 ColorDepth,
71 IN UINT32 RefreshRate
72 );
73
80
85
86///
87/// Enumration value for actions of Blt operations.
88///
89typedef enum {
90 EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
91 ///< directly to every pixel of the video display rectangle
92 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
93 ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
94
95 EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle
96 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
97 ///< the BltBuffer rectangle (DestinationX, DestinationY )
98 ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
99 ///< DestinationY is not zero then Delta must be set to the length in bytes
100 ///< of a row in the BltBuffer.
101
102 EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle
103 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
104 ///< video display rectangle (DestinationX, DestinationY)
105 ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
106 ///< not zero then Delta must be set to the length in bytes of a row in the
107 ///< BltBuffer.
108
109 EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)
110 ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
111 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
112 ///< The BltBuffer and Delta are not used in this mode.
113
114 EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
115 ///< larger or equal to this enumration value, it is invalid.
117
118/**
119 Blt a rectangle of pixels on the graphics screen.
120
121 @param[in] This - Protocol instance pointer.
122 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
123 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
124 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
125 @param[in] SourceX - X coordinate of source for the BltBuffer.
126 @param[in] SourceY - Y coordinate of source for the BltBuffer.
127 @param[in] DestinationX - X coordinate of destination for the BltBuffer.
128 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
129 @param[in] Width - Width of rectangle in BltBuffer in pixels.
130 @param[in] Height - Hight of rectangle in BltBuffer in pixels.
131 @param[in] Delta - OPTIONAL
132
133 @retval EFI_SUCCESS - The Blt operation completed.
134 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
135 @retval EFI_DEVICE_ERROR - A hardware error occurred writting to the video buffer.
136
137**/
138typedef
142 IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
143 IN EFI_UGA_BLT_OPERATION BltOperation,
144 IN UINTN SourceX,
145 IN UINTN SourceY,
146 IN UINTN DestinationX,
147 IN UINTN DestinationY,
148 IN UINTN Width,
149 IN UINTN Height,
150 IN UINTN Delta OPTIONAL
151 );
152
153///
154/// This protocol provides a basic abstraction to set video modes and
155/// copy pixels to and from the graphics controller's frame buffer.
156///
162
164
165#endif
166
167#endif /* _IPXE_EFI_UGADRAW_H */
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
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
EFI_STATUS(EFIAPI * EFI_UGA_DRAW_PROTOCOL_SET_MODE)(IN EFI_UGA_DRAW_PROTOCOL *This, IN UINT32 HorizontalResolution, IN UINT32 VerticalResolution, IN UINT32 ColorDepth, IN UINT32 RefreshRate)
Set the current video mode information.
Definition UgaDraw.h:66
EFI_GUID gEfiUgaDrawProtocolGuid
EFI_UGA_BLT_OPERATION
Enumration value for actions of Blt operations.
Definition UgaDraw.h:89
@ EfiUgaVideoToVideo
Copy from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) ....
Definition UgaDraw.h:109
@ EfiUgaVideoToBltBuffer
Read data from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) and...
Definition UgaDraw.h:95
@ EfiUgaBltBufferToVideo
Write data from the BltBuffer rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) direct...
Definition UgaDraw.h:102
@ EfiUgaVideoFill
Write data from the BltBuffer pixel (SourceX, SourceY) directly to every pixel of the video display r...
Definition UgaDraw.h:90
@ EfiUgaBltMax
Maxmimum value for enumration value of Blt operation.
Definition UgaDraw.h:114
EFI_STATUS(EFIAPI * EFI_UGA_DRAW_PROTOCOL_GET_MODE)(IN EFI_UGA_DRAW_PROTOCOL *This, OUT UINT32 *HorizontalResolution, OUT UINT32 *VerticalResolution, OUT UINT32 *ColorDepth, OUT UINT32 *RefreshRate)
Return the current video mode information.
Definition UgaDraw.h:43
struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL
Definition UgaDraw.h:25
EFI_STATUS(EFIAPI * EFI_UGA_DRAW_PROTOCOL_BLT)(IN EFI_UGA_DRAW_PROTOCOL *This, IN EFI_UGA_PIXEL *BltBuffer OPTIONAL, IN EFI_UGA_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.
Definition UgaDraw.h:140
#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
UINT8 Reserved
Definition UgaDraw.h:78
UINT8 Blue
Definition UgaDraw.h:75
UINT8 Green
Definition UgaDraw.h:76
UINT8 Red
Definition UgaDraw.h:77
This protocol provides a basic abstraction to set video modes and copy pixels to and from the graphic...
Definition UgaDraw.h:157
EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
Definition UgaDraw.h:159
EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
Definition UgaDraw.h:158
EFI_UGA_DRAW_PROTOCOL_BLT Blt
Definition UgaDraw.h:160
EFI_UGA_PIXEL Pixel
Definition UgaDraw.h:82