mirror of
https://github.com/reactos/reactos.git
synced 2025-06-05 17:30:32 +00:00
[WIN32SS] Add PDEVOBJ_vEnableDisplay and PDEVOBJ_bDisplayDisplay
Use them where appropriate.
This commit is contained in:
parent
34085be22d
commit
c5fb89dced
2 changed files with 50 additions and 6 deletions
|
@ -276,6 +276,45 @@ PDEVOBJ_pSurface(
|
||||||
return ppdev->pSurface;
|
return ppdev->pSurface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
PDEVOBJ_vEnableDisplay(
|
||||||
|
_Inout_ PPDEVOBJ ppdev)
|
||||||
|
{
|
||||||
|
BOOL assertVal;
|
||||||
|
|
||||||
|
if (!(ppdev->flFlags & PDEV_DISABLED))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Try to enable display until success */
|
||||||
|
do
|
||||||
|
{
|
||||||
|
TRACE("DrvAssertMode(dhpdev %p, TRUE)\n", ppdev->dhpdev);
|
||||||
|
assertVal = ppdev->pfn.AssertMode(ppdev->dhpdev, TRUE);
|
||||||
|
TRACE("DrvAssertMode(dhpdev %p, TRUE) => %d\n", ppdev->dhpdev, assertVal);
|
||||||
|
} while (!assertVal);
|
||||||
|
|
||||||
|
ppdev->flFlags &= ~PDEV_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
PDEVOBJ_bDisableDisplay(
|
||||||
|
_Inout_ PPDEVOBJ ppdev)
|
||||||
|
{
|
||||||
|
BOOL assertVal;
|
||||||
|
|
||||||
|
if (ppdev->flFlags & PDEV_DISABLED)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
TRACE("DrvAssertMode(dhpdev %p, FALSE)\n", ppdev->dhpdev);
|
||||||
|
assertVal = ppdev->pfn.AssertMode(ppdev->dhpdev, FALSE);
|
||||||
|
TRACE("DrvAssertMode(dhpdev %p, FALSE) => %d\n", ppdev->dhpdev, assertVal);
|
||||||
|
|
||||||
|
if (assertVal)
|
||||||
|
ppdev->flFlags |= PDEV_DISABLED;
|
||||||
|
|
||||||
|
return assertVal;
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
PDEVOBJ_vRefreshModeList(
|
PDEVOBJ_vRefreshModeList(
|
||||||
|
@ -509,9 +548,9 @@ PDEVOBJ_bSwitchMode(
|
||||||
// pdm = LDEVOBJ_bProbeAndCaptureDevmode(ppdev, pdm);
|
// pdm = LDEVOBJ_bProbeAndCaptureDevmode(ppdev, pdm);
|
||||||
|
|
||||||
/* 1. Temporarily disable the current PDEV and reset video to its default mode */
|
/* 1. Temporarily disable the current PDEV and reset video to its default mode */
|
||||||
if (!ppdev->pfn.AssertMode(ppdev->dhpdev, FALSE))
|
if (!PDEVOBJ_bDisableDisplay(ppdev))
|
||||||
{
|
{
|
||||||
DPRINT1("DrvAssertMode(FALSE) failed\n");
|
DPRINT1("PDEVOBJ_bDisableDisplay() failed\n");
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -560,10 +599,7 @@ PDEVOBJ_bSwitchMode(
|
||||||
|
|
||||||
leave2:
|
leave2:
|
||||||
/* Set the new video mode, or restore the original one in case of failure */
|
/* Set the new video mode, or restore the original one in case of failure */
|
||||||
if (!ppdev->pfn.AssertMode(ppdev->dhpdev, TRUE))
|
PDEVOBJ_vEnableDisplay(ppdev);
|
||||||
{
|
|
||||||
DPRINT1("DrvAssertMode(TRUE) failed\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
leave:
|
leave:
|
||||||
/* Unlock everything else */
|
/* Unlock everything else */
|
||||||
|
|
|
@ -219,4 +219,12 @@ PDEVOBJ_bDynamicModeChange(
|
||||||
_Inout_ PPDEVOBJ ppdev,
|
_Inout_ PPDEVOBJ ppdev,
|
||||||
_Inout_ PPDEVOBJ ppdev2);
|
_Inout_ PPDEVOBJ ppdev2);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
PDEVOBJ_vEnableDisplay(
|
||||||
|
_Inout_ PPDEVOBJ ppdev);
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
PDEVOBJ_bDisableDisplay(
|
||||||
|
_Inout_ PPDEVOBJ ppdev);
|
||||||
|
|
||||||
#endif /* !__WIN32K_PDEVOBJ_H */
|
#endif /* !__WIN32K_PDEVOBJ_H */
|
||||||
|
|
Loading…
Reference in a new issue