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; */
33 struct _EFI_UGA_DRAW_PROTOCOL
;
37 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_GET_MODE
) (
38 IN
struct _EFI_UGA_DRAW_PROTOCOL
* This
,
39 OUT UINT32
*HorizontalResolution
,
40 OUT UINT32
*VerticalResolution
,
41 OUT UINT32
*ColorDepth
,
42 OUT UINT32
*RefreshRate
47 Return the current video mode information.
50 This - Protocol instance pointer.
51 HorizontalResolution - Current video horizontal resolution in pixels
52 VerticalResolution - Current video vertical resolution in pixels
53 ColorDepth - Current video color depth in bits per pixel
54 RefreshRate - Current video refresh rate in Hz.
57 EFI_SUCCESS - Mode information returned.
58 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
59 EFI_INVALID_PARAMETER - One of the input args was NULL.
66 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_SET_MODE
) (
67 IN
struct _EFI_UGA_DRAW_PROTOCOL
* This
,
68 IN UINT32 HorizontalResolution
,
69 IN UINT32 VerticalResolution
,
76 Return the current video mode information.
79 This - Protocol instance pointer.
80 HorizontalResolution - Current video horizontal resolution in pixels
81 VerticalResolution - Current video vertical resolution in pixels
82 ColorDepth - Current video color depth in bits per pixel
83 RefreshRate - Current video refresh rate in Hz.
86 EFI_SUCCESS - Mode information returned.
87 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
102 } EFI_UGA_PIXEL_UNION
;
106 EfiUgaVideoToBltBuffer
,
107 EfiUgaBltBufferToVideo
,
110 } EFI_UGA_BLT_OPERATION
;
114 (EFIAPI
*EFI_UGA_DRAW_PROTOCOL_BLT
) (
115 IN
struct _EFI_UGA_DRAW_PROTOCOL
* This
,
116 IN EFI_UGA_PIXEL
* BltBuffer
, OPTIONAL
117 IN EFI_UGA_BLT_OPERATION BltOperation
,
120 IN UINTN DestinationX
,
121 IN UINTN DestinationY
,
124 IN UINTN Delta OPTIONAL
130 The following table defines actions for BltOperations:
131 EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY)
132 directly to every pixel of the video display rectangle
133 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
134 Only one pixel will be used from the BltBuffer. Delta is NOT used.
135 EfiUgaVideoToBltBuffer - Read data from the video display rectangle
136 (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in
137 the BltBuffer rectangle (DestinationX, DestinationY )
138 (DestinationX + Width, DestinationY + Height). If DestinationX or
139 DestinationY is not zero then Delta must be set to the length in bytes
140 of a row in the BltBuffer.
141 EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle
142 (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the
143 video display rectangle (DestinationX, DestinationY)
144 (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is
145 not zero then Delta must be set to the length in bytes of a row in the
147 EfiUgaVideoToVideo - Copy from the video display rectangle (SourceX, SourceY)
148 (SourceX + Width, SourceY + Height) .to the video display rectangle
149 (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).
150 The BltBuffer and Delta are not used in this mode.
153 This - Protocol instance pointer.
154 BltBuffer - Buffer containing data to blit into video buffer. This
155 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)
156 BltOperation - Operation to perform on BlitBuffer and video memory
157 SourceX - X coordinate of source for the BltBuffer.
158 SourceY - Y coordinate of source for the BltBuffer.
159 DestinationX - X coordinate of destination for the BltBuffer.
160 DestinationY - Y coordinate of destination for the BltBuffer.
161 Width - Width of rectangle in BltBuffer in pixels.
162 Height - Hight of rectangle in BltBuffer in pixels.
166 EFI_SUCCESS - The Blt operation completed.
167 EFI_INVALID_PARAMETER - BltOperation is not valid.
168 EFI_DEVICE_ERROR - A hardware error occured writting to the video
174 typedef struct _EFI_UGA_DRAW_PROTOCOL
{
175 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode
;
176 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode
;
177 EFI_UGA_DRAW_PROTOCOL_BLT Blt
;
178 } EFI_UGA_DRAW_PROTOCOL
;
180 extern EFI_GUID gEfiUgaDrawProtocolGuid
;