1 /** @file
2   This file declares Graphics PPI.
3   This PPI is the main interface exposed by the Graphics PEIM to be used by the
4   other firmware modules.
5 
6   Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
7   SPDX-License-Identifier: BSD-2-Clause-Patent
8 
9   @par Revision Reference:
10   This PPI is introduced in PI Version 1.4.
11 
12 **/
13 
14 #ifndef __PEI_GRAPHICS_PPI_H__
15 #define __PEI_GRAPHICS_PPI_H__
16 
17 #include <Protocol/GraphicsOutput.h>
18 
19 #define EFI_PEI_GRAPHICS_PPI_GUID \
20   { \
21     0x6ecd1463, 0x4a4a, 0x461b, { 0xaf, 0x5f, 0x5a, 0x33, 0xe3, 0xb2, 0x16, 0x2b } \
22   }
23 
24 typedef struct _EFI_PEI_GRAPHICS_PPI EFI_PEI_GRAPHICS_PPI;
25 
26 /**
27   The GraphicsPpiInit initializes the graphics subsystem in phases.
28 
29   @param[in] GraphicsPolicyPtr    GraphicsPolicyPtr points to a configuration data
30                                   block of policy settings required by Graphics PEIM.
31 
32   @retval EFI_SUCCESS             The invocation was successful.
33   @retval EFI_INVALID_PARAMETER   The phase parameter is not valid.
34   @retval EFI_NOT_ABORTED         The stages was not called in the proper order.
35   @retval EFI_NOT_FOUND           The PeiGraphicsPlatformPolicyPpi is not located.
36   @retval EFI_DEVICE_ERROR        The initialization failed due to device error.
37   @retval EFI_NOT_READY           The previous init stage is still in progress and not
38                                   ready for the current initialization phase yet. The
39                                   platform code should call this again sometime later.
40 **/
41 typedef
42 EFI_STATUS
43 (EFIAPI *EFI_PEI_GRAPHICS_INIT) (
44   IN VOID                            *GraphicsPolicyPtr
45   );
46 
47 /**
48   The GraphicsPpiGetMode returns the mode information supported by the Graphics PEI
49   Module.
50 
51   @param[in, out] Mode            Pointer to EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE data.
52 
53   @retval EFI_SUCCESS             Valid mode information was returned.
54   @retval EFI_INVALID_PARAMETER   The Mode parameter is not valid.
55   @retval EFI_DEVICE_ERROR        A hardware error occurred trying to retrieve the video
56                                   mode.
57   @retval EFI_NOT_READY           The Graphics Initialization is not competed and Mode
58                                   information is not yet available.The platform code
59                                   should call this again after the Graphics
60                                   initialization is done.
61 **/
62 typedef
63 EFI_STATUS
64 (EFIAPI *EFI_PEI_GRAPHICS_GET_MODE) (
65   IN OUT EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE  *Mode
66   );
67 
68 ///
69 /// This PPI is the main interface exposed by the Graphics PEIM to be used by the other
70 /// firmware modules.
71 ///
72 struct _EFI_PEI_GRAPHICS_PPI {
73   EFI_PEI_GRAPHICS_INIT              GraphicsPpiInit;
74   EFI_PEI_GRAPHICS_GET_MODE          GraphicsPpiGetMode;
75 };
76 
77 extern EFI_GUID gEfiPeiGraphicsPpiGuid;
78 
79 #endif
80