ca5cab49f676edb4fed71f2abd5b5de87548da17
[reactos.git] / reactos / drivers / video / miniport / vmx_svga / vmx_svga.c
1 /*
2 * PROJECT: ReactOS Boot Loader
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/video/miniport/vmx_svga/vmx_svga.c
5 * PURPOSE: VMWARE SVGA-II Card Main Driver File
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include "precomp.h"
12
13 /* GLOBALS ********************************************************************/
14
15 PHW_DEVICE_EXTENSION VmxDeviceExtensionArray[SVGA_MAX_DISPLAYS];
16
17 /* FUNCTIONS ******************************************************************/
18
19 VP_STATUS
20 NTAPI
21 VmxFindAdapter(IN PVOID HwDeviceExtension,
22 IN PVOID HwContext,
23 IN PWSTR ArgumentString,
24 IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
25 OUT PUCHAR Again)
26 {
27 return NO_ERROR;
28 }
29
30 BOOLEAN
31 NTAPI
32 VmxInitialize(IN PVOID HwDeviceExtension)
33 {
34 return TRUE;
35 }
36
37 BOOLEAN
38 NTAPI
39 VmxStartIO(IN PVOID HwDeviceExtension,
40 IN PVIDEO_REQUEST_PACKET RequestPacket)
41 {
42 return TRUE;
43 }
44
45 BOOLEAN
46 NTAPI
47 VmxResetHw(IN PVOID DeviceExtension,
48 IN ULONG Columns,
49 IN ULONG Rows)
50 {
51 return FALSE;
52 }
53
54 VP_STATUS
55 NTAPI
56 VmxGetPowerState(IN PVOID HwDeviceExtension,
57 IN ULONG HwId,
58 IN PVIDEO_POWER_MANAGEMENT VideoPowerControl)
59 {
60 return NO_ERROR;
61 }
62
63 VP_STATUS
64 NTAPI
65 VmxSetPowerState(IN PVOID HwDeviceExtension,
66 IN ULONG HwId,
67 IN PVIDEO_POWER_MANAGEMENT VideoPowerControl)
68 {
69
70 return NO_ERROR;
71 }
72
73 BOOLEAN
74 NTAPI
75 VmxInterrupt(IN PVOID HwDeviceExtension)
76 {
77 return TRUE;
78 }
79
80 VP_STATUS
81 NTAPI
82 VmxGetVideoChildDescriptor(IN PVOID HwDeviceExtension,
83 IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo,
84 OUT PVIDEO_CHILD_TYPE VideoChildType,
85 OUT PUCHAR pChildDescriptor,
86 OUT PULONG UId,
87 OUT PULONG pUnused)
88 {
89 return NO_ERROR;
90 }
91
92 VP_STATUS
93 NTAPI
94 DriverEntry(IN PVOID Context1,
95 IN PVOID Context2)
96 {
97 VIDEO_HW_INITIALIZATION_DATA InitData;
98
99 /* Zero initialization structure and array of extensions, one per screen */
100 VideoPortZeroMemory(VmxDeviceExtensionArray, sizeof(VmxDeviceExtensionArray));
101 VideoPortZeroMemory(&InitData, sizeof(InitData));
102
103 /* Setup the initialization structure with VideoPort */
104 InitData.HwInitDataSize = sizeof(VIDEO_HW_INITIALIZATION_DATA);
105 InitData.HwFindAdapter = VmxFindAdapter;
106 InitData.HwInitialize = VmxInitialize;
107 InitData.HwInterrupt = VmxInterrupt;
108 InitData.HwStartIO = VmxStartIO;
109 InitData.HwResetHw = VmxResetHw;
110 InitData.HwGetPowerState = VmxGetPowerState;
111 InitData.HwSetPowerState = VmxSetPowerState;
112 InitData.HwGetVideoChildDescriptor = VmxGetVideoChildDescriptor;
113 InitData.AdapterInterfaceType = PCIBus;
114 InitData.HwInitDataSize = sizeof(VIDEO_HW_INITIALIZATION_DATA);
115 InitData.HwDeviceExtensionSize = sizeof(HW_DEVICE_EXTENSION);
116 return VideoPortInitialize(Context1, Context2, &InitData, NULL);
117 }