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