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 
17 FILE_LICENCE ( BSD2_PATENT );
18 
19 #define EFI_UGA_DRAW_PROTOCOL_GUID \
20  { \
21  0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
22  }
23 
25 
26 /**
27  Return the current video mode information.
28 
29  @param This The EFI_UGA_DRAW_PROTOCOL instance.
30  @param HorizontalResolution The size of video screen in pixels in the X dimension.
31  @param VerticalResolution The size of video screen in pixels in the Y dimension.
32  @param ColorDepth Number of bits per pixel, currently defined to be 32.
33  @param RefreshRate The refresh rate of the monitor in Hertz.
34 
35  @retval EFI_SUCCESS Mode information returned.
36  @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
37  @retval EFI_INVALID_PARAMETER One of the input args was NULL.
38 
39 **/
40 typedef
44  OUT UINT32 *HorizontalResolution,
45  OUT UINT32 *VerticalResolution,
46  OUT UINT32 *ColorDepth,
47  OUT UINT32 *RefreshRate
48  );
49 
50 /**
51  Set the current video mode information.
52 
53  @param This The EFI_UGA_DRAW_PROTOCOL instance.
54  @param HorizontalResolution The size of video screen in pixels in the X dimension.
55  @param VerticalResolution The size of video screen in pixels in the Y dimension.
56  @param ColorDepth Number of bits per pixel, currently defined to be 32.
57  @param RefreshRate The refresh rate of the monitor in Hertz.
58 
59  @retval EFI_SUCCESS Mode information returned.
60  @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
61 
62 **/
63 typedef
67  IN UINT32 HorizontalResolution,
68  IN UINT32 VerticalResolution,
69  IN UINT32 ColorDepth,
70  IN UINT32 RefreshRate
71  );
72 
73 typedef struct {
79 
80 typedef union {
84 
85 ///
86 /// Enumration value for actions of Blt operations.
87 ///
88 typedef enum {
89  EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
90  ///< directly to every pixel of the video display rectangle
91  ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
92  ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
93 
94  EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle
95  ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
96  ///< the BltBuffer rectangle (DestinationX, DestinationY )
97  ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
98  ///< DestinationY is not zero then Delta must be set to the length in bytes
99  ///< of a row in the BltBuffer.
100 
101  EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle
102  ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
103  ///< video display rectangle (DestinationX, DestinationY)
104  ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
105  ///< not zero then Delta must be set to the length in bytes of a row in the
106  ///< BltBuffer.
107 
108  EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)
109  ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
110  ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
111  ///< The BltBuffer and Delta are not used in this mode.
112 
113  EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
114  ///< larger or equal to this enumration value, it is invalid.
116 
117 /**
118  Blt a rectangle of pixels on the graphics screen.
119 
120  @param[in] This - Protocol instance pointer.
121  @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
122  buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
123  @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
124  @param[in] SourceX - X coordinate of source for the BltBuffer.
125  @param[in] SourceY - Y coordinate of source for the BltBuffer.
126  @param[in] DestinationX - X coordinate of destination for the BltBuffer.
127  @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
128  @param[in] Width - Width of rectangle in BltBuffer in pixels.
129  @param[in] Height - Hight of rectangle in BltBuffer in pixels.
130  @param[in] Delta - OPTIONAL
131 
132  @retval EFI_SUCCESS - The Blt operation completed.
133  @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
134  @retval EFI_DEVICE_ERROR - A hardware error occurred writting to the video buffer.
135 
136 **/
137 typedef
141  IN EFI_UGA_PIXEL *BltBuffer OPTIONAL,
142  IN EFI_UGA_BLT_OPERATION BltOperation,
143  IN UINTN SourceX,
144  IN UINTN SourceY,
145  IN UINTN DestinationX,
146  IN UINTN DestinationY,
147  IN UINTN Width,
148  IN UINTN Height,
149  IN UINTN Delta OPTIONAL
150  );
151 
152 ///
153 /// This protocol provides a basic abstraction to set video modes and
154 /// copy pixels to and from the graphics controller's frame buffer.
155 ///
160 };
161 
163 
164 #endif
165 
166 #endif /* _IPXE_EFI_UGADRAW_H */
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition: Base.h:292
Write data from the BltBuffer rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) direct...
Definition: UgaDraw.h:101
Read data from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) and...
Definition: UgaDraw.h:94
Write data from the BltBuffer pixel (SourceX, SourceY) directly to every pixel of the video display r...
Definition: UgaDraw.h:89
UINT8 Red
Definition: UgaDraw.h:76
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
EFI_UGA_DRAW_PROTOCOL_BLT Blt
Definition: UgaDraw.h:159
EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
Definition: UgaDraw.h:158
EFI_GUID gEfiUgaDrawProtocolGuid
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:139
unsigned int UINT32
Definition: ProcessorBind.h:98
This protocol provides a basic abstraction to set video modes and copy pixels to and from the graphic...
Definition: UgaDraw.h:156
unsigned char UINT8
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:42
EFI_UGA_BLT_OPERATION
Enumration value for actions of Blt operations.
Definition: UgaDraw.h:88
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:65
UINT8 Green
Definition: UgaDraw.h:75
FILE_LICENCE(BSD2_PATENT)
#define OUT
Definition: mlx_utils.h:29
#define EFIAPI
EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
Definition: UgaDraw.h:157
UINT8 Blue
Definition: UgaDraw.h:74
UINT64 UINTN
Unsigned value of native width.
Maxmimum value for enumration value of Blt operation.
Definition: UgaDraw.h:113
#define IN
Definition: mlx_utils.h:28
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
Copy from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) ....
Definition: UgaDraw.h:108
EFI_UGA_PIXEL Pixel
Definition: UgaDraw.h:81
UINT8 Reserved
Definition: UgaDraw.h:77