]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/C/Include/Protocol/UgaDraw.h
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / C / Include / Protocol / UgaDraw.h
CommitLineData
30fdf114
LG
1/** @file\r
2 UGA Draw protocol from the EFI 1.1 specification.\r
3\r
4 Abstraction of a very simple graphics device.\r
5\r
f7496d71 6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
30fdf114 7\r
2e351cbe 8 SPDX-License-Identifier: BSD-2-Clause-Patent\r
30fdf114 9\r
30fdf114
LG
10**/\r
11\r
12#ifndef __UGA_DRAW_H__\r
13#define __UGA_DRAW_H__\r
14\r
15#define EFI_UGA_DRAW_PROTOCOL_GUID \\r
16 { \\r
17 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \\r
18 }\r
19\r
20typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;\r
21\r
22/**\r
23 Return the current video mode information.\r
24\r
25 @param This Protocol instance pointer.\r
26 @param HorizontalResolution Current video horizontal resolution in pixels\r
27 @param VerticalResolution Current video vertical resolution in pixels\r
28 @param ColorDepth Current video color depth in bits per pixel\r
29 @param RefreshRate Current video refresh rate in Hz.\r
30\r
31 @retval EFI_SUCCESS Mode information returned.\r
32 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
33 @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
34\r
35**/\r
36typedef\r
37EFI_STATUS\r
38(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE) (\r
39 IN EFI_UGA_DRAW_PROTOCOL *This,\r
40 OUT UINT32 *HorizontalResolution,\r
41 OUT UINT32 *VerticalResolution,\r
42 OUT UINT32 *ColorDepth,\r
43 OUT UINT32 *RefreshRate\r
44 )\r
45;\r
46\r
47/**\r
48 Return the current video mode information.\r
49\r
50 @param This Protocol instance pointer.\r
51 @param HorizontalResolution Current video horizontal resolution in pixels\r
52 @param VerticalResolution Current video vertical resolution in pixels\r
53 @param ColorDepth Current video color depth in bits per pixel\r
54 @param RefreshRate Current video refresh rate in Hz.\r
55\r
56 @retval EFI_SUCCESS Mode information returned.\r
57 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
58\r
59**/\r
60typedef\r
61EFI_STATUS\r
62(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (\r
63 IN EFI_UGA_DRAW_PROTOCOL *This,\r
64 IN UINT32 HorizontalResolution,\r
65 IN UINT32 VerticalResolution,\r
66 IN UINT32 ColorDepth,\r
67 IN UINT32 RefreshRate\r
68 )\r
69;\r
70\r
71typedef struct {\r
72 UINT8 Blue;\r
73 UINT8 Green;\r
74 UINT8 Red;\r
75 UINT8 Reserved;\r
76} EFI_UGA_PIXEL;\r
77\r
78typedef union {\r
79 EFI_UGA_PIXEL Pixel;\r
80 UINT32 Raw;\r
81} EFI_UGA_PIXEL_UNION;\r
82\r
83typedef enum {\r
84 EfiUgaVideoFill,\r
85 EfiUgaVideoToBltBuffer,\r
86 EfiUgaBltBufferToVideo,\r
87 EfiUgaVideoToVideo,\r
88 EfiUgaBltMax\r
89} EFI_UGA_BLT_OPERATION;\r
90\r
91/**\r
92 Type specifying a pointer to a function to perform an UGA Blt operation.\r
93\r
94 The following table defines actions for BltOperations:\r
95\r
f7496d71
LG
96 <B>EfiUgaVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY)\r
97 directly to every pixel of the video display rectangle\r
98 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
30fdf114
LG
99 Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
100\r
f7496d71
LG
101 <B>EfiUgaVideoToBltBuffer</B> - Read data from the video display rectangle\r
102 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r
103 the BltBuffer rectangle (DestinationX, DestinationY )\r
104 (DestinationX + Width, DestinationY + Height). If DestinationX or\r
105 DestinationY is not zero then Delta must be set to the length in bytes\r
30fdf114
LG
106 of a row in the BltBuffer.\r
107\r
f7496d71
LG
108 <B>EfiUgaBltBufferToVideo</B> - Write data from the BltBuffer rectangle\r
109 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r
110 video display rectangle (DestinationX, DestinationY)\r
111 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r
112 not zero then Delta must be set to the length in bytes of a row in the\r
30fdf114
LG
113 BltBuffer.\r
114\r
115 <B>EfiUgaVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
f7496d71
LG
116 (SourceX + Width, SourceY + Height) .to the video display rectangle\r
117 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
30fdf114
LG
118 The BltBuffer and Delta are not used in this mode.\r
119\r
120\r
121 @param[in] This - Protocol instance pointer.\r
f7496d71 122 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This\r
30fdf114
LG
123 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
124 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory\r
125 @param[in] SourceX - X coordinate of source for the BltBuffer.\r
126 @param[in] SourceY - Y coordinate of source for the BltBuffer.\r
127 @param[in] DestinationX - X coordinate of destination for the BltBuffer.\r
128 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.\r
129 @param[in] Width - Width of rectangle in BltBuffer in pixels.\r
fb0b35e0 130 @param[in] Height - Height of rectangle in BltBuffer in pixels.\r
30fdf114 131 @param[in] Delta - OPTIONAL\r
f7496d71 132\r
30fdf114
LG
133 @retval EFI_SUCCESS - The Blt operation completed.\r
134 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r
fb0b35e0 135 @retval EFI_DEVICE_ERROR - A hardware error occurred writing to the video buffer.\r
30fdf114
LG
136\r
137--*/\r
138typedef\r
139EFI_STATUS\r
140(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT) (\r
141 IN EFI_UGA_DRAW_PROTOCOL * This,\r
142 IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL\r
143 IN EFI_UGA_BLT_OPERATION BltOperation,\r
144 IN UINTN SourceX,\r
145 IN UINTN SourceY,\r
146 IN UINTN DestinationX,\r
147 IN UINTN DestinationY,\r
148 IN UINTN Width,\r
149 IN UINTN Height,\r
150 IN UINTN Delta OPTIONAL\r
151 );\r
152\r
153struct _EFI_UGA_DRAW_PROTOCOL {\r
154 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;\r
155 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;\r
156 EFI_UGA_DRAW_PROTOCOL_BLT Blt;\r
157};\r
158\r
159extern EFI_GUID gEfiUgaDrawProtocolGuid;\r
160\r
161#endif\r