]>
Commit | Line | Data |
---|---|---|
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 | |
9095d37b | 6 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9df063a0 | 7 | This program and the accompanying materials\r |
c62a593c | 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 | \r |
d1f95000 | 21 | #define EFI_UGA_DRAW_PROTOCOL_GUID \\r |
22 | { \\r | |
23 | 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \\r | |
24 | }\r | |
25 | \r | |
26 | typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;\r | |
27 | \r | |
28 | /**\r | |
29 | Return the current video mode information.\r | |
30 | \r | |
35e0d11d | 31 | @param This The EFI_UGA_DRAW_PROTOCOL instance.\r |
32 | @param HorizontalResolution The size of video screen in pixels in the X dimension.\r | |
33 | @param VerticalResolution The size of video screen in pixels in the Y dimension.\r | |
34 | @param ColorDepth Number of bits per pixel, currently defined to be 32.\r | |
35 | @param RefreshRate The refresh rate of the monitor in Hertz.\r | |
d1f95000 | 36 | \r |
37 | @retval EFI_SUCCESS Mode information returned.\r | |
38 | @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r | |
39 | @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r | |
40 | \r | |
41 | **/\r | |
42 | typedef\r | |
43 | EFI_STATUS\r | |
8b13229b | 44 | (EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE)(\r |
d1f95000 | 45 | IN EFI_UGA_DRAW_PROTOCOL *This,\r |
46 | OUT UINT32 *HorizontalResolution,\r | |
47 | OUT UINT32 *VerticalResolution,\r | |
48 | OUT UINT32 *ColorDepth,\r | |
49 | OUT UINT32 *RefreshRate\r | |
ed66e1bc | 50 | );\r |
d1f95000 | 51 | \r |
52 | /**\r | |
c62a593c | 53 | Set the current video mode information.\r |
d1f95000 | 54 | \r |
35e0d11d | 55 | @param This The EFI_UGA_DRAW_PROTOCOL instance.\r |
56 | @param HorizontalResolution The size of video screen in pixels in the X dimension.\r | |
57 | @param VerticalResolution The size of video screen in pixels in the Y dimension.\r | |
58 | @param ColorDepth Number of bits per pixel, currently defined to be 32.\r | |
59 | @param RefreshRate The refresh rate of the monitor in Hertz.\r | |
d1f95000 | 60 | \r |
61 | @retval EFI_SUCCESS Mode information returned.\r | |
62 | @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r | |
63 | \r | |
64 | **/\r | |
65 | typedef\r | |
66 | EFI_STATUS\r | |
8b13229b | 67 | (EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE)(\r |
d1f95000 | 68 | IN EFI_UGA_DRAW_PROTOCOL *This,\r |
69 | IN UINT32 HorizontalResolution,\r | |
70 | IN UINT32 VerticalResolution,\r | |
71 | IN UINT32 ColorDepth,\r | |
72 | IN UINT32 RefreshRate\r | |
ed66e1bc | 73 | );\r |
d1f95000 | 74 | \r |
75 | typedef struct {\r | |
76 | UINT8 Blue;\r | |
77 | UINT8 Green;\r | |
78 | UINT8 Red;\r | |
79 | UINT8 Reserved;\r | |
80 | } EFI_UGA_PIXEL;\r | |
81 | \r | |
82 | typedef union {\r | |
83 | EFI_UGA_PIXEL Pixel;\r | |
84 | UINT32 Raw;\r | |
85 | } EFI_UGA_PIXEL_UNION;\r | |
86 | \r | |
9319d2c2 LG |
87 | ///\r |
88 | /// Enumration value for actions of Blt operations.\r | |
89 | ///\r | |
d1f95000 | 90 | typedef enum {\r |
35e0d11d | 91 | EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)\r |
92 | ///< directly to every pixel of the video display rectangle\r | |
93 | ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r | |
94 | ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.\r | |
9095d37b | 95 | \r |
35e0d11d | 96 | EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle\r |
97 | ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r | |
98 | ///< the BltBuffer rectangle (DestinationX, DestinationY )\r | |
99 | ///< (DestinationX + Width, DestinationY + Height). If DestinationX or\r | |
100 | ///< DestinationY is not zero then Delta must be set to the length in bytes\r | |
101 | ///< of a row in the BltBuffer.\r | |
9095d37b | 102 | \r |
35e0d11d | 103 | EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle\r |
104 | ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r | |
105 | ///< video display rectangle (DestinationX, DestinationY)\r | |
106 | ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r | |
107 | ///< not zero then Delta must be set to the length in bytes of a row in the\r | |
108 | ///< BltBuffer.\r | |
9095d37b | 109 | \r |
35e0d11d | 110 | EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)\r |
111 | ///< (SourceX + Width, SourceY + Height) .to the video display rectangle\r | |
112 | ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r | |
113 | ///< The BltBuffer and Delta are not used in this mode.\r | |
9095d37b | 114 | \r |
35e0d11d | 115 | EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation\r |
116 | ///< larger or equal to this enumration value, it is invalid.\r | |
d1f95000 | 117 | } EFI_UGA_BLT_OPERATION;\r |
118 | \r | |
119 | /**\r | |
35e0d11d | 120 | Blt a rectangle of pixels on the graphics screen.\r |
d1f95000 | 121 | \r |
122 | @param[in] This - Protocol instance pointer.\r | |
c62a593c | 123 | @param[in] BltBuffer - Buffer containing data to blit into video buffer. This\r |
d1f95000 | 124 | buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r |
125 | @param[in] BltOperation - Operation to perform on BlitBuffer and video memory\r | |
126 | @param[in] SourceX - X coordinate of source for the BltBuffer.\r | |
127 | @param[in] SourceY - Y coordinate of source for the BltBuffer.\r | |
128 | @param[in] DestinationX - X coordinate of destination for the BltBuffer.\r | |
129 | @param[in] DestinationY - Y coordinate of destination for the BltBuffer.\r | |
130 | @param[in] Width - Width of rectangle in BltBuffer in pixels.\r | |
131 | @param[in] Height - Hight of rectangle in BltBuffer in pixels.\r | |
132 | @param[in] Delta - OPTIONAL\r | |
c62a593c | 133 | \r |
d1f95000 | 134 | @retval EFI_SUCCESS - The Blt operation completed.\r |
135 | @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r | |
136 | @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.\r | |
137 | \r | |
bcb85cda | 138 | **/\r |
d1f95000 | 139 | typedef\r |
140 | EFI_STATUS\r | |
8b13229b | 141 | (EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT)(\r |
d1f95000 | 142 | IN EFI_UGA_DRAW_PROTOCOL * This,\r |
143 | IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL\r | |
144 | IN EFI_UGA_BLT_OPERATION BltOperation,\r | |
145 | IN UINTN SourceX,\r | |
146 | IN UINTN SourceY,\r | |
147 | IN UINTN DestinationX,\r | |
148 | IN UINTN DestinationY,\r | |
149 | IN UINTN Width,\r | |
150 | IN UINTN Height,\r | |
151 | IN UINTN Delta OPTIONAL\r | |
152 | );\r | |
153 | \r | |
44717a39 | 154 | ///\r |
9095d37b LG |
155 | /// This protocol provides a basic abstraction to set video modes and\r |
156 | /// copy pixels to and from the graphics controller's frame buffer.\r | |
44717a39 | 157 | ///\r |
d1f95000 | 158 | struct _EFI_UGA_DRAW_PROTOCOL {\r |
159 | EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;\r | |
160 | EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;\r | |
161 | EFI_UGA_DRAW_PROTOCOL_BLT Blt;\r | |
162 | };\r | |
163 | \r | |
164 | extern EFI_GUID gEfiUgaDrawProtocolGuid;\r | |
165 | \r | |
166 | #endif\r |