]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/GraphicsOutput.h
Update the Guid Value of Ext SCSI Pass Thru Protocol
[mirror_edk2.git] / MdePkg / Include / Protocol / GraphicsOutput.h
CommitLineData
878ddf1f 1/** @file\r
2 Graphics Output Protocol from the UEFI 2.0 specification.\r
3\r
4 Abstraction of a very simple graphics device.\r
5\r
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
11\r
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
14\r
15 Module Name: GraphicsOutput.h\r
16\r
17**/\r
18\r
19#ifndef __GRAPHICS_OUTPUT_H__\r
20#define __GRAPHICS_OUTPUT_H__\r
21\r
22#define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \\r
23 { \\r
24 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a } \\r
25 }\r
26\r
27typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL;\r
28\r
29typedef struct {\r
30 UINT32 RedMask;\r
31 UINT32 GreenMask;\r
32 UINT32 BlueMask;\r
33 UINT32 ReservedMask;\r
34} EFI_PIXEL_BITMASK;\r
35\r
36typedef enum {\r
37 PixelRedGreenBlueReserved8BitPerColor,\r
38 PixelBlueGreenRedReserved8BitPerColor,\r
39 PixelBitMask,\r
40 PixelBltOnly,\r
41 PixelFormatMax\r
42} EFI_GRAPHICS_PIXEL_FORMAT;\r
43\r
44typedef struct {\r
45 UINT32 Version;\r
46 UINT32 HorizontalResolution;\r
47 UINT32 VerticalResolution;\r
48 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;\r
49 EFI_PIXEL_BITMASK PixelInformation;\r
50 UINT32 PixelsPerScanLine;\r
51} EFI_GRAPHICS_OUTPUT_MODE_INFORMATION;\r
52\r
53/**\r
54 Return the current video mode information.\r
55\r
56 @param This Protocol instance pointer.\r
57 @param ModeNumber The mode number to return information on.\r
58 @param SizeOfInfo A pointer to the size, in bytes, of the Info buffer.\r
59 @param Info A pointer to callee allocated buffer that returns information about ModeNumber.\r
60\r
61 @retval EFI_SUCCESS Mode information returned.\r
62 @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.\r
63 @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the video mode.\r
64 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
65 @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
66\r
67**/\r
68typedef\r
69EFI_STATUS\r
70(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE) (\r
71 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
72 IN UINT32 ModeNumber,\r
73 OUT UINTN *SizeOfInfo,\r
74 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info\r
75 )\r
76;\r
77\r
78/**\r
79 Return the current video mode information.\r
80\r
81 @param This Protocol instance pointer.\r
82 @param ModeNumber The mode number to be set.\r
83\r
84 @retval EFI_SUCCESS Graphics mode was changed.\r
85 @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
86 @retval EFI_UNSUPPORTED ModeNumber is not supported by this device.\r
87\r
88**/\r
89typedef\r
90EFI_STATUS\r
91(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE) (\r
92 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
93 IN UINT32 ModeNumber\r
94 )\r
95;\r
96\r
97typedef struct {\r
98 UINT8 Blue;\r
99 UINT8 Green;\r
100 UINT8 Red;\r
101 UINT8 Reserved;\r
102} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;\r
103\r
104typedef union {\r
105 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel;\r
106 UINT32 Raw;\r
107} EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION;\r
108\r
109typedef enum {\r
110 EfiBltVideoFill,\r
111 EfiBltVideoToBltBuffer,\r
112 EfiBltBufferToVideo, \r
113 EfiBltVideoToVideo,\r
114 EfiGraphicsOutputBltOperationMax\r
115} EFI_GRAPHICS_OUTPUT_BLT_OPERATION;\r
116\r
117/**\r
118 The following table defines actions for BltOperations:\r
119\r
120 <B>EfiBltVideoFill</B> - Write data from the BltBuffer pixel (SourceX, SourceY) \r
121 directly to every pixel of the video display rectangle \r
122 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
123 Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
124\r
125 <B>EfiBltVideoToBltBuffer</B> - Read data from the video display rectangle \r
126 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in \r
127 the BltBuffer rectangle (DestinationX, DestinationY ) \r
128 (DestinationX + Width, DestinationY + Height). If DestinationX or \r
129 DestinationY is not zero then Delta must be set to the length in bytes \r
130 of a row in the BltBuffer.\r
131\r
132 <B>EfiBltBufferToVideo</B> - Write data from the BltBuffer rectangle \r
133 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the \r
134 video display rectangle (DestinationX, DestinationY) \r
135 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is \r
136 not zero then Delta must be set to the length in bytes of a row in the \r
137 BltBuffer.\r
138\r
139 <B>EfiBltVideoToVideo</B> - Copy from the video display rectangle (SourceX, SourceY)\r
140 (SourceX + Width, SourceY + Height) .to the video display rectangle \r
141 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height). \r
142 The BltBuffer and Delta are not used in this mode.\r
143\r
144 @param This Protocol instance pointer.\r
145 @param BltBuffer Buffer containing data to blit into video buffer. This\r
146 buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
147 @param BltOperation Operation to perform on BlitBuffer and video memory\r
148 @param SourceX X coordinate of source for the BltBuffer.\r
149 @param SourceY Y coordinate of source for the BltBuffer.\r
150 @param DestinationX X coordinate of destination for the BltBuffer.\r
151 @param DestinationY Y coordinate of destination for the BltBuffer.\r
152 @param Width Width of rectangle in BltBuffer in pixels.\r
153 @param Height Hight of rectangle in BltBuffer in pixels.\r
154 @param Delta OPTIONAL\r
155\r
156 @retval EFI_SUCCESS The Blt operation completed.\r
157 @retval EFI_INVALID_PARAMETER BltOperation is not valid.\r
158 @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer.\r
159\r
160**/\r
161typedef\r
162EFI_STATUS\r
163(EFIAPI *EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT) (\r
164 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,\r
165 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL\r
166 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,\r
167 IN UINTN SourceX,\r
168 IN UINTN SourceY,\r
169 IN UINTN DestinationX,\r
170 IN UINTN DestinationY,\r
171 IN UINTN Width,\r
172 IN UINTN Height,\r
173 IN UINTN Delta OPTIONAL\r
174 );\r
175\r
176typedef struct {\r
177 UINT32 MaxMode;\r
178 UINT32 Mode;\r
179 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;\r
180 UINTN SizeOfInfo;\r
181 EFI_PHYSICAL_ADDRESS FrameBufferBase;\r
182 UINTN FrameBufferSize;\r
183} EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE;\r
184\r
185struct _EFI_GRAPHICS_OUTPUT_PROTOCOL {\r
186 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;\r
187 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode;\r
188 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt;\r
189 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;\r
190};\r
191\r
192extern EFI_GUID gEfiGraphicsOutputProtocolGuid;\r
193\r
194#endif\r