mirror of
https://github.com/reactos/reactos.git
synced 2025-06-02 07:56:16 +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;
|
||||
}
|
||||
|
||||
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
|
||||
NTAPI
|
||||
PDEVOBJ_vRefreshModeList(
|
||||
|
@ -509,9 +548,9 @@ PDEVOBJ_bSwitchMode(
|
|||
// pdm = LDEVOBJ_bProbeAndCaptureDevmode(ppdev, pdm);
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
@ -560,10 +599,7 @@ PDEVOBJ_bSwitchMode(
|
|||
|
||||
leave2:
|
||||
/* Set the new video mode, or restore the original one in case of failure */
|
||||
if (!ppdev->pfn.AssertMode(ppdev->dhpdev, TRUE))
|
||||
{
|
||||
DPRINT1("DrvAssertMode(TRUE) failed\n");
|
||||
}
|
||||
PDEVOBJ_vEnableDisplay(ppdev);
|
||||
|
||||
leave:
|
||||
/* Unlock everything else */
|
||||
|
|
|
@ -219,4 +219,12 @@ PDEVOBJ_bDynamicModeChange(
|
|||
_Inout_ PPDEVOBJ ppdev,
|
||||
_Inout_ PPDEVOBJ ppdev2);
|
||||
|
||||
VOID
|
||||
PDEVOBJ_vEnableDisplay(
|
||||
_Inout_ PPDEVOBJ ppdev);
|
||||
|
||||
BOOL
|
||||
PDEVOBJ_bDisableDisplay(
|
||||
_Inout_ PPDEVOBJ ppdev);
|
||||
|
||||
#endif /* !__WIN32K_PDEVOBJ_H */
|
||||
|
|
Loading…
Reference in a new issue