ReactOS  0.4.14-dev-50-g13bb5e2
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 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 /* PUBLIC AND PRIVATE FUNCTIONS ***********************************************/
23 
24 ULONG
25 NTAPI
29 {
31 
32  VideoPortZeroMemory(&InitData, sizeof(InitData));
33  InitData.AdapterInterfaceType = PCIBus;
37  InitData.HwStartIO = XboxVmpStartIO;
38  InitData.HwResetHw = XboxVmpResetHw;
42 
43  return VideoPortInitialize(Context1, Context2, &InitData, NULL);
44 }
45 
46 /*
47  * XboxVmpFindAdapter
48  *
49  * Detects the Xbox Nvidia display adapter.
50  */
51 
53 NTAPI
55  IN PVOID HwDeviceExtension,
57  IN PWSTR ArgumentString,
58  IN OUT PVIDEO_PORT_CONFIG_INFO ConfigInfo,
59  OUT PUCHAR Again)
60 {
61  PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
62  VIDEO_ACCESS_RANGE AccessRanges[3];
64  USHORT VendorId = 0x10DE; /* NVIDIA Corporation */
65  USHORT DeviceId = 0x02A0; /* NV2A XGPU */
66 
67  TRACE_(IHVVIDEO, "XboxVmpFindAdapter\n");
68 
69  XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;
70 
71  Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL, 3, AccessRanges,
72  &VendorId, &DeviceId, NULL);
73 
74  if (Status == NO_ERROR)
75  {
76  XboxVmpDeviceExtension->PhysControlStart = AccessRanges[0].RangeStart;
77  XboxVmpDeviceExtension->ControlLength = AccessRanges[0].RangeLength;
78  XboxVmpDeviceExtension->PhysFrameBufferStart = AccessRanges[1].RangeStart;
79  }
80 
81  return Status;
82 }
83 
84 /*
85  * XboxVmpInitialize
86  *
87  * Performs the first initialization of the adapter, after the HAL has given
88  * up control of the video hardware to the video port driver.
89  */
90 
91 BOOLEAN
92 NTAPI
94  PVOID HwDeviceExtension)
95 {
96  PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
97  ULONG inIoSpace = VIDEO_MEMORY_SPACE_MEMORY;
98  ULONG Length;
99 
100  TRACE_(IHVVIDEO, "XboxVmpInitialize\n");
101 
102  XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension;
103 
104  Length = XboxVmpDeviceExtension->ControlLength;
105  XboxVmpDeviceExtension->VirtControlStart = NULL;
106 
107  if (VideoPortMapMemory(HwDeviceExtension,
108  XboxVmpDeviceExtension->PhysControlStart,
109  &Length,
110  &inIoSpace,
111  &XboxVmpDeviceExtension->VirtControlStart) != NO_ERROR)
112  {
113  ERR_(IHVVIDEO, "Failed to map control memory\n");
114  return FALSE;
115  }
116 
117  INFO_(IHVVIDEO, "Mapped 0x%x bytes of control mem at 0x%x to virt addr 0x%x\n",
118  XboxVmpDeviceExtension->ControlLength,
119  XboxVmpDeviceExtension->PhysControlStart.u.LowPart,
120  XboxVmpDeviceExtension->VirtControlStart);
121 
122  return TRUE;
123 }
124 
125 /*
126  * XboxVmpStartIO
127  *
128  * Processes the specified Video Request Packet.
129  */
130 
131 BOOLEAN
132 NTAPI
134  PVOID HwDeviceExtension,
135  PVIDEO_REQUEST_PACKET RequestPacket)
136 {
137  BOOLEAN Result;
138 
139  RequestPacket->StatusBlock->Status = ERROR_INVALID_PARAMETER;
140 
141  switch (RequestPacket->IoControlCode)
142  {
144  {
145  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_SET_CURRENT_MODE\n");
146 
147  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
148  {
149  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
150  return TRUE;
151  }
152 
154  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
155  (PVIDEO_MODE)RequestPacket->InputBuffer,
156  RequestPacket->StatusBlock);
157  break;
158  }
159 
161  {
162  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_RESET_DEVICE\n");
163 
165  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
166  RequestPacket->StatusBlock);
167  break;
168  }
169 
171  {
172  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_MAP_VIDEO_MEMORY\n");
173 
174  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION) ||
175  RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
176  {
177  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
178  return TRUE;
179  }
180 
182  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
183  (PVIDEO_MEMORY)RequestPacket->InputBuffer,
184  (PVIDEO_MEMORY_INFORMATION)RequestPacket->OutputBuffer,
185  RequestPacket->StatusBlock);
186  break;
187  }
188 
190  {
191  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_UNMAP_VIDEO_MEMORY\n");
192 
193  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
194  {
195  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
196  return TRUE;
197  }
198 
200  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
201  (PVIDEO_MEMORY)RequestPacket->InputBuffer,
202  RequestPacket->StatusBlock);
203  break;
204  }
205 
207  {
208  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES\n");
209 
210  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
211  {
212  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
213  return TRUE;
214  }
215 
217  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
218  (PVIDEO_NUM_MODES)RequestPacket->OutputBuffer,
219  RequestPacket->StatusBlock);
220  break;
221  }
222 
224  {
225  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_AVAIL_MODES\n");
226 
227  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
228  {
229  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
230  return TRUE;
231  }
232 
234  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
235  (PVIDEO_MODE_INFORMATION)RequestPacket->OutputBuffer,
236  RequestPacket->StatusBlock);
237  break;
238  }
239 
241  {
242  TRACE_(IHVVIDEO, "XboxVmpStartIO IOCTL_VIDEO_QUERY_CURRENT_MODE\n");
243 
244  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
245  {
246  RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
247  return TRUE;
248  }
249 
251  (PXBOXVMP_DEVICE_EXTENSION)HwDeviceExtension,
252  (PVIDEO_MODE_INFORMATION)RequestPacket->OutputBuffer,
253  RequestPacket->StatusBlock);
254  break;
255  }
256 
257  default:
258  {
259  WARN_(IHVVIDEO, "XboxVmpStartIO 0x%x not implemented\n", RequestPacket->IoControlCode);
260 
261  RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
262  return FALSE;
263  }
264  }
265 
266  if (Result)
267  {
268  RequestPacket->StatusBlock->Status = NO_ERROR;
269  }
270 
271  return TRUE;
272 }
273 
274 /*
275  * XboxVmpResetHw
276  *
277  * This function is called to reset the hardware to a known state.
278  */
279 
280 BOOLEAN
281 NTAPI
283  PVOID DeviceExtension,
284  ULONG Columns,
285  ULONG Rows)
286 {
287  TRACE_(IHVVIDEO, "XboxVmpResetHw\n");
288 
289  if (!XboxVmpResetDevice((PXBOXVMP_DEVICE_EXTENSION)DeviceExtension, NULL))
290  {
291  return FALSE;
292  }
293 
294  return TRUE;
295 }
296 
297 /*
298  * XboxVmpGetPowerState
299  *
300  * Queries whether the device can support the requested power state.
301  */
302 
303 VP_STATUS
304 NTAPI
306  PVOID HwDeviceExtension,
307  ULONG HwId,
308  PVIDEO_POWER_MANAGEMENT VideoPowerControl)
309 {
310  ERR_(IHVVIDEO, "XboxVmpGetPowerState is not supported\n");
311 
312  return ERROR_INVALID_FUNCTION;
313 }
314 
315 /*
316  * XboxVmpSetPowerState
317  *
318  * Sets the power state of the specified device
319  */
320 
321 VP_STATUS
322 NTAPI
324  PVOID HwDeviceExtension,
325  ULONG HwId,
326  PVIDEO_POWER_MANAGEMENT VideoPowerControl)
327 {
328  ERR_(IHVVIDEO, "XboxVmpSetPowerState not supported\n");
329 
330  return ERROR_INVALID_FUNCTION;
331 }
332 
333 /*
334  * VBESetCurrentMode
335  *
336  * Sets the adapter to the specified operating mode.
337  */
338 
339 BOOLEAN
340 FASTCALL
342  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
343  PVIDEO_MODE RequestedMode,
344  PSTATUS_BLOCK StatusBlock)
345 {
346  if (RequestedMode->RequestedMode != 0)
347  {
348  return FALSE;
349  }
350 
351  /* Nothing to do, really. We only support a single mode and we're already
352  * in that mode
353  */
354  return TRUE;
355 }
356 
357 /*
358  * XboxVmpResetDevice
359  *
360  * Resets the video hardware to the default mode, to which it was initialized
361  * at system boot.
362  */
363 
364 BOOLEAN
365 FASTCALL
367  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
368  PSTATUS_BLOCK StatusBlock)
369 {
370  /* There is nothing to be done here */
371 
372  return TRUE;
373 }
374 
375 /*
376  * XboxVmpMapVideoMemory
377  *
378  * Maps the video hardware frame buffer and video RAM into the virtual address
379  * space of the requestor.
380  */
381 
382 BOOLEAN
383 FASTCALL
385  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
386  PVIDEO_MEMORY RequestedAddress,
387  PVIDEO_MEMORY_INFORMATION MapInformation,
388  PSTATUS_BLOCK StatusBlock)
389 {
391  ULONG inIoSpace = VIDEO_MEMORY_SPACE_MEMORY;
392 
393  StatusBlock->Information = sizeof(VIDEO_MEMORY_INFORMATION);
394 
395  /* Reuse framebuffer that was set up by firmware */
397  if (FrameBuffer.QuadPart != 0x3C00000 && FrameBuffer.QuadPart != 0x7C00000)
398  {
399  /* Check framebuffer address (high 4 MB of either 64 or 128 MB RAM) */
400  WARN_(IHVVIDEO, "Non-standard framebuffer address 0x%p\n", FrameBuffer.QuadPart);
401  }
402  /* Verify that framebuffer address is page-aligned */
403  ASSERT(FrameBuffer.QuadPart % PAGE_SIZE == 0);
404 
405  FrameBuffer.QuadPart += DeviceExtension->PhysFrameBufferStart.QuadPart;
406  MapInformation->VideoRamBase = RequestedAddress->RequestedVirtualAddress;
407  /* FIXME: obtain fb size from firmware somehow (Cromwell reserves high 4 MB of RAM) */
408  MapInformation->VideoRamLength = NV2A_VIDEO_MEMORY_SIZE;
409 
411  DeviceExtension,
412  FrameBuffer,
413  &MapInformation->VideoRamLength,
414  &inIoSpace,
415  &MapInformation->VideoRamBase);
416 
417  MapInformation->FrameBufferBase = MapInformation->VideoRamBase;
418  MapInformation->FrameBufferLength = MapInformation->VideoRamLength;
419 
420  /* Tell the nVidia controller about the framebuffer */
422 
423  INFO_(IHVVIDEO, "Mapped 0x%x bytes of phys mem at 0x%lx to virt addr 0x%p\n",
424  MapInformation->VideoRamLength, FrameBuffer.u.LowPart, MapInformation->VideoRamBase);
425 
426  return TRUE;
427 }
428 
429 /*
430  * VBEUnmapVideoMemory
431  *
432  * Releases a mapping between the virtual address space and the adapter's
433  * frame buffer and video RAM.
434  */
435 
436 BOOLEAN
437 FASTCALL
439  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
440  PVIDEO_MEMORY VideoMemory,
441  PSTATUS_BLOCK StatusBlock)
442 {
444  DeviceExtension,
445  VideoMemory->RequestedVirtualAddress,
446  NULL);
447 
448  return TRUE;
449 }
450 
451 /*
452  * XboxVmpQueryNumAvailModes
453  *
454  * Returns the number of video modes supported by the adapter and the size
455  * in bytes of the video mode information, which can be used to allocate a
456  * buffer for an IOCTL_VIDEO_QUERY_AVAIL_MODES request.
457  */
458 
459 BOOLEAN
460 FASTCALL
462  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
464  PSTATUS_BLOCK StatusBlock)
465 {
466  Modes->NumModes = 1;
467  Modes->ModeInformationLength = sizeof(VIDEO_MODE_INFORMATION);
468  StatusBlock->Information = sizeof(VIDEO_NUM_MODES);
469  return TRUE;
470 }
471 
472 /*
473  * XboxVmpQueryAvailModes
474  *
475  * Returns information about each video mode supported by the adapter.
476  */
477 
478 BOOLEAN
479 FASTCALL
481  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
483  PSTATUS_BLOCK StatusBlock)
484 {
485  return XboxVmpQueryCurrentMode(DeviceExtension, VideoMode, StatusBlock);
486 }
487 
488 UCHAR
490  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
491  UCHAR Index)
492 {
493  *((PUCHAR)((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_CRTC_REGISTER_INDEX)) = Index;
494  return *((PUCHAR)((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_CRTC_REGISTER_VALUE));
495 }
496 
497 UCHAR
499  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
501 {
503 
504  /* Get BPP directly from NV2A CRTC (magic constants are from Cromwell) */
505  BytesPerPixel = 8 * (((NvGetCrtc(DeviceExtension, 0x19) & 0xE0) << 3) | (NvGetCrtc(DeviceExtension, 0x13) & 0xFF)) / ScreenWidth;
506 
507  if (BytesPerPixel == 4)
508  {
509  ASSERT((NvGetCrtc(DeviceExtension, 0x28) & 0xF) == BytesPerPixel - 1);
510  }
511  else
512  {
513  ASSERT((NvGetCrtc(DeviceExtension, 0x28) & 0xF) == BytesPerPixel);
514  }
515 
516  return BytesPerPixel;
517 }
518 
519 /*
520  * VBEQueryCurrentMode
521  *
522  * Returns information about current video mode.
523  */
524 
525 BOOLEAN
526 FASTCALL
528  PXBOXVMP_DEVICE_EXTENSION DeviceExtension,
530  PSTATUS_BLOCK StatusBlock)
531 {
533 
534  VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
535  VideoMode->ModeIndex = 0;
536 
537  VideoMode->VisScreenWidth = *((PULONG)((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_RAMDAC_FP_HVALID_END)) + 1;
538  VideoMode->VisScreenHeight = *((PULONG)((ULONG_PTR)DeviceExtension->VirtControlStart + NV2A_RAMDAC_FP_VVALID_END)) + 1;
539 
540  if (VideoMode->VisScreenWidth <= 1 || VideoMode->VisScreenHeight <= 1)
541  {
542  ERR_(IHVVIDEO, "Cannot obtain current screen resolution!\n");
543  return FALSE;
544  }
545 
546  BytesPerPixel = NvGetBytesPerPixel(DeviceExtension, VideoMode->VisScreenWidth);
547  ASSERT(BytesPerPixel >= 1 && BytesPerPixel <= 4);
548 
549  VideoMode->ScreenStride = VideoMode->VisScreenWidth * BytesPerPixel;
550  VideoMode->NumberOfPlanes = 1;
551  VideoMode->BitsPerPlane = BytesPerPixel * 8;
552  VideoMode->Frequency = 1;
553  VideoMode->XMillimeter = 0; /* FIXME */
554  VideoMode->YMillimeter = 0; /* FIXME */
555  if (BytesPerPixel >= 3)
556  {
557  VideoMode->NumberRedBits = 8;
558  VideoMode->NumberGreenBits = 8;
559  VideoMode->NumberBlueBits = 8;
560  VideoMode->RedMask = 0xFF0000;
561  VideoMode->GreenMask = 0x00FF00;
562  VideoMode->BlueMask = 0x0000FF;
563  }
564  else
565  {
566  /* FIXME: not implemented */
567  WARN_(IHVVIDEO, "BytesPerPixel %d - not implemented\n", BytesPerPixel);
568  }
569  VideoMode->VideoMemoryBitmapWidth = VideoMode->VisScreenWidth;
570  VideoMode->VideoMemoryBitmapHeight = VideoMode->VisScreenHeight;
571  VideoMode->AttributeFlags = VIDEO_MODE_GRAPHICS | VIDEO_MODE_COLOR |
573  VideoMode->DriverSpecificAttributeFlags = 0;
574 
575  StatusBlock->Information = sizeof(VIDEO_MODE_INFORMATION);
576 
577  /* Verify that screen fits framebuffer size */
578  if (VideoMode->VisScreenWidth * VideoMode->VisScreenHeight * (VideoMode->BitsPerPlane / 8) > NV2A_VIDEO_MEMORY_SIZE)
579  {
580  ERR_(IHVVIDEO, "Current screen resolution exceeds video memory bounds!\n");
581  return FALSE;
582  }
583 
584  return TRUE;
585 }
586 
587 /* EOF */
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
struct _VIDEO_NUM_MODES VIDEO_NUM_MODES
BOOLEAN FASTCALL XboxVmpQueryCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:527
BOOLEAN NTAPI XboxVmpStartIO(PVOID HwDeviceExtension, PVIDEO_REQUEST_PACKET RequestPacket)
Definition: xboxvmp.c:133
#define INFO_(ch,...)
Definition: debug.h:159
PVIDEO_HW_POWER_SET HwSetPowerState
Definition: video.h:675
static ULONG BytesPerPixel
Definition: xboxvideo.c:31
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
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
#define ERR_(ch,...)
Definition: debug.h:156
BOOLEAN NTAPI XboxVmpInitialize(PVOID HwDeviceExtension)
Definition: xboxvmp.c:93
_Must_inspect_result_ _In_ PVOID _In_ struct _HW_INITIALIZATION_DATA _In_ PVOID HwContext
Definition: srb.h:664
PHYSICAL_ADDRESS PhysControlStart
Definition: xboxvmp.h:35
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:137
INTERFACE_TYPE AdapterInterfaceType
Definition: video.h:665
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:104
PVOID RequestedVirtualAddress
Definition: ntddvdeo.h:274
UCHAR NvGetCrtc(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, UCHAR Index)
Definition: xboxvmp.c:489
VPAPI ULONG NTAPI VideoPortInitialize(IN PVOID Argument1, IN PVOID Argument2, IN PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, IN PVOID HwContext)
Definition: videoprt.c:455
PVIDEO_HW_POWER_GET HwGetPowerState
Definition: video.h:676
BOOLEAN FASTCALL XboxVmpSetCurrentMode(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE RequestedMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:341
ULONG InputBufferLength
Definition: video.h:333
#define NO_ERROR
Definition: dderror.h:5
#define FASTCALL
Definition: nt_native.h:50
VPAPI VOID NTAPI VideoPortZeroMemory(IN PVOID Destination, IN ULONG Length)
BOOLEAN FASTCALL XboxVmpResetDevice(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:366
PVIDEO_HW_START_IO HwStartIO
Definition: video.h:669
#define IOCTL_VIDEO_QUERY_CURRENT_MODE
Definition: ntddvdeo.h:113
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define VIDEO_MODE_NO_OFF_SCREEN
Definition: ntddvdeo.h:298
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:152
ULONG RequestedMode
Definition: ntddvdeo.h:289
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define NV2A_CRTC_REGISTER_VALUE
Definition: machxbox.h:44
#define NV2A_RAMDAC_FP_VVALID_END
Definition: machxbox.h:47
VP_STATUS NTAPI XboxVmpGetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: xboxvmp.c:305
struct _LARGE_INTEGER::@2201 u
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 XboxVmpQueryAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MODE_INFORMATION VideoMode, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:480
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
UCHAR NvGetBytesPerPixel(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, ULONG ScreenWidth)
Definition: xboxvmp.c:498
struct _VIDEO_HW_INITIALIZATION_DATA VIDEO_HW_INITIALIZATION_DATA
_In_ ULONG Rows
Definition: haltypes.h:7
_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:426
#define NV2A_CRTC_REGISTER_INDEX
Definition: machxbox.h:43
ULONG NTAPI DriverEntry(IN PVOID Context1, IN PVOID Context2)
Definition: xboxvmp.c:26
#define NV2A_VIDEO_MEMORY_SIZE
Definition: xboxvmp.h:25
PVIDEO_HW_INITIALIZE HwInitialize
Definition: video.h:667
ULONG OutputBufferLength
Definition: video.h:335
PHYSICAL_ADDRESS PhysFrameBufferStart
Definition: xboxvmp.h:38
#define NV2A_CONTROL_FRAMEBUFFER_ADDRESS_OFFSET
Definition: xboxvmp.h:27
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:179
#define TRACE_(x)
Definition: compat.h:66
VPAPI VP_STATUS NTAPI VideoPortMapMemory(IN PVOID HwDeviceExtension, IN PHYSICAL_ADDRESS PhysicalAddress, IN OUT PULONG Length, IN PULONG InIoSpace, IN OUT PVOID *VirtualAddress)
struct _VIDEO_MEMORY_INFORMATION VIDEO_MEMORY_INFORMATION
VP_STATUS NTAPI XboxVmpSetPowerState(PVOID HwDeviceExtension, ULONG HwId, PVIDEO_POWER_MANAGEMENT VideoPowerControl)
Definition: xboxvmp.c:323
PVIDEO_HW_FIND_ADAPTER HwFindAdapter
Definition: video.h:666
static const UCHAR Index[8]
Definition: usbohci.c:18
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VP_STATUS Status
Definition: video.h:323
unsigned char UCHAR
Definition: xmlstorage.h:181
PVIDEO_HW_RESET_HW HwResetHw
Definition: video.h:672
BOOLEAN NTAPI XboxVmpResetHw(PVOID DeviceExtension, ULONG Columns, ULONG Rows)
Definition: xboxvmp.c:282
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
Definition: ntddvdeo.h:122
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
Definition: ntddvdeo.h:107
#define PAGE_SIZE
Definition: env_spec_w32.h:49
VPAPI VP_STATUS NTAPI VideoPortUnmapMemory(IN PVOID HwDeviceExtension, IN OUT PVOID VirtualAddress, IN HANDLE ProcessHandle)
BOOLEAN FASTCALL XboxVmpQueryNumAvailModes(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_NUM_MODES Modes, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:461
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1094
Status
Definition: gdiplustypes.h:24
static const COLUMN_LIST Columns[]
Definition: listview.c:19
unsigned short USHORT
Definition: pedump.c:61
#define VIDEO_MODE_COLOR
Definition: ntddvdeo.h:293
PSTATUS_BLOCK StatusBlock
Definition: video.h:331
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1094
unsigned int * PULONG
Definition: retypes.h:1
static ULONG ScreenWidth
Definition: pcvideo.c:112
BOOLEAN FASTCALL XboxVmpMapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY RequestedAddress, PVIDEO_MEMORY_INFORMATION MapInformation, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:384
VPAPI VP_STATUS NTAPI VideoPortGetAccessRanges(IN PVOID HwDeviceExtension, IN ULONG NumRequestedResources, IN PIO_RESOURCE_DESCRIPTOR RequestedResources OPTIONAL, IN ULONG NumAccessRanges, OUT PVIDEO_ACCESS_RANGE AccessRanges, IN PVOID VendorId, IN PVOID DeviceId, OUT PULONG Slot)
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
#define NV2A_RAMDAC_FP_HVALID_END
Definition: machxbox.h:46
PVOID FrameBuffer
Definition: xboxvideo.c:27
#define VIDEO_MEMORY_SPACE_MEMORY
Definition: video.h:132
struct _VIDEO_MODE_INFORMATION VIDEO_MODE_INFORMATION
BOOLEAN FASTCALL XboxVmpUnmapVideoMemory(PXBOXVMP_DEVICE_EXTENSION DeviceExtension, PVIDEO_MEMORY VideoMemory, PSTATUS_BLOCK StatusBlock)
Definition: xboxvmp.c:438
#define WARN_(ch,...)
Definition: debug.h:157
ULONG RangeLength
Definition: video.h:216
ULONG_PTR Information
Definition: video.h:326
LONGLONG QuadPart
Definition: typedefs.h:112
PHYSICAL_ADDRESS RangeStart
Definition: video.h:215
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define VIDEO_MODE_GRAPHICS
Definition: ntddvdeo.h:294