]> code.delx.au - refind/blob - libeg/efiUgaDraw.h
Fixed refind-install bug that could cause mountesp script to be
[refind] / libeg / efiUgaDraw.h
1 /*++
2
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
8
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.
11
12 Module Name:
13
14 UgaDraw.h
15
16 Abstract:
17
18 UGA Draw protocol from the EFI 1.1 specification.
19
20 Abstraction of a very simple graphics device.
21
22 --*/
23
24 #ifndef __UGA_DRAW_H__
25 #define __UGA_DRAW_H__
26
27 #define EFI_UGA_DRAW_PROTOCOL_GUID \
28 { \
29 0x982c298b, 0xf4fa, 0x41cb, { 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \
30 }
31
32 /* typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL; */
33 struct _EFI_UGA_DRAW_PROTOCOL;
34
35 typedef
36 EFI_STATUS
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
43 )
44 /*++
45
46 Routine Description:
47 Return the current video mode information.
48
49 Arguments:
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.
55
56 Returns:
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.
60
61 --*/
62 ;
63
64 typedef
65 EFI_STATUS
66 (EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE) (
67 IN struct _EFI_UGA_DRAW_PROTOCOL * This,
68 IN UINT32 HorizontalResolution,
69 IN UINT32 VerticalResolution,
70 IN UINT32 ColorDepth,
71 IN UINT32 RefreshRate
72 )
73 /*++
74
75 Routine Description:
76 Return the current video mode information.
77
78 Arguments:
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.
84
85 Returns:
86 EFI_SUCCESS - Mode information returned.
87 EFI_NOT_STARTED - Video display is not initialized. Call SetMode ()
88
89 --*/
90 ;
91
92 typedef struct {
93 UINT8 Blue;
94 UINT8 Green;
95 UINT8 Red;
96 UINT8 Reserved;
97 } EFI_UGA_PIXEL;
98
99 typedef union {
100 EFI_UGA_PIXEL Pixel;
101 UINT32 Raw;
102 } EFI_UGA_PIXEL_UNION;
103
104 typedef enum {
105 EfiUgaVideoFill,
106 EfiUgaVideoToBltBuffer,
107 EfiUgaBltBufferToVideo,
108 EfiUgaVideoToVideo,
109 EfiUgaBltMax
110 } EFI_UGA_BLT_OPERATION;
111
112 typedef
113 EFI_STATUS
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,
118 IN UINTN SourceX,
119 IN UINTN SourceY,
120 IN UINTN DestinationX,
121 IN UINTN DestinationY,
122 IN UINTN Width,
123 IN UINTN Height,
124 IN UINTN Delta OPTIONAL
125 );
126
127 /*++
128
129 Routine Description:
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
146 BltBuffer.
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.
151
152 Arguments:
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.
163 Delta -
164
165 Returns:
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
169 buffer.
170
171 --*/
172 ;
173
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;
179
180 extern EFI_GUID gEfiUgaDrawProtocolGuid;
181
182 #endif