2 UGA Draw protocol from the EFI 1.10 specification.
4 Abstraction of a very simple graphics device.
6 Copyright (c) 2006 - 2008, Intel Corporation
7 All rights reserved. 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
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.
17 #ifndef __UGA_DRAW_H__
18 #define __UGA_DRAW_H__
21 #define EFI_UGA_DRAW_PROTOCOL_GUID \
23 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
26 typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL
;
29 Return the current video mode information.
31 @param This The EFI_UGA_DRAW_PROTOCOL instance.
32 @param HorizontalResolution The size of video screen in pixels in the X dimension.
33 @param VerticalResolution The size of video screen in pixels in the Y dimension.
34 @param ColorDepth Number of bits per pixel, currently defined to be 32.
35 @param RefreshRate The refresh rate of the monitor in Hertz.
37 @retval EFI_SUCCESS Mode information returned.
38 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
39 @retval EFI_INVALID_PARAMETER One of the input args was NULL.
44 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_GET_MODE
)(
45 IN EFI_UGA_DRAW_PROTOCOL
*This
,
46 OUT UINT32
*HorizontalResolution
,
47 OUT UINT32
*VerticalResolution
,
48 OUT UINT32
*ColorDepth
,
49 OUT UINT32
*RefreshRate
53 Set the current video mode information.
55 @param This The EFI_UGA_DRAW_PROTOCOL instance.
56 @param HorizontalResolution The size of video screen in pixels in the X dimension.
57 @param VerticalResolution The size of video screen in pixels in the Y dimension.
58 @param ColorDepth Number of bits per pixel, currently defined to be 32.
59 @param RefreshRate The refresh rate of the monitor in Hertz.
61 @retval EFI_SUCCESS Mode information returned.
62 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
67 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_SET_MODE
)(
68 IN EFI_UGA_DRAW_PROTOCOL
*This
,
69 IN UINT32 HorizontalResolution
,
70 IN UINT32 VerticalResolution
,
85 } EFI_UGA_PIXEL_UNION
;
88 /// Enumration value for actions of Blt operations.
91 EfiUgaVideoFill
, ///< Write data from the BltBuffer pixel (SourceX, SourceY)
92 ///< directly to every pixel of the video display rectangle
93 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
94 ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.
96 EfiUgaVideoToBltBuffer
, ///< Read data from the video display rectangle
97 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
98 ///< the BltBuffer rectangle (DestinationX, DestinationY )
99 ///< (DestinationX + Width, DestinationY + Height). If DestinationX or
100 ///< DestinationY is not zero then Delta must be set to the length in bytes
101 ///< of a row in the BltBuffer.
103 EfiUgaBltBufferToVideo
, ///< Write data from the BltBuffer rectangle
104 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
105 ///< video display rectangle (DestinationX, DestinationY)
106 ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
107 ///< not zero then Delta must be set to the length in bytes of a row in the
110 EfiUgaVideoToVideo
, ///< Copy from the video display rectangle (SourceX, SourceY)
111 ///< (SourceX + Width, SourceY + Height) .to the video display rectangle
112 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
113 ///< The BltBuffer and Delta are not used in this mode.
115 EfiUgaBltMax
///< Maxmimum value for enumration value of Blt operation. If a Blt operation
116 ///< larger or equal to this enumration value, it is invalid.
117 } EFI_UGA_BLT_OPERATION
;
120 Blt a rectangle of pixels on the graphics screen.
122 @param[in] This - Protocol instance pointer.
123 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This
124 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
125 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory
126 @param[in] SourceX - X coordinate of source for the BltBuffer.
127 @param[in] SourceY - Y coordinate of source for the BltBuffer.
128 @param[in] DestinationX - X coordinate of destination for the BltBuffer.
129 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.
130 @param[in] Width - Width of rectangle in BltBuffer in pixels.
131 @param[in] Height - Hight of rectangle in BltBuffer in pixels.
132 @param[in] Delta - OPTIONAL
134 @retval EFI_SUCCESS - The Blt operation completed.
135 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.
136 @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.
141 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_BLT
)(
142 IN EFI_UGA_DRAW_PROTOCOL
* This
,
143 IN EFI_UGA_PIXEL
* BltBuffer
, OPTIONAL
144 IN EFI_UGA_BLT_OPERATION BltOperation
,
147 IN UINTN DestinationX
,
148 IN UINTN DestinationY
,
151 IN UINTN Delta OPTIONAL
155 /// This protocol provides a basic abstraction to set video modes and
156 /// copy pixels to and from the graphics controller's frame buffer.
158 struct _EFI_UGA_DRAW_PROTOCOL
{
159 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
;
160 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
;
161 EFI_UGA_DRAW_PROTOCOL_BLT Blt
;
164 extern EFI_GUID gEfiUgaDrawProtocolGuid
;