]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Protocol/UgaDraw.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / UgaDraw.h
... / ...
CommitLineData
1/** @file\r
2 UGA Draw protocol from the EFI 1.10 specification.\r
3\r
4 Abstraction of a very simple graphics device.\r
5\r
6 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
8\r
9**/\r
10\r
11#ifndef __UGA_DRAW_H__\r
12#define __UGA_DRAW_H__\r
13\r
14\r
15#define EFI_UGA_DRAW_PROTOCOL_GUID \\r
16 { \\r
17 0x982c298b, 0xf4fa, 0x41cb, {0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 } \\r
18 }\r
19\r
20typedef struct _EFI_UGA_DRAW_PROTOCOL EFI_UGA_DRAW_PROTOCOL;\r
21\r
22/**\r
23 Return the current video mode information.\r
24\r
25 @param This The EFI_UGA_DRAW_PROTOCOL instance.\r
26 @param HorizontalResolution The size of video screen in pixels in the X dimension.\r
27 @param VerticalResolution The size of video screen in pixels in the Y dimension.\r
28 @param ColorDepth Number of bits per pixel, currently defined to be 32.\r
29 @param RefreshRate The refresh rate of the monitor in Hertz.\r
30\r
31 @retval EFI_SUCCESS Mode information returned.\r
32 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
33 @retval EFI_INVALID_PARAMETER One of the input args was NULL.\r
34\r
35**/\r
36typedef\r
37EFI_STATUS\r
38(EFIAPI *EFI_UGA_DRAW_PROTOCOL_GET_MODE)(\r
39 IN EFI_UGA_DRAW_PROTOCOL *This,\r
40 OUT UINT32 *HorizontalResolution,\r
41 OUT UINT32 *VerticalResolution,\r
42 OUT UINT32 *ColorDepth,\r
43 OUT UINT32 *RefreshRate\r
44 );\r
45\r
46/**\r
47 Set the current video mode information.\r
48\r
49 @param This The EFI_UGA_DRAW_PROTOCOL instance.\r
50 @param HorizontalResolution The size of video screen in pixels in the X dimension.\r
51 @param VerticalResolution The size of video screen in pixels in the Y dimension.\r
52 @param ColorDepth Number of bits per pixel, currently defined to be 32.\r
53 @param RefreshRate The refresh rate of the monitor in Hertz.\r
54\r
55 @retval EFI_SUCCESS Mode information returned.\r
56 @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()\r
57\r
58**/\r
59typedef\r
60EFI_STATUS\r
61(EFIAPI *EFI_UGA_DRAW_PROTOCOL_SET_MODE)(\r
62 IN EFI_UGA_DRAW_PROTOCOL *This,\r
63 IN UINT32 HorizontalResolution,\r
64 IN UINT32 VerticalResolution,\r
65 IN UINT32 ColorDepth,\r
66 IN UINT32 RefreshRate\r
67 );\r
68\r
69typedef struct {\r
70 UINT8 Blue;\r
71 UINT8 Green;\r
72 UINT8 Red;\r
73 UINT8 Reserved;\r
74} EFI_UGA_PIXEL;\r
75\r
76typedef union {\r
77 EFI_UGA_PIXEL Pixel;\r
78 UINT32 Raw;\r
79} EFI_UGA_PIXEL_UNION;\r
80\r
81///\r
82/// Enumration value for actions of Blt operations.\r
83///\r
84typedef enum {\r
85 EfiUgaVideoFill, ///< Write data from the BltBuffer pixel (SourceX, SourceY)\r
86 ///< directly to every pixel of the video display rectangle\r
87 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
88 ///< Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
89\r
90 EfiUgaVideoToBltBuffer, ///< Read data from the video display rectangle\r
91 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r
92 ///< the BltBuffer rectangle (DestinationX, DestinationY )\r
93 ///< (DestinationX + Width, DestinationY + Height). If DestinationX or\r
94 ///< DestinationY is not zero then Delta must be set to the length in bytes\r
95 ///< of a row in the BltBuffer.\r
96\r
97 EfiUgaBltBufferToVideo, ///< Write data from the BltBuffer rectangle\r
98 ///< (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r
99 ///< video display rectangle (DestinationX, DestinationY)\r
100 ///< (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r
101 ///< not zero then Delta must be set to the length in bytes of a row in the\r
102 ///< BltBuffer.\r
103\r
104 EfiUgaVideoToVideo, ///< Copy from the video display rectangle (SourceX, SourceY)\r
105 ///< (SourceX + Width, SourceY + Height) .to the video display rectangle\r
106 ///< (DestinationX, DestinationY) (DestinationX + Width, DestinationY + Height).\r
107 ///< The BltBuffer and Delta are not used in this mode.\r
108\r
109 EfiUgaBltMax ///< Maxmimum value for enumration value of Blt operation. If a Blt operation\r
110 ///< larger or equal to this enumration value, it is invalid.\r
111} EFI_UGA_BLT_OPERATION;\r
112\r
113/**\r
114 Blt a rectangle of pixels on the graphics screen.\r
115\r
116 @param[in] This - Protocol instance pointer.\r
117 @param[in] BltBuffer - Buffer containing data to blit into video buffer. This\r
118 buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL)\r
119 @param[in] BltOperation - Operation to perform on BlitBuffer and video memory\r
120 @param[in] SourceX - X coordinate of source for the BltBuffer.\r
121 @param[in] SourceY - Y coordinate of source for the BltBuffer.\r
122 @param[in] DestinationX - X coordinate of destination for the BltBuffer.\r
123 @param[in] DestinationY - Y coordinate of destination for the BltBuffer.\r
124 @param[in] Width - Width of rectangle in BltBuffer in pixels.\r
125 @param[in] Height - Hight of rectangle in BltBuffer in pixels.\r
126 @param[in] Delta - OPTIONAL\r
127\r
128 @retval EFI_SUCCESS - The Blt operation completed.\r
129 @retval EFI_INVALID_PARAMETER - BltOperation is not valid.\r
130 @retval EFI_DEVICE_ERROR - A hardware error occured writting to the video buffer.\r
131\r
132**/\r
133typedef\r
134EFI_STATUS\r
135(EFIAPI *EFI_UGA_DRAW_PROTOCOL_BLT)(\r
136 IN EFI_UGA_DRAW_PROTOCOL * This,\r
137 IN EFI_UGA_PIXEL * BltBuffer, OPTIONAL\r
138 IN EFI_UGA_BLT_OPERATION BltOperation,\r
139 IN UINTN SourceX,\r
140 IN UINTN SourceY,\r
141 IN UINTN DestinationX,\r
142 IN UINTN DestinationY,\r
143 IN UINTN Width,\r
144 IN UINTN Height,\r
145 IN UINTN Delta OPTIONAL\r
146 );\r
147\r
148///\r
149/// This protocol provides a basic abstraction to set video modes and\r
150/// copy pixels to and from the graphics controller's frame buffer.\r
151///\r
152struct _EFI_UGA_DRAW_PROTOCOL {\r
153 EFI_UGA_DRAW_PROTOCOL_GET_MODE GetMode;\r
154 EFI_UGA_DRAW_PROTOCOL_SET_MODE SetMode;\r
155 EFI_UGA_DRAW_PROTOCOL_BLT Blt;\r
156};\r
157\r
158extern EFI_GUID gEfiUgaDrawProtocolGuid;\r
159\r
160#endif\r