]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UgaDraw.h
Code Scrub for Protocol and Ppi Definition
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaDraw.h
CommitLineData
d1f95000 1/** @file\r
8a7d75b0 2 UGA Draw protocol from the EFI 1.10 specification.\r
d1f95000 3\r
4 Abstraction of a very simple graphics device.\r
5\r
c62a593c 6 Copyright (c) 2006, Intel Corporation\r
7 All rights reserved. This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
d1f95000 11\r
c62a593c 12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
d1f95000 14\r
d1f95000 15**/\r
16\r
17#ifndef __UGA_DRAW_H__\r
18#define __UGA_DRAW_H__\r
19\r
3f748e52 20#include <PiDxe.h>\r
21\r
22\r
d1f95000 23#define EFI_UGA_DRAW_PROTOCOL_GUID \\r
24 { \\r
25 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \\r
26 }\r
27\r
28typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;\r
29\r
30/**\r
31 Return the current video mode information.\r
32\r
33 @param This Protocol instance pointer.\r
34 @param HorizontalResolution Current video horizontal resolution in pixels\r
35 @param VerticalResolution Current video vertical resolution in pixels\r
36 @param ColorDepth Current video color depth in bits per pixel\r
37 @param RefreshRate Current video refresh rate in Hz.\r
38\r
39 @retval EFI_SUCCESS Mode information returned.\r
40 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
41 @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
42\r
43**/\r
44typedef\r
45EFI_STATUS\r
8b13229b 46(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE)(\r
d1f95000 47 IN EFI_UGA_DRAW_PROTOCOL *This,\r
48 OUT UINT32 *HorizontalResolution,\r
49 OUT UINT32 *VerticalResolution,\r
50 OUT UINT32 *ColorDepth,\r
51 OUT UINT32 *RefreshRate\r
52 )\r
53;\r
54\r
55/**\r
c62a593c 56 Set the current video mode information.\r
d1f95000 57\r
58 @param This Protocol instance pointer.\r
59 @param HorizontalResolution Current video horizontal resolution in pixels\r
60 @param VerticalResolution Current video vertical resolution in pixels\r
61 @param ColorDepth Current video color depth in bits per pixel\r
62 @param RefreshRate Current video refresh rate in Hz.\r
63\r
64 @retval EFI_SUCCESS Mode information returned.\r
65 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
66\r
67**/\r
68typedef\r
69EFI_STATUS\r
8b13229b 70(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE)(\r
d1f95000 71 IN EFI_UGA_DRAW_PROTOCOL *This,\r
72 IN UINT32 HorizontalResolution,\r
73 IN UINT32 VerticalResolution,\r
74 IN UINT32 ColorDepth,\r
75 IN UINT32 RefreshRate\r
76 )\r
77;\r
78\r
79typedef struct {\r
80 UINT8 Blue;\r
81 UINT8 Green;\r
82 UINT8 Red;\r
83 UINT8 Reserved;\r
84} EFI_UGA_PIXEL;\r
85\r
86typedef union {\r
87 EFI_UGA_PIXEL Pixel;\r
88 UINT32 Raw;\r
89} EFI_UGA_PIXEL_UNION;\r
90\r
91typedef enum {\r
92 EfiUgaVideoFill,\r
93 EfiUgaVideoToBltBuffer,\r
94 EfiUgaBltBufferToVideo,\r
95 EfiUgaVideoToVideo,\r
96 EfiUgaBltMax\r
97} EFI_UGA_BLT_OPERATION;\r
98\r
99/**\r
100 Type specifying a pointer to a function to perform an UGA Blt operation.\r
101\r
102 The following table defines actions for BltOperations:\r
103\r
c62a593c 104 <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)\r
105 directly to every pixel of the video display rectangle\r
106 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
d1f95000 107 Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
108\r
c62a593c 109 <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle\r
110 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r
111 the BltBuffer rectangle (DestinationX, DestinationY )\r
112 (DestinationX + Width, DestinationY + Height). If DestinationX or\r
113 DestinationY is not zero then Delta must be set to the length in bytes\r
d1f95000 114 of a row in the BltBuffer.\r
115\r
c62a593c 116 <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle\r
117 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r
118 video display rectangle (DestinationX, DestinationY)\r
119 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r
120 not zero then Delta must be set to the length in bytes of a row in the\r
d1f95000 121 BltBuffer.\r
122\r
123 <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
c62a593c 124 (SourceX + Width, SourceY + Height) .to the video display rectangle\r
125 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
d1f95000 126 The BltBuffer and Delta are not used in this mode.\r
127\r
128\r
129 @param[in] This - Protocol instance pointer.\r
c62a593c 130 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This\r
d1f95000 131 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
132 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory\r
133 @param[in] SourceX - X coordinate of source for the BltBuffer.\r
134 @param[in] SourceY - Y coordinate of source for the BltBuffer.\r
135 @param[in] DestinationX - X coordinate of destination for the BltBuffer.\r
136 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.\r
137 @param[in] Width - Width of rectangle in BltBuffer in pixels.\r
138 @param[in] Height - Hight of rectangle in BltBuffer in pixels.\r
139 @param[in] Delta - OPTIONAL\r
c62a593c 140\r
d1f95000 141 @retval EFI_SUCCESS - The Blt operation completed.\r
142 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r
143 @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.\r
144\r
145--*/\r
146typedef\r
147EFI_STATUS\r
8b13229b 148(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT)(\r
d1f95000 149 IN EFI_UGA_DRAW_PROTOCOL * This,\r
150 IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL\r
151 IN EFI_UGA_BLT_OPERATION BltOperation,\r
152 IN UINTN SourceX,\r
153 IN UINTN SourceY,\r
154 IN UINTN DestinationX,\r
155 IN UINTN DestinationY,\r
156 IN UINTN Width,\r
157 IN UINTN Height,\r
158 IN UINTN Delta OPTIONAL\r
159 );\r
160\r
4ca9b6c4
LG
161/** \r
162 This protocol provides a basic abstraction to set video modes and \r
163 copy pixels to and from the graphics controller's frame buffer. \r
164\r
165 @par Protocol Description:\r
166 The EFI_UGA_DRAW_PROTOCOL provides a software abstraction to allow pixels to be drawn\r
167 directly to the frame buffer. The EFI_UGA_DRAW_PROTOCOL is designed to be lightweight and\r
168 to support the basic needs of graphics output prior to Operating System boot. \r
169\r
170 @param GetMode \r
171 Returns information about the geometry and configuration of the\r
172 graphics controller's current frame buffer configuration.\r
173\r
174 @param SetMode \r
175 Set the graphics device into a given mode and clears the frame buffer to black.\r
176\r
177 @param Blt \r
178 Software abstraction to draw on the video device's frame buffer. \r
179**/\r
d1f95000 180struct _EFI_UGA_DRAW_PROTOCOL {\r
181 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;\r
182 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;\r
183 EFI_UGA_DRAW_PROTOCOL_BLT Blt;\r
184};\r
185\r
186extern EFI_GUID gEfiUgaDrawProtocolGuid;\r
187\r
188#endif\r