3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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 <efiUgaDraw.h>
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; */
35 struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
;
45 PixelRedGreenBlueReserved8BitPerColor
,
46 PixelBlueGreenRedReserved8BitPerColor
,
50 } EFI_GRAPHICS_PIXEL_FORMAT
;
54 UINT32 HorizontalResolution
;
55 UINT32 VerticalResolution
;
56 EFI_GRAPHICS_PIXEL_FORMAT PixelFormat
;
57 EFI_PIXEL_BITMASK PixelInformation
;
58 UINT32 PixelsPerScanLine
;
59 } EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
;
63 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE
) (
64 IN
struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
*This
,
66 OUT UINTN
*SizeOfInfo
,
67 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
**Info
72 Return the current video mode information.
75 This - Protocol instance pointer.
76 ModeNumber - The mode number to return information on.
77 SizeOfInfo - A pointer to the size, in bytes, of the Info buffer.
78 Info - A pointer to callee allocated buffer that returns information about ModeNumber.
81 EFI_SUCCESS - Mode information returned.
82 EFI_DEVICE_ERROR - A hardware error occurred trying to retrieve the video mode.
83 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
84 EFI_INVALID_PARAMETER - One of the input args was NULL.
91 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE
) (
92 IN
struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
* This
,
98 Return the current video mode information.
101 This - Protocol instance pointer.
102 ModeNumber - The mode number to be set.
105 EFI_SUCCESS - Graphics mode was changed.
106 EFI_DEVICE_ERROR - The device had an error and could not complete the request.
107 EFI_UNSUPPORTED - ModeNumber is not supported by this device.
112 typedef EFI_UGA_PIXEL EFI_GRAPHICS_OUTPUT_BLT_PIXEL
;
115 EFI_GRAPHICS_OUTPUT_BLT_PIXEL Pixel
;
117 } EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION
;
121 EfiBltVideoToBltBuffer
,
124 EfiGraphicsOutputBltOperationMax
125 } EFI_GRAPHICS_OUTPUT_BLT_OPERATION
;
129 (EFIAPI
*EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT
) (
130 IN
struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
* This
,
131 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL
* BltBuffer
, OPTIONAL
132 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation
,
135 IN UINTN DestinationX
,
136 IN UINTN DestinationY
,
139 IN UINTN Delta OPTIONAL
145 The following table defines actions for BltOperations:
146 EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
147 directly to every pixel of the video display rectangle
148 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
149 Only one pixel will be used from the BltBuffer. Delta is NOT used.
150 EfiBltVideoToBltBuffer - Read data from the video display rectangle
151 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
152 the BltBuffer rectangle (DestinationX, DestinationY )
153 (DestinationX + Width, DestinationY + Height). If DestinationX or
154 DestinationY is not zero then Delta must be set to the length in bytes
155 of a row in the BltBuffer.
156 EfiBltBufferToVideo - Write data from the BltBuffer rectangle
157 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
158 video display rectangle (DestinationX, DestinationY)
159 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
160 not zero then Delta must be set to the length in bytes of a row in the
162 EfiBltVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
163 (SourceX + Width, SourceY + Height) .to the video display rectangle
164 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
165 The BltBuffer and Delta are not used in this mode.
168 This - Protocol instance pointer.
169 BltBuffer - Buffer containing data to blit into video buffer. This
170 buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
171 BltOperation - Operation to perform on BlitBuffer and video memory
172 SourceX - X coordinate of source for the BltBuffer.
173 SourceY - Y coordinate of source for the BltBuffer.
174 DestinationX - X coordinate of destination for the BltBuffer.
175 DestinationY - Y coordinate of destination for the BltBuffer.
176 Width - Width of rectangle in BltBuffer in pixels.
177 Height - Hight of rectangle in BltBuffer in pixels.
181 EFI_SUCCESS - The Blt operation completed.
182 EFI_INVALID_PARAMETER - BltOperation is not valid.
183 EFI_DEVICE_ERROR - A hardware error occured writting to the video
192 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION
*Info
;
194 EFI_PHYSICAL_ADDRESS FrameBufferBase
;
195 UINTN FrameBufferSize
;
196 } EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
;
198 typedef struct _EFI_GRAPHICS_OUTPUT_PROTOCOL
{
199 EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode
;
200 EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE SetMode
;
201 EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT Blt
;
202 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE
*Mode
;
203 } EFI_GRAPHICS_OUTPUT_PROTOCOL
;
205 extern EFI_GUID gEfiGraphicsOutputProtocolGuid
;