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