ArmPlatformPkg/LcdGraphicsOutputDxe: check PrimeCell ID before initializing
[mirror_edk2.git] / ArmPlatformPkg / Drivers / LcdGraphicsOutputDxe / LcdGraphicsOutputDxe.h
1 /** @file
2
3 Copyright (c) 2011, ARM Ltd. All rights reserved.<BR>
4 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 **/
13
14 #ifndef __ARM_VE_GRAPHICS_DXE_H__
15 #define __ARM_VE_GRAPHICS_DXE_H__
16
17
18 #include <Base.h>
19
20 #include <Library/DebugLib.h>
21 #include <Library/LcdPlatformLib.h>
22 #include <Library/PcdLib.h>
23 #include <Library/UefiLib.h>
24
25 #include <Protocol/DevicePath.h>
26
27
28 //
29 // Device structures
30 //
31 typedef struct {
32 VENDOR_DEVICE_PATH Guid;
33 EFI_DEVICE_PATH_PROTOCOL End;
34 } LCD_GRAPHICS_DEVICE_PATH;
35
36 typedef struct {
37 UINT32 Signature;
38 EFI_HANDLE Handle;
39 EFI_GRAPHICS_OUTPUT_MODE_INFORMATION ModeInfo;
40 EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE Mode;
41 EFI_GRAPHICS_OUTPUT_PROTOCOL Gop;
42 LCD_GRAPHICS_DEVICE_PATH DevicePath;
43 EFI_EVENT ExitBootServicesEvent;
44 } LCD_INSTANCE;
45
46 #define LCD_INSTANCE_SIGNATURE SIGNATURE_32('l', 'c', 'd', '0')
47
48 #define LCD_INSTANCE_FROM_GOP_THIS(a) CR (a, LCD_INSTANCE, Gop, LCD_INSTANCE_SIGNATURE)
49
50 //
51 // Function Prototypes
52 //
53
54 VOID
55 LcdGraphicsExitBootServicesEvent (
56 IN EFI_EVENT Event,
57 IN VOID *Context
58 );
59
60 EFI_STATUS
61 EFIAPI
62 LcdGraphicsQueryMode (
63 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
64 IN UINT32 ModeNumber,
65 OUT UINTN *SizeOfInfo,
66 OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
67 );
68
69 EFI_STATUS
70 EFIAPI
71 LcdGraphicsSetMode (
72 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
73 IN UINT32 ModeNumber
74 );
75
76 EFI_STATUS
77 EFIAPI
78 LcdGraphicsBlt (
79 IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
80 IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
81 IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
82 IN UINTN SourceX,
83 IN UINTN SourceY,
84 IN UINTN DestinationX,
85 IN UINTN DestinationY,
86 IN UINTN Width,
87 IN UINTN Height,
88 IN UINTN Delta OPTIONAL
89 );
90
91 UINTN
92 GetBytesPerPixel (
93 IN LCD_BPP Bpp
94 );
95
96 EFI_STATUS
97 EFIAPI
98 GraphicsOutputDxeInitialize (
99 IN EFI_HANDLE ImageHandle,
100 IN EFI_SYSTEM_TABLE *SystemTable
101 );
102
103 EFI_STATUS
104 InitializeDisplay (
105 IN LCD_INSTANCE* Instance
106 );
107
108 EFI_STATUS
109 LcdIdentify (
110 VOID
111 );
112
113 EFI_STATUS
114 LcdInitialize (
115 EFI_PHYSICAL_ADDRESS VramBaseAddress
116 );
117
118 EFI_STATUS
119 LcdSetMode (
120 IN UINT32 ModeNumber
121 );
122
123 VOID
124 LcdShutdown (
125 VOID
126 );
127
128 #endif /* __ARM_VE_GRAPHICS_DXE_H__ */