[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
This commit is contained in:
Stanislav Motylkov 2019-08-12 12:34:29 +03:00 committed by Hermès BÉLUSCA - MAÏTO
parent a02b3da183
commit 8c36145087
5 changed files with 32 additions and 4 deletions

View file

@ -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)"

View file

@ -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]

View file

@ -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)

View file

@ -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;
}

View file

@ -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