mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[VGAMP] Correctly check and report legacy resources (VGA I/O ports and memory)
As we are a non PNP driver, the call chain will be DriverEntry -> VidePortInitialize -> VideoPortFindAdapter -> HwFindAdapter. If legacy resources are available, we will fail VGAFindAdapter, so DriverEntry will fail, so vgamp.sys driver won't be used. CORE-17789
This commit is contained in:
parent
6dd94572e5
commit
951dc66c66
1 changed files with 23 additions and 5 deletions
|
@ -10,6 +10,13 @@
|
|||
#include <dderror.h>
|
||||
#include <devioctl.h>
|
||||
|
||||
VIDEO_ACCESS_RANGE VGAAccessRange[] =
|
||||
{
|
||||
{ {{0x3b0}}, 0x3bb - 0x3b0 + 1, 1, 0, 0 },
|
||||
{ {{0x3c0}}, 0x3df - 0x3c0 + 1, 1, 0, 0 },
|
||||
{ {{0xa0000}}, 0x20000, 0, 0, 0 },
|
||||
};
|
||||
|
||||
// ------------------------------------------------------- Public Interface
|
||||
|
||||
// DriverEntry
|
||||
|
@ -45,6 +52,8 @@ DriverEntry(IN PVOID Context1,
|
|||
/* InitData.HwInterrupt = VGAInterrupt; */
|
||||
InitData.HwResetHw = VGAResetHw;
|
||||
/* InitData.HwTimer = VGATimer; */
|
||||
InitData.HwLegacyResourceList = VGAAccessRange;
|
||||
InitData.HwLegacyResourceCount = ARRAYSIZE(VGAAccessRange);
|
||||
|
||||
return VideoPortInitialize(Context1, Context2, &InitData, NULL);
|
||||
}
|
||||
|
@ -82,12 +91,21 @@ VGAFindAdapter(PVOID DeviceExtension,
|
|||
PVIDEO_PORT_CONFIG_INFO ConfigInfo,
|
||||
PUCHAR Again)
|
||||
{
|
||||
/* FIXME: Determine if the adapter is present */
|
||||
*Again = FALSE;
|
||||
VP_STATUS Status;
|
||||
|
||||
ConfigInfo->VdmPhysicalVideoMemoryAddress.QuadPart = 0xa000;
|
||||
ConfigInfo->VdmPhysicalVideoMemoryLength = 0x2000;
|
||||
return NO_ERROR;
|
||||
/* FIXME: Determine if the adapter is present */
|
||||
*Again = FALSE;
|
||||
|
||||
if (ConfigInfo->Length < sizeof(VIDEO_PORT_CONFIG_INFO))
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
Status = VideoPortVerifyAccessRanges(DeviceExtension, ARRAYSIZE(VGAAccessRange), VGAAccessRange);
|
||||
if (Status != NO_ERROR)
|
||||
return Status;
|
||||
|
||||
ConfigInfo->VdmPhysicalVideoMemoryAddress = VGAAccessRange[2].RangeStart;
|
||||
ConfigInfo->VdmPhysicalVideoMemoryLength = VGAAccessRange[2].RangeLength;
|
||||
return NO_ERROR;
|
||||
|
||||
/* FIXME: Claim any necessary memory/IO resources for the adapter */
|
||||
/* FIXME: Map resources into system memory for the adapter */
|
||||
|
|
Loading…
Reference in a new issue