3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Graphics Output Protocol from the UEFI 2.0 specification.
20 Abstraction of a very simple graphics device.
24 #ifndef __GRAPHICS_OUTPUT_H__
25 #define __GRAPHICS_OUTPUT_H__
27 #include EFI_PROTOCOL_DEFINITION (UgaDraw)
29 #define EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID \
31 0x9042a9de, 0x23dc, 0x4a38, {0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a} \
34 typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL EFI_GRAPHICS_OUTPUT_PROTOCOL
;
44 PixelRedGreenBlueReserved8BitPerColor
,
45 PixelBlueGreenRedReserved8BitPerColor
,
49 } EFI_GRAPHICS_PIXEL_FORMAT
;
53 UINT32 HorizontalResolution
;
54 UINT32 VerticalResolution
;
55 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat
;
56 EFI_PIXEL_BITMASK PixelInformation
;
57 UINT32 PixelsPerScanLine
;
58 } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
;
62 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE
) (
63 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
65 OUT UINTN
*SizeOfInfo
,
66 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
**Info
71 Return the current video mode information.
74 This - Protocol instance pointer.
75 ModeNumber - The mode number to return information on.
76 SizeOfInfo - A pointer to the size, in bytes, of the Info buffer.
77 Info - A pointer to callee allocated buffer that returns information about ModeNumber.
80 EFI_SUCCESS - Mode information returned.
81 EFI_DEVICE_ERROR - A hardware error occurred trying to retrieve the video mode.
82 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
83 EFI_INVALID_PARAMETER - One of the input args was NULL.
90 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE
) (
91 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
* This
,
97 Return the current video mode information.
100 This - Protocol instance pointer.
101 ModeNumber - The mode number to be set.
104 EFI_SUCCESS - Graphics mode was changed.
105 EFI_DEVICE_ERROR - The device had an error and could not complete the request.
106 EFI_UNSUPPORTED - ModeNumber is not supported by this device.
111 typedef EFI_UGA_PIXEL EFI_GRAPHICS_OUTPUT_BLT_PIXEL
;
114 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel
;
116 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION
;
120 EfiBltVideoToBltBuffer
,
123 EfiGraphicsOutputBltOperationMax
124 } EFI_GRAPHICS_OUTPUT_BLT_OPERATION
;
128 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT
) (
129 IN EFI_GRAPHICS_OUTPUT_PROTOCOL
* This
,
130 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
* BltBuffer
, OPTIONAL
131 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation
,
134 IN UINTN DestinationX
,
135 IN UINTN DestinationY
,
138 IN UINTN Delta OPTIONAL
144 The following table defines actions for BltOperations:
145 EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
146 directly to every pixel of the video display rectangle
147 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
148 Only one pixel will be used from the BltBuffer. Delta is NOT used.
149 EfiBltVideoToBltBuffer - Read data from the video display rectangle
150 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
151 the BltBuffer rectangle (DestinationX, DestinationY )
152 (DestinationX + Width, DestinationY + Height). If DestinationX or
153 DestinationY is not zero then Delta must be set to the length in bytes
154 of a row in the BltBuffer.
155 EfiBltBufferToVideo - Write data from the BltBuffer rectangle
156 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
157 video display rectangle (DestinationX, DestinationY)
158 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
159 not zero then Delta must be set to the length in bytes of a row in the
161 EfiBltVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
162 (SourceX + Width, SourceY + Height) .to the video display rectangle
163 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
164 The BltBuffer and Delta are not used in this mode.
167 This - Protocol instance pointer.
168 BltBuffer - Buffer containing data to blit into video buffer. This
169 buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
170 BltOperation - Operation to perform on BlitBuffer and video memory
171 SourceX - X coordinate of source for the BltBuffer.
172 SourceY - Y coordinate of source for the BltBuffer.
173 DestinationX - X coordinate of destination for the BltBuffer.
174 DestinationY - Y coordinate of destination for the BltBuffer.
175 Width - Width of rectangle in BltBuffer in pixels.
176 Height - Hight of rectangle in BltBuffer in pixels.
180 EFI_SUCCESS - The Blt operation completed.
181 EFI_INVALID_PARAMETER - BltOperation is not valid.
182 EFI_DEVICE_ERROR - A hardware error occured writting to the video
191 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
*Info
;
193 EFI_PHYSICAL_ADDRESS FrameBufferBase
;
194 UINTN FrameBufferSize
;
195 } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
;
197 struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
{
198 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
;
199 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode
;
200 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt
;
201 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
*Mode
;
204 extern EFI_GUID gEfiGraphicsOutputProtocolGuid
;