ReactOS 0.4.16-dev-297-gc569aee
xboxvmp.c
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 Gé van Geldorp
6 * Copyright 2004 Filip Navara
7 * Copyright 2019-2020 Stanislav Motylkov (x86corez@gmail.com)
8 *
9 * TODO:
10 * - Check input parameters everywhere.
11 * - Call VideoPortVerifyAccessRanges to reserve the memory we're about
12 * to map.
13 */
14
15/* INCLUDES *******************************************************************/
16
17#include "xboxvmp.h"
18
19#include <debug.h>
20#include <dpfilter.h>
21
22#include <drivers/xbox/xgpu.h>
23
24/* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/
25
31{
33
34 VideoPortZeroMemory(&InitData, sizeof(InitData));
39 InitData.HwStartIO = XboxVmpStartIO;
40 InitData.HwResetHw = XboxVmpResetHw;
44
45 return VideoPortInitialize(Context1, Context2, &InitData, NULL);
46}
47
48/*
49 * XboxVmpFindAdapter
50 *
51 * Detects the Xbox Nvidia display adapter.
52 */
53
57 IN PVOID HwDeviceExtension,
59 IN PWSTR ArgumentString,
61 OUT PUCHAR Again)
62{
63 PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
65 /* 3 access ranges: for MMIO, VRAM, and Indirect memory access IO ports */
66 VIDEO_ACCESS_RANGE AccessRanges[3];
67 USHORT VendorId = 0x10DE; /* NVIDIA Corporation */
68 USHORT DeviceId = 0x02A0; /* NV2A XGPU */
69 ULONG Slot = 0;
70
71 TRACE_(IHVVIDEO, "XboxVmpFindAdapter\n");
72
73 XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;
74
75 VideoPortZeroMemory(&AccessRanges, sizeof(AccessRanges));
76 Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL,
77 RTL_NUMBER_OF(AccessRanges), AccessRanges,
78 &VendorId, &DeviceId, &Slot);
79 if (Status == NO_ERROR)
80 {
81 XboxVmpDeviceExtension->PhysControlStart = AccessRanges[0].RangeStart;
82 XboxVmpDeviceExtension->ControlLength = AccessRanges[0].RangeLength;
83 XboxVmpDeviceExtension->PhysFrameBufferStart = AccessRanges[1].RangeStart;
84 }
85
86 return Status;
87}
88
89/*
90 * XboxVmpInitialize
91 *
92 * Performs the first initialization of the adapter, after the HAL has given
93 * up control of the video hardware to the video port driver.
94 */
95
99 PVOID HwDeviceExtension)
100{
101 PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
104
105 TRACE_(IHVVIDEO, "XboxVmpInitialize\n");
106
107 XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;
108
109 Length = XboxVmpDeviceExtension->ControlLength;
110 XboxVmpDeviceExtension->VirtControlStart = NULL;
111
112 if (VideoPortMapMemory(HwDeviceExtension,
113 XboxVmpDeviceExtension->PhysControlStart,
114 &Length,
115 &inIoSpace,
116 &XboxVmpDeviceExtension->VirtControlStart) != NO_ERROR)
117 {
118 ERR_(IHVVIDEO, "Failed to map control memory\n");
119 return FALSE;
120 }
121
122 INFO_(IHVVIDEO, "Mapped 0x%x bytes of control mem at 0x%x to virt addr 0x%x\n",
123 XboxVmpDeviceExtension->ControlLength,
124 XboxVmpDeviceExtension->PhysControlStart.u.LowPart,
125 XboxVmpDeviceExtension->VirtControlStart);
126
127 return TRUE;
128}
129
130/*
131 * XboxVmpStartIO
132 *
133 * Processes the specified Video Request Packet.
134 */
135
137NTAPI
139 PVOID HwDeviceExtension,
140 PVIDEO_REQUEST_PACKET RequestPacket)
141{
143
145
146 switch (RequestPacket->IoControlCode)
147 {
149 {
150 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_SET_CURRENT_MODE\n");
151
152 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
153 {
155 return TRUE;
156 }
157
159 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
160 (PVIDEO_MODE)RequestPacket->InputBuffer,
161 RequestPacket->StatusBlock);
162 break;
163 }
164
166 {
167 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_RESET_DEVICE\n");
168
170 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
171 RequestPacket->StatusBlock);
172 break;
173 }
174
176 {
177 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_MAP_VIDEO_MEMORY\n");
178
179 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
180 RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
181 {
183 return TRUE;
184 }
185
187 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
188 (PVIDEO_MEMORY)RequestPacket->InputBuffer,
190 RequestPacket->StatusBlock);
191 break;
192 }
193
195 {
196 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_UNMAP_VIDEO_MEMORY\n");
197
198 if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
199 {
201 return TRUE;
202 }
203
205 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
206 (PVIDEO_MEMORY)RequestPacket->InputBuffer,
207 RequestPacket->StatusBlock);
208 break;
209 }
210
212 {
213 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES\n");
214
215 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
216 {
218 return TRUE;
219 }
220
222 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
223 (PVIDEO_NUM_MODES)RequestPacket->OutputBuffer,
224 RequestPacket->StatusBlock);
225 break;
226 }
227
229 {
230 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_AVAIL_MODES\n");
231
232 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
233 {
235 return TRUE;
236 }
237
239 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
241 RequestPacket->StatusBlock);
242 break;
243 }
244
246 {
247 TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_CURRENT_MODE\n");
248
249 if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
250 {
252 return TRUE;
253 }
254
256 (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
258 RequestPacket->StatusBlock);
259 break;
260 }
261
262 default:
263 {
264 WARN_(IHVVIDEO, "XboxVmpStartIO 0x%x not implemented\n", RequestPacket->IoControlCode);
265
266 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
267 return FALSE;
268 }
269 }
270
271 if (Result)
272 {
273 RequestPacket->StatusBlock->Status = NO_ERROR;
274 }
275
276 return TRUE;
277}
278
279/*
280 * XboxVmpResetHw
281 *
282 * This function is called to reset the hardware to a known state.
283 */
284
286NTAPI
288 PVOID DeviceExtension,
290 ULONG Rows)
291{
292 TRACE_(IHVVIDEO, "XboxVmpResetHw\n");
293
294 if (!XboxVmpResetDevice((PXBOXVMP_DEVICE_EXTENSION)DeviceExtension, NULL))
295 {
296 return FALSE;
297 }
298
299 return TRUE;
300}
301
302/*
303 * XboxVmpGetPowerState
304 *
305 * Queries whether the device can support the requested power state.
306 */
307
309NTAPI
311 PVOID HwDeviceExtension,
312 ULONG HwId,
313 PVIDEO_POWER_MANAGEMENT VideoPowerControl)
314{
315 ERR_(IHVVIDEO, "XboxVmpGetPowerState is not supported\n");
316
318}
319
320/*
321 * XboxVmpSetPowerState
322 *
323 * Sets the power state of the specified device
324 */
325
327NTAPI
329 PVOID HwDeviceExtension,
330 ULONG HwId,
331 PVIDEO_POWER_MANAGEMENT VideoPowerControl)
332{
333 ERR_(IHVVIDEO, "XboxVmpSetPowerState not supported\n");
334
336}
337
338/*
339 * VBESetCurrentMode
340 *
341 * Sets the adapter to the specified operating mode.
342 */
343
347 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
348 PVIDEO_MODE RequestedMode,
349 PSTATUS_BLOCK StatusBlock)
350{
351 if (RequestedMode->RequestedMode != 0)
352 {
353 return FALSE;
354 }
355
356 /* Nothing to do, really. We only support a single mode and we're already
357 * in that mode
358 */
359 return TRUE;
360}
361
362/*
363 * XboxVmpResetDevice
364 *
365 * Resets the video hardware to the default mode, to which it was initialized
366 * at system boot.
367 */
368
372 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
373 PSTATUS_BLOCK StatusBlock)
374{
375 /* There is nothing to be done here */
376
377 return TRUE;
378}
379
380/*
381 * XboxVmpMapVideoMemory
382 *
383 * Maps the video hardware frame buffer and video RAM into the virtual address
384 * space of the requestor.
385 */
386
390 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
391 PVIDEO_MEMORY RequestedAddress,
392 PVIDEO_MEMORY_INFORMATION MapInformation,
393 PSTATUS_BLOCK StatusBlock)
394{
397
398 StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
399
400 /* Reuse framebuffer that was set up by firmware */
402 /* Framebuffer address offset value is coming from the GPU within
403 * memory mapped I/O address space, so we're comparing only low
404 * 28 bits of the address within actual RAM address space */
405 FrameBuffer.QuadPart &= 0x0FFFFFFF;
406 if (FrameBuffer.QuadPart != 0x3C00000 && FrameBuffer.QuadPart != 0x7C00000)
407 {
408 /* Check framebuffer address (high 4 MB of either 64 or 128 MB RAM) */
409 WARN_(IHVVIDEO, "Non-standard framebuffer address 0x%p\n", FrameBuffer.QuadPart);
410 }
411 /* Verify that framebuffer address is page-aligned */
412 ASSERT(FrameBuffer.QuadPart % PAGE_SIZE == 0);
413
414 /* Return the address back to GPU memory mapped I/O */
415 FrameBuffer.QuadPart += DeviceExtension->PhysFrameBufferStart.QuadPart;
416 MapInformation->VideoRamBase = RequestedAddress->RequestedVirtualAddress;
417 /* FIXME: obtain fb size from firmware somehow (Cromwell reserves high 4 MB of RAM) */
418 MapInformation->VideoRamLength = NV2A_VIDEO_MEMORY_SIZE;
419
421 DeviceExtension,
423 &MapInformation->VideoRamLength,
424 &inIoSpace,
425 &MapInformation->VideoRamBase);
426
427 MapInformation->FrameBufferBase = MapInformation->VideoRamBase;
428 MapInformation->FrameBufferLength = MapInformation->VideoRamLength;
429
430 /* Tell the nVidia controller about the framebuffer */
432
433 INFO_(IHVVIDEO, "Mapped 0x%x bytes of phys mem at 0x%lx to virt addr 0x%p\n",
434 MapInformation->VideoRamLength, FrameBuffer.u.LowPart, MapInformation->VideoRamBase);
435
436 return TRUE;
437}
438
439/*
440 * VBEUnmapVideoMemory
441 *
442 * Releases a mapping between the virtual address space and the adapter's
443 * frame buffer and video RAM.
444 */
445
449 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
450 PVIDEO_MEMORY VideoMemory,
451 PSTATUS_BLOCK StatusBlock)
452{
454 DeviceExtension,
455 VideoMemory->RequestedVirtualAddress,
456 NULL);
457
458 return TRUE;
459}
460
461/*
462 * XboxVmpQueryNumAvailModes
463 *
464 * Returns the number of video modes supported by the adapter and the size
465 * in bytes of the video mode information, which can be used to allocate a
466 * buffer for an IOCTL_VIDEO_QUERY_AVAIL_MODES request.
467 */
468
472 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
474 PSTATUS_BLOCK StatusBlock)
475{
476 Modes->NumModes = 1;
477 Modes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
478 StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
479 return TRUE;
480}
481
482/*
483 * XboxVmpQueryAvailModes
484 *
485 * Returns information about each video mode supported by the adapter.
486 */
487
491 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
493 PSTATUS_BLOCK StatusBlock)
494{
495 return XboxVmpQueryCurrentMode(DeviceExtension, VideoMode, StatusBlock);
496}
497
498UCHAR
500 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
501 UCHAR Index)
502{
505}
506
507UCHAR
509 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
511{
513
514 /* Get BPP directly from NV2A CRTC (magic constants are from Cromwell) */
515 BytesPerPixel = 8 * (((NvGetCrtc(DeviceExtension, 0x19) & 0xE0) << 3) | (NvGetCrtc(DeviceExtension, 0x13) & 0xFF)) / ScreenWidth;
516
517 if (BytesPerPixel == 4)
518 {
519 ASSERT((NvGetCrtc(DeviceExtension, 0x28) & 0xF) == BytesPerPixel - 1);
520 }
521 else
522 {
523 ASSERT((NvGetCrtc(DeviceExtension, 0x28) & 0xF) == BytesPerPixel);
524 }
525
526 return BytesPerPixel;
527}
528
529/*
530 * VBEQueryCurrentMode
531 *
532 * Returns information about current video mode.
533 */
534
538 PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
540 PSTATUS_BLOCK StatusBlock)
541{
543
544 VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
545 VideoMode->ModeIndex = 0;
546
547 VideoMode->VisScreenWidth = READ_REGISTER_ULONG((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_RAMDAC_FP_HVALID_END) + 1;
548 VideoMode->VisScreenHeight = READ_REGISTER_ULONG((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_RAMDAC_FP_VVALID_END) + 1;
549
550 if (VideoMode->VisScreenWidth <= 1 || VideoMode->VisScreenHeight <= 1)
551 {
552 ERR_(IHVVIDEO, "Cannot obtain current screen resolution!\n");
553 return FALSE;
554 }
555
556 BytesPerPixel = NvGetBytesPerPixel(DeviceExtension, VideoMode->VisScreenWidth);
557 ASSERT(BytesPerPixel >= 1 && BytesPerPixel <= 4);
558
559 VideoMode->ScreenStride = VideoMode->VisScreenWidth * BytesPerPixel;
560 VideoMode->NumberOfPlanes = 1;
561 VideoMode->BitsPerPlane = BytesPerPixel * 8;
562 VideoMode->Frequency = 1;
563 VideoMode->XMillimeter = 0; /* FIXME */
564 VideoMode->YMillimeter = 0; /* FIXME */
565 if (BytesPerPixel >= 3)
566 {
567 VideoMode->NumberRedBits = 8;
568 VideoMode->NumberGreenBits = 8;
569 VideoMode->NumberBlueBits = 8;
570 VideoMode->RedMask = 0xFF0000;
571 VideoMode->GreenMask = 0x00FF00;
572 VideoMode->BlueMask = 0x0000FF;
573 }
574 else
575 {
576 /* FIXME: not implemented */
577 WARN_(IHVVIDEO, "BytesPerPixel %d - not implemented\n", BytesPerPixel);
578 }
579 VideoMode->VideoMemoryBitmapWidth = VideoMode->VisScreenWidth;
580 VideoMode->VideoMemoryBitmapHeight = VideoMode->VisScreenHeight;
583 VideoMode->DriverSpecificAttributeFlags = 0;
584
585 StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
586
587 /* Verify that screen fits framebuffer size */
588 if (VideoMode->VisScreenWidth * VideoMode->VisScreenHeight * (VideoMode->BitsPerPlane / 8) > NV2A_VIDEO_MEMORY_SIZE)
589 {
590 ERR_(IHVVIDEO, "Current screen resolution exceeds video memory bounds!\n");
591 return FALSE;
592 }
593
594 return TRUE;
595}
596
597/* EOF */
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:27
#define READ_REGISTER_ULONG(r)
Definition: arm.h:26
static const COLUMN_LIST Columns[]
Definition: listview.c:19
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define TRACE_(x)
Definition: compat.h:76
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define PAGE_SIZE
Definition: env_spec_w32.h:49
Status
Definition: gdiplustypes.h:25
@ PCIBus
Definition: hwresource.cpp:142
PVOID FrameBuffer
Definition: xboxvideo.c:28
#define ASSERT(a)
Definition: mode.c:44
#define FASTCALL
Definition: nt_native.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:173
#define VIDEO_MODE_GRAPHICS
Definition: ntddvdeo.h:364
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:248
#define VIDEO_MODE_COLOR
Definition: ntddvdeo.h:363
#define IOCTL_VIDEO_QUERY_CURRENT_MODE
Definition: ntddvdeo.h:182
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:221
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:206
struct _VIDEO_NUM_MODES VIDEO_NUM_MODES
struct _VIDEO_MEMORY_INFORMATION VIDEO_MEMORY_INFORMATION
#define VIDEO_MODE_NO_OFF_SCREEN
Definition: ntddvdeo.h:368
struct _VIDEO_MODE_INFORMATION VIDEO_MODE_INFORMATION
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
Definition: ntddvdeo.h:176
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
Definition: ntddvdeo.h:191
static ULONG ScreenWidth
Definition: pcvideo.c:114
unsigned short USHORT
Definition: pedump.c:61
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:907
VPAPI VOID NTAPI VideoPortZeroMemory(IN PVOID Destination, IN ULONG Length)
VPAPI VP_STATUS NTAPI VideoPortUnmapMemory(IN PVOID HwDeviceExtension, IN OUT PVOID VirtualAddress, IN HANDLE ProcessHandle)
LONG VP_STATUS
Definition: video.h:153
struct _VIDEO_HW_INITIALIZATION_DATA VIDEO_HW_INITIALIZATION_DATA
VPAPI ULONG NTAPI VideoPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, IN PVOID HwContext)
Definition: videoprt.c:740
VPAPI VP_STATUS NTAPI VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN OUT PULONG Length, IN PULONG InIoSpace, IN OUT PVOID *VirtualAddress)
#define VIDEO_MEMORY_SPACE_MEMORY
Definition: video.h:132
VPAPI VP_STATUS NTAPI VideoPortGetAccessRanges(_In_ PVOID HwDeviceExtension, _In_opt_ ULONG NumRequestedResources, _In_reads_opt_(NumRequestedResources) PIO_RESOURCE_DESCRIPTOR RequestedResources, _In_ ULONG NumAccessRanges, _Out_writes_(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges, _In_ PVOID VendorId, _In_ PVOID DeviceId, _Out_ PULONG Slot)
Retrieves bus-relative (mainly PCI) hardware resources access ranges and, if possible,...
Definition: resource.c:636
#define INFO_(ch,...)
Definition: debug.h:159
#define ERR_(ch,...)
Definition: debug.h:156
#define WARN_(ch,...)
Definition: debug.h:157
PHYSICAL_ADDRESS PhysFrameBufferStart
Definition: xboxvmp.h:31
PHYSICAL_ADDRESS PhysControlStart
Definition: xboxvmp.h:28
ULONG_PTR Information
Definition: video.h:326
VP_STATUS Status
Definition: video.h:323
ULONG RangeLength
Definition: video.h:216
PHYSICAL_ADDRESS RangeStart
Definition: video.h:215
PVIDEO_HW_FIND_ADAPTER HwFindAdapter
Definition: video.h:674
PVIDEO_HW_START_IO HwStartIO
Definition: video.h:677
PVIDEO_HW_POWER_SET HwSetPowerState
Definition: video.h:683
PVIDEO_HW_POWER_GET HwGetPowerState
Definition: video.h:684
PVIDEO_HW_RESET_HW HwResetHw
Definition: video.h:680
INTERFACE_TYPE AdapterInterfaceType
Definition: video.h:673
PVIDEO_HW_INITIALIZE HwInitialize
Definition: video.h:675
PVOID RequestedVirtualAddress
Definition: ntddvdeo.h:344
ULONG RequestedMode
Definition: ntddvdeo.h:359
ULONG InputBufferLength
Definition: video.h:333
PSTATUS_BLOCK StatusBlock
Definition: video.h:331
ULONG OutputBufferLength
Definition: video.h:335
static const VBE_MODE Modes[VBE_MODE_COUNT]
Definition: vbe.c:189
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1095
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1096
uint16_t * PWSTR
Definition: typedefs.h:56
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
LONGLONG QuadPart
Definition: typedefs.h:114
struct _LARGE_INTEGER::@2302 u
_In_ WDFCOLLECTION _In_ ULONG Index
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
static ULONG BytesPerPixel
Definition: xboxvideo.c:32
UCHAR NvGetCrtc(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, UCHAR Index)
Definition: xboxvmp.c:499
BOOLEAN FASTCALL XboxVmpQueryAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:490
VP_STATUS NTAPI XboxVmpGetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: xboxvmp.c:310
BOOLEAN FASTCALL XboxVmpResetDevice(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:371
UCHAR NvGetBytesPerPixel(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, ULONG ScreenWidth)
Definition: xboxvmp.c:508
VP_STATUS NTAPI XboxVmpSetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: xboxvmp.c:328
BOOLEAN NTAPI XboxVmpResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: xboxvmp.c:287
BOOLEAN NTAPI XboxVmpInitialize(PVOID HwDeviceExtension)
Definition: xboxvmp.c:98
BOOLEAN FASTCALL XboxVmpMapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:389
BOOLEAN NTAPI XboxVmpStartIO(PVOID HwDeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: xboxvmp.c:138
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:56
BOOLEAN FASTCALL XboxVmpUnmapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:448
BOOLEAN FASTCALL XboxVmpSetCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:346
BOOLEAN FASTCALL XboxVmpQueryNumAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:471
BOOLEAN FASTCALL XboxVmpQueryCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:537
struct XBOXVMP_DEVICE_EXTENSION * PXBOXVMP_DEVICE_EXTENSION
_In_ ULONG Rows
Definition: haltypes.h:7
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)
#define NV2A_VIDEO_MEMORY_SIZE
Definition: xgpu.h:16
#define NV2A_CRTC_FRAMEBUFFER_START
Definition: xgpu.h:21
#define NV2A_RAMDAC_FP_VVALID_END
Definition: xgpu.h:26
#define NV2A_CRTC_REGISTER_INDEX
Definition: xgpu.h:22
#define NV2A_CRTC_REGISTER_VALUE
Definition: xgpu.h:23
#define NV2A_RAMDAC_FP_HVALID_END
Definition: xgpu.h:25
unsigned char UCHAR
Definition: xmlstorage.h:181