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 - 2008, Intel Corporation. All rights reserved.<BR>
7  This program and the accompanying materials
8  are licensed and made available under the terms and conditions of the BSD License
9  which accompanies this distribution. The full text of the license may be found at
10  http://opensource.org/licenses/bsd-license.php
11 
12  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 
15 **/
16 
17 #ifndef __UGA_DRAW_H__
18 #define __UGA_DRAW_H__
19 
20 FILE_LICENCE ( BSD3 );
21 
22 
23 #define EFI_UGA_DRAW_PROTOCOL_GUID \
24  { \
25  0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
26  }
27 
29 
30 /**
31  Return the current video mode information.
32 
33  @param This The EFI_UGA_DRAW_PROTOCOL instance.
34  @param HorizontalResolution The size of video screen in pixels in the X dimension.
35  @param VerticalResolution The size of video screen in pixels in the Y dimension.
36  @param ColorDepth Number of bits per pixel, currently defined to be 32.
37  @param RefreshRate The refresh rate of the monitor in Hertz.
38 
39  @retval EFI_SUCCESS Mode information returned.
40  @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
41  @retval EFI_INVALID_PARAMETER One of the input args was NULL.
42 
43 **/
44 typedef
48  OUT UINT32 *HorizontalResolution,
49  OUT UINT32 *VerticalResolution,
50  OUT UINT32 *ColorDepth,
51  OUT UINT32 *RefreshRate
52  );
53 
54 /**
55  Set the current video mode information.
56 
57  @param This The EFI_UGA_DRAW_PROTOCOL instance.
58  @param HorizontalResolution The size of video screen in pixels in the X dimension.
59  @param VerticalResolution The size of video screen in pixels in the Y dimension.
60  @param ColorDepth Number of bits per pixel, currently defined to be 32.
61  @param RefreshRate The refresh rate of the monitor in Hertz.
62 
63  @retval EFI_SUCCESS Mode information returned.
64  @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
65 
66 **/
67 typedef
71  IN UINT32 HorizontalResolution,
72  IN UINT32 VerticalResolution,
73  IN UINT32 ColorDepth,
74  IN UINT32 RefreshRate
75  );
76 
77 typedef struct {
83 
84 typedef union {
88 
89 ///
90 /// Enumration value for actions of Blt operations.
91 ///
92 typedef enum {
93  EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
94  ///< directly to every pixel of the video display rectangle
95  ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
96  ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
97 
98  EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle
99  ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
100  ///< the BltBuffer rectangle (DestinationX, DestinationY )
101  ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
102  ///< DestinationY is not zero then Delta must be set to the length in bytes
103  ///< of a row in the BltBuffer.
104 
105  EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle
106  ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
107  ///< video display rectangle (DestinationX, DestinationY)
108  ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
109  ///< not zero then Delta must be set to the length in bytes of a row in the
110  ///< BltBuffer.
111 
112  EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)
113  ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
114  ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
115  ///< The BltBuffer and Delta are not used in this mode.
116 
117  EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation
118  ///< larger or equal to this enumration value, it is invalid.
120 
121 /**
122  Blt a rectangle of pixels on the graphics screen.
123 
124  @param[in] This - Protocol instance pointer.
125  @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
126  buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
127  @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
128  @param[in] SourceX - X coordinate of source for the BltBuffer.
129  @param[in] SourceY - Y coordinate of source for the BltBuffer.
130  @param[in] DestinationX - X coordinate of destination for the BltBuffer.
131  @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
132  @param[in] Width - Width of rectangle in BltBuffer in pixels.
133  @param[in] Height - Hight of rectangle in BltBuffer in pixels.
134  @param[in] Delta - OPTIONAL
135 
136  @retval EFI_SUCCESS - The Blt operation completed.
137  @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
138  @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
139 
140 **/
141 typedef
144  IN EFI_UGA_DRAW_PROTOCOL * This,
145  IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL
146  IN EFI_UGA_BLT_OPERATION BltOperation,
147  IN UINTN SourceX,
148  IN UINTN SourceY,
149  IN UINTN DestinationX,
150  IN UINTN DestinationY,
151  IN UINTN Width,
152  IN UINTN Height,
153  IN UINTN Delta OPTIONAL
154  );
155 
156 ///
157 /// This protocol provides a basic abstraction to set video modes and
158 /// copy pixels to and from the graphics controller's frame buffer.
159 ///
164 };
165 
167 
168 #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:340
Write data from the BltBuffer rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) direct...
Definition: UgaDraw.h:105
Read data from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) and...
Definition: UgaDraw.h:98
Write data from the BltBuffer pixel (SourceX, SourceY) directly to every pixel of the video display r...
Definition: UgaDraw.h:93
UINT8 Red
Definition: UgaDraw.h:80
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
EFI_UGA_DRAW_PROTOCOL_BLT Blt
Definition: UgaDraw.h:163
EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
Definition: UgaDraw.h:162
EFI_GUID gEfiUgaDrawProtocolGuid
unsigned int UINT32
Definition: ProcessorBind.h:56
This protocol provides a basic abstraction to set video modes and copy pixels to and from the graphic...
Definition: UgaDraw.h:160
unsigned char UINT8
Definition: ProcessorBind.h:62
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:46
EFI_UGA_BLT_OPERATION
Enumration value for actions of Blt operations.
Definition: UgaDraw.h:92
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:69
UINT8 Green
Definition: UgaDraw.h:79
#define OUT
Definition: mlx_utils.h:29
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:143
#define EFIAPI
EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
Definition: UgaDraw.h:161
UINT8 Blue
Definition: UgaDraw.h:78
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
Maxmimum value for enumration value of Blt operation.
Definition: UgaDraw.h:117
#define IN
Definition: mlx_utils.h:28
FILE_LICENCE(BSD3)
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
Copy from the video display rectangle (SourceX, SourceY) (SourceX + Width, SourceY + Height) ....
Definition: UgaDraw.h:112
EFI_UGA_PIXEL Pixel
Definition: UgaDraw.h:85
UINT8 Reserved
Definition: UgaDraw.h:81