From 20487e2247d8d3a79e5c4c0b954fd76297da9d60 Mon Sep 17 00:00:00 2001 From: Sameeh Jubran Date: Sun, 4 Sep 2016 16:40:56 +0300 Subject: [PATCH] On power wake call the init functions before setting the vidpn to black. Otherwise, BSOD. Acked-by: Frediano Ziglio --- qxldod/QxlDod.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp index a4b0604..f126b48 100755 --- a/qxldod/QxlDod.cpp +++ b/qxldod/QxlDod.cpp @@ -290,12 +290,16 @@ NTSTATUS QxlDod::SetPowerState(_In_ ULONG HardwareUid, _In_ DEVICE_POWER_STATE DevicePowerState, _In_ POWER_ACTION ActionType) { + NTSTATUS Status(STATUS_SUCCESS); PAGED_CODE(); DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s HardwareUid = 0x%x ActionType = %s DevicePowerState = %s AdapterPowerState = %s\n", __FUNCTION__, HardwareUid, DbgPowerActionString(ActionType), DbgDevicePowerString(DevicePowerState), DbgDevicePowerString(m_AdapterPowerState))); if (HardwareUid == DISPLAY_ADAPTER_HW_ID) { - if (DevicePowerState == PowerDeviceD0) + // There is nothing to do to specifically power up/down the display adapter + Status = m_pHWDevice->SetPowerState(DevicePowerState, &(m_CurrentModes[0].DispInfo)); + + if (NT_SUCCESS(Status) && DevicePowerState == PowerDeviceD0) { // When returning from D3 the device visibility defined to be off for all targets @@ -306,17 +310,13 @@ NTSTATUS QxlDod::SetPowerState(_In_ ULONG HardwareUid, Visibility.Visible = FALSE; SetVidPnSourceVisibility(&Visibility); } + // Store new adapter power state + m_AdapterPowerState = DevicePowerState; } - - // Store new adapter power state - m_AdapterPowerState = DevicePowerState; - - // There is nothing to do to specifically power up/down the display adapter - return m_pHWDevice->SetPowerState(DevicePowerState, &(m_CurrentModes[0].DispInfo)); } // TODO: This is where the specified monitor should be powered up/down - return STATUS_SUCCESS; + return Status; } NTSTATUS QxlDod::QueryChildRelations(_Out_writes_bytes_(ChildRelationsSize) DXGK_CHILD_DESCRIPTOR* pChildRelations,