https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c3614508737082e2048d…
commit 8c3614508737082e2048d885bb7c8f8661d73f17
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Mon Aug 12 12:34:29 2019 +0300
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Sat Aug 31 00:19:03 2019 +0200
[XBOXVMP] Add Xbox video miniport driver
Also make XboxVmp driver compatible with Video Port driver, specify
vendor id and device id explicitly in VideoPortGetAccessRanges() call
CORE-16317
---
boot/bootdata/txtsetup.sif | 2 ++
media/inf/display.inf | 9 +++++++++
win32ss/drivers/miniport/xboxvmp/CMakeLists.txt | 2 ++
win32ss/drivers/miniport/xboxvmp/xboxvmp.c | 10 ++++++----
win32ss/drivers/miniport/xboxvmp/xboxvmp_reg.inf | 13 +++++++++++++
5 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/boot/bootdata/txtsetup.sif b/boot/bootdata/txtsetup.sif
index f3f6ba6185f..feeae2404fa 100644
--- a/boot/bootdata/txtsetup.sif
+++ b/boot/bootdata/txtsetup.sif
@@ -282,11 +282,13 @@ vbe_1600x1200x8 = "VESA Display
(1600x1200x8)",,VBE,1600,1200,8
vbe_1600x1200x16 = "VESA Display (1600x1200x16)",,VBE,1600,1200,16
vbe_1600x1200x24 = "VESA Display (1600x1200x24)",,VBE,1600,1200,24
vbe_1600x1200x32 = "VESA Display (1600x1200x32)",,VBE,1600,1200,32
+xbox = "Original Xbox NV2A Framebuffer
(640x480x32)",,XboxVmp,640,480,32
[Map.Display]
;<id> = <pnp id string>
vga = "VGA Display"
vbe = "VBE Display"
+xboxvmp = "NV2A Framebuffer"
[Keyboard]
Default = "XT-, AT- or extended keyboard (83-105 keys)"
diff --git a/media/inf/display.inf b/media/inf/display.inf
index 59a511b624d..87ebba7b3db 100644
--- a/media/inf/display.inf
+++ b/media/inf/display.inf
@@ -40,6 +40,7 @@ CopyFiles = VGA.Miniport_CopyFiles.NT, VGA.Display_CopyFiles.NT
[VGA.Miniport_CopyFiles.NT]
vgamp.sys
vbemp.sys
+xboxvmp.sys
[VGA.Display_CopyFiles.NT]
vgaddi.dll
@@ -49,6 +50,7 @@ framebuf.dll
AddService = , 0x00000002
;AddService = VGA, , VGA_Service_Inst
;AddService = VBE, 0x00000003, VBE_Service_Inst ; SPSVCINST_TAGTOFRONT +
SPSVCINST_ASSOCSERVICE
+;AddService = XboxVmp, 0x00000003, XBOX_Service_Inst
[VGA_Service_Inst]
ServiceType = 1
@@ -64,6 +66,13 @@ ErrorControl = 0
ServiceBinary = %12%\vbemp.sys
LoadOrderGroup = Video Save
+[XBOX_Service_Inst]
+ServiceType = 1
+StartType = 1
+ErrorControl = 0
+ServiceBinary = %12%\xboxvmp.sys
+LoadOrderGroup = Video Save
+
;-------------------------------- STRINGS -------------------------------
[Strings]
diff --git a/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
b/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
index 02ffb3e05ca..d5f9f1332af 100644
--- a/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
+++ b/win32ss/drivers/miniport/xboxvmp/CMakeLists.txt
@@ -2,3 +2,5 @@
add_library(xboxvmp MODULE xboxvmp.c xboxvmp.rc)
set_module_type(xboxvmp kernelmodedriver)
add_importlibs(xboxvmp ntoskrnl videoprt)
+add_cd_file(TARGET xboxvmp DESTINATION reactos/system32/drivers FOR all)
+add_registry_inf(xboxvmp_reg.inf)
diff --git a/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
b/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
index 6841930d84f..6fabde00fd0 100644
--- a/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
+++ b/win32ss/drivers/miniport/xboxvmp/xboxvmp.c
@@ -71,19 +71,21 @@ XboxVmpFindAdapter(
PXBOXVMP_DEVICE_EXTENSION XboxVmpDeviceExtension;
VIDEO_ACCESS_RANGE AccessRanges[3];
VP_STATUS Status;
+ USHORT VendorId = 0x10DE; /* NVIDIA Corporation */
+ USHORT DeviceId = 0x02A0; /* NV2A XGPU */
VideoPortDebugPrint(Trace, "XboxVmpFindAdapter\n");
XboxVmpDeviceExtension = (PXBOXVMP_DEVICE_EXTENSION) HwDeviceExtension;
Status = VideoPortGetAccessRanges(HwDeviceExtension, 0, NULL, 3, AccessRanges,
- NULL, NULL, NULL);
+ &VendorId, &DeviceId, NULL);
- if (NO_ERROR == Status)
- {
+ if (Status == NO_ERROR)
+ {
XboxVmpDeviceExtension->PhysControlStart = AccessRanges[0].RangeStart;
XboxVmpDeviceExtension->ControlLength = AccessRanges[0].RangeLength;
XboxVmpDeviceExtension->PhysFrameBufferStart = AccessRanges[1].RangeStart;
- }
+ }
return Status;
}
diff --git a/win32ss/drivers/miniport/xboxvmp/xboxvmp_reg.inf
b/win32ss/drivers/miniport/xboxvmp/xboxvmp_reg.inf
new file mode 100644
index 00000000000..e7c2a3c5fdf
--- /dev/null
+++ b/win32ss/drivers/miniport/xboxvmp/xboxvmp_reg.inf
@@ -0,0 +1,13 @@
+; Xbox Nvidia driver
+[AddReg]
+HKLM,"SYSTEM\CurrentControlSet\Services\XboxVmp","ErrorControl",0x00010001,0x00000000
+HKLM,"SYSTEM\CurrentControlSet\Services\XboxVmp","Group",0x00000000,"Video
Save"
+HKLM,"SYSTEM\CurrentControlSet\Services\XboxVmp","ImagePath",0x00020000,"system32\drivers\xboxvmp.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\XboxVmp","Start",0x00010001,0x00000004
+HKLM,"SYSTEM\CurrentControlSet\Services\XboxVmp","Type",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Enum\PCI\VEN_10DE&DEV_02A0&SUBSYS_00000000&REV_A1\0000","Service",0x00000000,"XboxVmp"
+
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\XboxVmp\Device0","InstalledDisplayDrivers",0x00010000,"framebuf"
+
+; This is not true but it allows to use 3rd party drivers while having the XboxVmp driver
installed
+HKLM,"SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Services\XboxVmp\Device0","VgaCompatible",0x00010001,1