ReactOS  0.4.14-dev-49-gfb4591c
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 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 "video.h"
24 
25 #define NV2A_VIDEO_MEMORY_SIZE (4 * 1024 * 1024)
26 
27 #define NV2A_CONTROL_FRAMEBUFFER_ADDRESS_OFFSET 0x600800
28 #define NV2A_CRTC_REGISTER_INDEX 0x6013D4
29 #define NV2A_CRTC_REGISTER_VALUE 0x6013D5
30 #define NV2A_RAMDAC_FP_HVALID_END 0x680838
31 #define NV2A_RAMDAC_FP_VVALID_END 0x680818
32 
33 typedef struct
34 {
40 
42 NTAPI
44  IN PVOID HwDeviceExtension,
46  IN PWSTR ArgumentString,
47  IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
48  OUT PUCHAR Again);
49 
50 BOOLEAN
51 NTAPI
53  PVOID HwDeviceExtension);
54 
55 BOOLEAN
56 NTAPI
58  PVOID HwDeviceExtension,
59  PVIDEO_REQUEST_PACKET RequestPacket);
60 
61 BOOLEAN
62 NTAPI
64  PVOID DeviceExtension,
65  ULONG Columns,
66  ULONG Rows);
67 
69 NTAPI
71  PVOID HwDeviceExtension,
72  ULONG HwId,
73  PVIDEO_POWER_MANAGEMENT VideoPowerControl);
74 
76 NTAPI
78  PVOID HwDeviceExtension,
79  ULONG HwId,
80  PVIDEO_POWER_MANAGEMENT VideoPowerControl);
81 
82 BOOLEAN
85  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
86  PVIDEO_MODE RequestedMode,
87  PSTATUS_BLOCK StatusBlock);
88 
89 BOOLEAN
92  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
93  PSTATUS_BLOCK StatusBlock);
94 
95 BOOLEAN
98  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
99  PVIDEO_MEMORY RequestedAddress,
100  PVIDEO_MEMORY_INFORMATION MapInformation,
101  PSTATUS_BLOCK StatusBlock);
102 
103 BOOLEAN
104 FASTCALL
106  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
107  PVIDEO_MEMORY VideoMemory,
108  PSTATUS_BLOCK StatusBlock);
109 
110 BOOLEAN
111 FASTCALL
113  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
115  PSTATUS_BLOCK StatusBlock);
116 
117 BOOLEAN
118 FASTCALL
120  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
121  PVIDEO_MODE_INFORMATION ReturnedModes,
122  PSTATUS_BLOCK StatusBlock);
123 
124 BOOLEAN
125 FASTCALL
127  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
128  PVIDEO_MODE_INFORMATION VideoModeInfo,
129  PSTATUS_BLOCK StatusBlock);
130 
131 BOOLEAN
132 FASTCALL
134  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
135  PVIDEO_CLUT ColorLookUpTable,
136  PSTATUS_BLOCK StatusBlock);
137 
138 /* EOF */
#define IN
Definition: typedefs.h:38
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:54
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:461
PHYSICAL_ADDRESS PhysControlStart
Definition: xboxvmp.h:35
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:438
BOOLEAN FASTCALL XboxVmpQueryAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION ReturnedModes, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:480
PHYSICAL_ADDRESS PhysFrameBufferStart
Definition: xboxvmp.h:38
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:527
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:39
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