mirror of
https://github.com/reactos/reactos.git
synced 2024-07-04 11:44:33 +00:00
[VIDEOPRT]
- Don't add legacy resources twice in VideoPortGetAccessRanges - Fixes Cirrus driver initialization svn path=/trunk/; revision=56124
This commit is contained in:
parent
72a03e8c29
commit
4450ed65cd
|
@ -567,7 +567,7 @@ VideoPortGetAccessRanges(
|
|||
PCI_COMMON_CONFIG Config;
|
||||
PCM_RESOURCE_LIST AllocatedResources;
|
||||
NTSTATUS Status;
|
||||
UINT AssignedCount;
|
||||
UINT AssignedCount = 0;
|
||||
CM_FULL_RESOURCE_DESCRIPTOR *FullList;
|
||||
CM_PARTIAL_RESOURCE_DESCRIPTOR *Descriptor;
|
||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||
|
@ -682,6 +682,21 @@ VideoPortGetAccessRanges(
|
|||
}
|
||||
DeviceExtension->AllocatedResources = AllocatedResources;
|
||||
DeviceExtension->SystemIoSlotNumber = PciSlotNumber.u.AsULONG;
|
||||
|
||||
/* Add legacy resources to the resources from HAL */
|
||||
Status = IntVideoPortGetLegacyResources(DriverExtension, DeviceExtension,
|
||||
&LegacyAccessRanges, &LegacyAccessRangeCount);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return ERROR_DEV_NOT_EXIST;
|
||||
|
||||
if (NumAccessRanges < LegacyAccessRangeCount)
|
||||
{
|
||||
ERR_(VIDEOPRT, "Too many legacy access ranges found\n");
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
RtlCopyMemory(AccessRanges, LegacyAccessRanges, LegacyAccessRangeCount * sizeof(VIDEO_ACCESS_RANGE));
|
||||
AssignedCount = LegacyAccessRangeCount;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -726,17 +741,6 @@ VideoPortGetAccessRanges(
|
|||
/* Return the slot number if the caller wants it */
|
||||
if (Slot != NULL) *Slot = DeviceExtension->SystemIoBusNumber;
|
||||
|
||||
Status = IntVideoPortGetLegacyResources(DriverExtension, DeviceExtension,
|
||||
&LegacyAccessRanges, &LegacyAccessRangeCount);
|
||||
if (!NT_SUCCESS(Status))
|
||||
return ERROR_DEV_NOT_EXIST;
|
||||
if (NumAccessRanges < LegacyAccessRangeCount)
|
||||
{
|
||||
ERR_(VIDEOPRT, "Too many legacy access ranges found\n");
|
||||
return ERROR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
RtlCopyMemory(AccessRanges, LegacyAccessRanges, LegacyAccessRangeCount * sizeof(VIDEO_ACCESS_RANGE));
|
||||
AssignedCount = LegacyAccessRangeCount;
|
||||
for (FullList = AllocatedResources->List;
|
||||
FullList < AllocatedResources->List + AllocatedResources->Count;
|
||||
FullList++)
|
||||
|
|
Loading…
Reference in a new issue