3 Copyright (c) 2004, 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 UGA Draw protocol from the EFI 1.1 specification.
20 Abstraction of a very simple graphics device.
24 #ifndef __UGA_DRAW_H__
25 #define __UGA_DRAW_H__
27 #define EFI_UGA_DRAW_PROTOCOL_GUID \
29 0x982c298b, 0xf4fa, 0x41cb, 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 \
32 typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL
;
36 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_GET_MODE
) (
37 IN EFI_UGA_DRAW_PROTOCOL
* This
,
38 OUT UINT32
*HorizontalResolution
,
39 OUT UINT32
*VerticalResolution
,
40 OUT UINT32
*ColorDepth
,
41 OUT UINT32
*RefreshRate
46 Return the current video mode information.
49 This - Protocol instance pointer.
50 HorizontalResolution - Current video horizontal resolution in pixels
51 VerticalResolution - Current video vertical resolution in pixels
52 ColorDepth - Current video color depth in bits per pixel
53 RefreshRate - Current video refresh rate in Hz.
56 EFI_SUCCESS - Mode information returned.
57 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
58 EFI_INVALID_PARAMETER - One of the input args was NULL.
65 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_SET_MODE
) (
66 IN EFI_UGA_DRAW_PROTOCOL
* This
,
67 IN UINT32 HorizontalResolution
,
68 IN UINT32 VerticalResolution
,
75 Return the current video mode information.
78 This - Protocol instance pointer.
79 HorizontalResolution - Current video horizontal resolution in pixels
80 VerticalResolution - Current video vertical resolution in pixels
81 ColorDepth - Current video color depth in bits per pixel
82 RefreshRate - Current video refresh rate in Hz.
85 EFI_SUCCESS - Mode information returned.
86 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
101 } EFI_UGA_PIXEL_UNION
;
105 EfiUgaVideoToBltBuffer
,
106 EfiUgaBltBufferToVideo
,
109 } EFI_UGA_BLT_OPERATION
;
113 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_BLT
) (
114 IN EFI_UGA_DRAW_PROTOCOL
* This
,
115 IN EFI_UGA_PIXEL
* BltBuffer
, OPTIONAL
116 IN EFI_UGA_BLT_OPERATION BltOperation
,
119 IN UINTN DestinationX
,
120 IN UINTN DestinationY
,
123 IN UINTN Delta OPTIONAL
129 The following table defines actions for BltOperations:
130 EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
131 directly to every pixel of the video display rectangle
132 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
133 Only one pixel will be used from the BltBuffer. Delta is NOT used.
134 EfiUgaVideoToBltBuffer - Read data from the video display rectangle
135 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
136 the BltBuffer rectangle (DestinationX, DestinationY )
137 (DestinationX + Width, DestinationY + Height). If DestinationX or
138 DestinationY is not zero then Delta must be set to the length in bytes
139 of a row in the BltBuffer.
140 EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle
141 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
142 video display rectangle (DestinationX, DestinationY)
143 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
144 not zero then Delta must be set to the length in bytes of a row in the
146 EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
147 (SourceX + Width, SourceY + Height) .to the video display rectangle
148 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
149 The BltBuffer and Delta are not used in this mode.
152 This - Protocol instance pointer.
153 BltBuffer - Buffer containing data to blit into video buffer. This
154 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
155 BltOperation - Operation to perform on BlitBuffer and video memory
156 SourceX - X coordinate of source for the BltBuffer.
157 SourceY - Y coordinate of source for the BltBuffer.
158 DestinationX - X coordinate of destination for the BltBuffer.
159 DestinationY - Y coordinate of destination for the BltBuffer.
160 Width - Width of rectangle in BltBuffer in pixels.
161 Height - Hight of rectangle in BltBuffer in pixels.
165 EFI_SUCCESS - The Blt operation completed.
166 EFI_INVALID_PARAMETER - BltOperation is not valid.
167 EFI_DEVICE_ERROR - A hardware error occured writting to the video
173 typedef struct _EFI_UGA_DRAW_PROTOCOL
{
174 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
;
175 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
;
176 EFI_UGA_DRAW_PROTOCOL_BLT Blt
;
177 } EFI_UGA_DRAW_PROTOCOL
;
179 extern EFI_GUID gEfiUgaDrawProtocolGuid
;