ReactOS  0.4.15-dev-448-gd6c4411
xboxvmp.h
Go to the documentation of this file.
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 #define NV2A_VIDEO_MEMORY_SIZE (4 * 1024 * 1024)
27 
28 #define NV2A_CONTROL_FRAMEBUFFER_ADDRESS_OFFSET 0x600800
29 #define NV2A_CRTC_REGISTER_INDEX 0x6013D4
30 #define NV2A_CRTC_REGISTER_VALUE 0x6013D5
31 #define NV2A_RAMDAC_FP_HVALID_END 0x680838
32 #define NV2A_RAMDAC_FP_VVALID_END 0x680818
33 
34 typedef struct
35 {
41 
43 NTAPI
45  IN PVOID HwDeviceExtension,
47  IN PWSTR ArgumentString,
48  IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
49  OUT PUCHAR Again);
50 
51 BOOLEAN
52 NTAPI
54  PVOID HwDeviceExtension);
55 
56 BOOLEAN
57 NTAPI
59  PVOID HwDeviceExtension,
60  PVIDEO_REQUEST_PACKET RequestPacket);
61 
62 BOOLEAN
63 NTAPI
65  PVOID DeviceExtension,
66  ULONG Columns,
67  ULONG Rows);
68 
70 NTAPI
72  PVOID HwDeviceExtension,
73  ULONG HwId,
74  PVIDEO_POWER_MANAGEMENT VideoPowerControl);
75 
77 NTAPI
79  PVOID HwDeviceExtension,
80  ULONG HwId,
81  PVIDEO_POWER_MANAGEMENT VideoPowerControl);
82 
83 BOOLEAN
86  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
87  PVIDEO_MODE RequestedMode,
88  PSTATUS_BLOCK StatusBlock);
89 
90 BOOLEAN
93  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
94  PSTATUS_BLOCK StatusBlock);
95 
96 BOOLEAN
99  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
100  PVIDEO_MEMORY RequestedAddress,
101  PVIDEO_MEMORY_INFORMATION MapInformation,
102  PSTATUS_BLOCK StatusBlock);
103 
104 BOOLEAN
105 FASTCALL
107  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
108  PVIDEO_MEMORY VideoMemory,
109  PSTATUS_BLOCK StatusBlock);
110 
111 BOOLEAN
112 FASTCALL
114  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
116  PSTATUS_BLOCK StatusBlock);
117 
118 BOOLEAN
119 FASTCALL
121  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
122  PVIDEO_MODE_INFORMATION ReturnedModes,
123  PSTATUS_BLOCK StatusBlock);
124 
125 BOOLEAN
126 FASTCALL
128  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
129  PVIDEO_MODE_INFORMATION VideoModeInfo,
130  PSTATUS_BLOCK StatusBlock);
131 
132 BOOLEAN
133 FASTCALL
135  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
136  PVIDEO_CLUT ColorLookUpTable,
137  PSTATUS_BLOCK StatusBlock);
138 
139 /* EOF */
#define IN
Definition: typedefs.h:39
VP_STATUS NTAPI XboxVmpFindAdapter(IN PVOID HwDeviceExtension, IN PVOID HwContext, IN PWSTR ArgumentString, IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo, OUT PUCHAR Again)
Definition: xboxvmp.c:54
BOOLEAN FASTCALL XboxVmpSetCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:341
uint16_t * PWSTR
Definition: typedefs.h:55
unsigned char * PUCHAR
Definition: retypes.h:3
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:664
BOOLEAN FASTCALL XboxVmpQueryNumAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:466
PHYSICAL_ADDRESS PhysControlStart
Definition: xboxvmp.h:36
BOOLEAN NTAPI XboxVmpInitialize(PVOID HwDeviceExtension)
Definition: xboxvmp.c:93
BOOLEAN FASTCALL XboxVmpResetDevice(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:366
#define FASTCALL
Definition: nt_native.h:50
BOOLEAN NTAPI XboxVmpResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: xboxvmp.c:282
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VP_STATUS NTAPI XboxVmpSetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: xboxvmp.c:323
unsigned char BOOLEAN
_In_ ULONG Rows
Definition: haltypes.h:7
BOOLEAN FASTCALL XboxVmpUnmapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:443
BOOLEAN FASTCALL XboxVmpQueryAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION ReturnedModes, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:485
PHYSICAL_ADDRESS PhysFrameBufferStart
Definition: xboxvmp.h:39
BOOLEAN FASTCALL XboxVmpSetColorRegisters(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_CLUT ColorLookUpTable, PSTATUS_BLOCK StatusBlock)
VP_STATUS NTAPI XboxVmpGetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: xboxvmp.c:305
BOOLEAN FASTCALL XboxVmpQueryCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoModeInfo, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:532
BOOLEAN FASTCALL XboxVmpMapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:384
static const COLUMN_LIST Columns[]
Definition: listview.c:19
struct XBOXVMP_DEVICE_EXTENSION * PXBOXVMP_DEVICE_EXTENSION
#define OUT
Definition: typedefs.h:40
unsigned int ULONG
Definition: retypes.h:1
LONG VP_STATUS
Definition: video.h:153
BOOLEAN NTAPI XboxVmpStartIO(PVOID HwDeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: xboxvmp.c:133