1 /*
2  * PROJECT:     ReactOS Xbox miniport video driver
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     Simple framebuffer driver for NVIDIA NV2A XGPU
5  * COPYRIGHT:   Copyright 2004 Ge van Geldorp
6  *              Copyright 2004 Filip Navara
7  *              Copyright 2019-2020 Stanislav Motylkov (x86corez@gmail.com)
8  */
9 
10 #pragma once
11 
12 /* INCLUDES *******************************************************************/
13 
14 /*
15  * FIXME: specify headers properly in the triangle brackets and rearrange them
16  * in a way so it would be simpler to add NDK and other headers for debugging.
17  */
18 #include "ntdef.h"
19 #define PAGE_SIZE 4096
20 #include "dderror.h"
21 #include "devioctl.h"
22 #include "miniport.h"
23 #include "ioaccess.h"
24 #include "video.h"
25 
26 typedef struct
27 {
28     PHYSICAL_ADDRESS PhysControlStart;
29     ULONG ControlLength;
30     PVOID VirtControlStart;
31     PHYSICAL_ADDRESS PhysFrameBufferStart;
32 } XBOXVMP_DEVICE_EXTENSION, *PXBOXVMP_DEVICE_EXTENSION;
33 
34 VP_STATUS
35 NTAPI
36 XboxVmpFindAdapter(
37     IN PVOID HwDeviceExtension,
38     IN PVOID HwContext,
39     IN PWSTR ArgumentString,
40     IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
41     OUT PUCHAR Again);
42 
43 BOOLEAN
44 NTAPI
45 XboxVmpInitialize(
46     PVOID HwDeviceExtension);
47 
48 BOOLEAN
49 NTAPI
50 XboxVmpStartIO(
51     PVOID HwDeviceExtension,
52     PVIDEO_REQUEST_PACKET RequestPacket);
53 
54 BOOLEAN
55 NTAPI
56 XboxVmpResetHw(
57     PVOID DeviceExtension,
58     ULONG Columns,
59     ULONG Rows);
60 
61 VP_STATUS
62 NTAPI
63 XboxVmpGetPowerState(
64     PVOID HwDeviceExtension,
65     ULONG HwId,
66     PVIDEO_POWER_MANAGEMENT VideoPowerControl);
67 
68 VP_STATUS
69 NTAPI
70 XboxVmpSetPowerState(
71     PVOID HwDeviceExtension,
72     ULONG HwId,
73     PVIDEO_POWER_MANAGEMENT VideoPowerControl);
74 
75 BOOLEAN
76 FASTCALL
77 XboxVmpSetCurrentMode(
78     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
79     PVIDEO_MODE RequestedMode,
80     PSTATUS_BLOCK StatusBlock);
81 
82 BOOLEAN
83 FASTCALL
84 XboxVmpResetDevice(
85     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
86     PSTATUS_BLOCK StatusBlock);
87 
88 BOOLEAN
89 FASTCALL
90 XboxVmpMapVideoMemory(
91     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
92     PVIDEO_MEMORY RequestedAddress,
93     PVIDEO_MEMORY_INFORMATION MapInformation,
94     PSTATUS_BLOCK StatusBlock);
95 
96 BOOLEAN
97 FASTCALL
98 XboxVmpUnmapVideoMemory(
99     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
100     PVIDEO_MEMORY VideoMemory,
101     PSTATUS_BLOCK StatusBlock);
102 
103 BOOLEAN
104 FASTCALL
105 XboxVmpQueryNumAvailModes(
106     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
107     PVIDEO_NUM_MODES Modes,
108     PSTATUS_BLOCK StatusBlock);
109 
110 BOOLEAN
111 FASTCALL
112 XboxVmpQueryAvailModes(
113     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
114     PVIDEO_MODE_INFORMATION ReturnedModes,
115     PSTATUS_BLOCK StatusBlock);
116 
117 BOOLEAN
118 FASTCALL
119 XboxVmpQueryCurrentMode(
120     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
121     PVIDEO_MODE_INFORMATION VideoModeInfo,
122     PSTATUS_BLOCK StatusBlock);
123 
124 BOOLEAN
125 FASTCALL
126 XboxVmpSetColorRegisters(
127     PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
128     PVIDEO_CLUT ColorLookUpTable,
129     PSTATUS_BLOCK StatusBlock);
130 
131 /* EOF */
132