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