mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:33:04 +00:00
[VIDEOPRT] Query children only when device has been opened
HwGetVideoChildDescriptor callback must be called only after HwInitialize. CORE-17979
This commit is contained in:
parent
983d9a1c2a
commit
2538583dbe
3 changed files with 47 additions and 14 deletions
|
@ -407,6 +407,9 @@ IntVideoPortDispatchOpen(
|
||||||
{
|
{
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
InterlockedIncrement((PLONG)&DeviceExtension->DeviceOpened);
|
InterlockedIncrement((PLONG)&DeviceExtension->DeviceOpened);
|
||||||
|
|
||||||
|
/* Query children, now that device is opened */
|
||||||
|
VideoPortEnumerateChildren(DeviceExtension->MiniPortDeviceExtension, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -938,6 +941,18 @@ IntVideoPortQueryBusRelations(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
PVIDEO_PORT_CHILD_EXTENSION ChildExtension;
|
PVIDEO_PORT_CHILD_EXTENSION ChildExtension;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
PLIST_ENTRY CurrentEntry;
|
PLIST_ENTRY CurrentEntry;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
if (InterlockedCompareExchange((PLONG)&DeviceExtension->DeviceOpened, 0, 0) == 0)
|
||||||
|
{
|
||||||
|
/* Device not opened. Don't enumerate children yet */
|
||||||
|
WARN_(VIDEOPRT, "Skipping child enumeration because device is not opened");
|
||||||
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
|
}
|
||||||
|
/* Query children of the device. */
|
||||||
|
Status = IntVideoPortEnumerateChildren(DeviceObject, Irp);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
return Status;
|
||||||
|
|
||||||
/* Count the children */
|
/* Count the children */
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
|
@ -474,9 +474,6 @@ IntVideoPortFindAdapter(
|
||||||
&HwResetAdaptersLock);
|
&HwResetAdaptersLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Query children of the device. */
|
|
||||||
VideoPortEnumerateChildren(&DeviceExtension->MiniPortDeviceExtension, NULL);
|
|
||||||
|
|
||||||
INFO_(VIDEOPRT, "STATUS_SUCCESS\n");
|
INFO_(VIDEOPRT, "STATUS_SUCCESS\n");
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
|
|
||||||
|
@ -1170,11 +1167,10 @@ VideoPortSynchronizeExecution(
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
VP_STATUS
|
NTSTATUS NTAPI
|
||||||
NTAPI
|
IntVideoPortEnumerateChildren(
|
||||||
VideoPortEnumerateChildren(
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PVOID HwDeviceExtension,
|
IN PIRP Irp)
|
||||||
IN PVOID Reserved)
|
|
||||||
{
|
{
|
||||||
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||||
ULONG Status;
|
ULONG Status;
|
||||||
|
@ -1187,17 +1183,17 @@ VideoPortEnumerateChildren(
|
||||||
PVIDEO_PORT_CHILD_EXTENSION ChildExtension;
|
PVIDEO_PORT_CHILD_EXTENSION ChildExtension;
|
||||||
|
|
||||||
INFO_(VIDEOPRT, "Starting child device probe\n");
|
INFO_(VIDEOPRT, "Starting child device probe\n");
|
||||||
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
if (DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor == NULL)
|
if (DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor == NULL)
|
||||||
{
|
{
|
||||||
WARN_(VIDEOPRT, "Miniport's HwGetVideoChildDescriptor is NULL!\n");
|
WARN_(VIDEOPRT, "Miniport's HwGetVideoChildDescriptor is NULL!\n");
|
||||||
return NO_ERROR;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsListEmpty(&DeviceExtension->ChildDeviceList))
|
if (!IsListEmpty(&DeviceExtension->ChildDeviceList))
|
||||||
{
|
{
|
||||||
ERR_(VIDEOPRT, "FIXME: Support calling VideoPortEnumerateChildren again!\n");
|
ERR_(VIDEOPRT, "FIXME: Support calling VideoPortEnumerateChildren again!\n");
|
||||||
return NO_ERROR;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enumerate the children */
|
/* Enumerate the children */
|
||||||
|
@ -1239,7 +1235,7 @@ VideoPortEnumerateChildren(
|
||||||
|
|
||||||
INFO_(VIDEOPRT, "Probing child: %d\n", ChildEnumInfo.ChildIndex);
|
INFO_(VIDEOPRT, "Probing child: %d\n", ChildEnumInfo.ChildIndex);
|
||||||
Status = DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor(
|
Status = DeviceExtension->DriverExtension->InitializationData.HwGetVideoChildDescriptor(
|
||||||
HwDeviceExtension,
|
DeviceExtension->MiniPortDeviceExtension,
|
||||||
&ChildEnumInfo,
|
&ChildEnumInfo,
|
||||||
&ChildExtension->ChildType,
|
&ChildExtension->ChildType,
|
||||||
ChildExtension->ChildDescriptor,
|
ChildExtension->ChildDescriptor,
|
||||||
|
@ -1331,8 +1327,25 @@ VideoPortEnumerateChildren(
|
||||||
&ChildExtension->ListEntry);
|
&ChildExtension->ListEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Trigger reenumeration by the PnP manager */
|
return STATUS_SUCCESS;
|
||||||
IoInvalidateDeviceRelations(DeviceExtension->PhysicalDeviceObject, BusRelations);
|
}
|
||||||
|
|
||||||
|
VP_STATUS
|
||||||
|
NTAPI
|
||||||
|
VideoPortEnumerateChildren(
|
||||||
|
IN PVOID HwDeviceExtension,
|
||||||
|
IN PVOID Reserved)
|
||||||
|
{
|
||||||
|
PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
||||||
|
DeviceExtension = VIDEO_PORT_GET_DEVICE_EXTENSION(HwDeviceExtension);
|
||||||
|
ASSERT(DeviceExtension);
|
||||||
|
|
||||||
|
if (DeviceExtension->PhysicalDeviceObject)
|
||||||
|
{
|
||||||
|
/* Trigger reenumeration by the PnP manager */
|
||||||
|
IoInvalidateDeviceRelations(DeviceExtension->PhysicalDeviceObject, BusRelations);
|
||||||
|
}
|
||||||
|
|
||||||
return NO_ERROR;
|
return NO_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,6 +279,11 @@ IntVideoPortGetProcAddress(
|
||||||
IN PVOID HwDeviceExtension,
|
IN PVOID HwDeviceExtension,
|
||||||
IN PUCHAR FunctionName);
|
IN PUCHAR FunctionName);
|
||||||
|
|
||||||
|
NTSTATUS NTAPI
|
||||||
|
IntVideoPortEnumerateChildren(
|
||||||
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
|
IN PIRP Irp);
|
||||||
|
|
||||||
/* int10.c */
|
/* int10.c */
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue