Improving DPMS handling on VT swich and server termination/abort: previous

version called the driver directly and too late.
Unblank secondary screen explicitely. Don't rely on the value read during
    register save as the BIOS have blanked the secondary head.
Checking if server isn't switched away before calling sync. Sanity check
    for possible bugs in aother areas of the code.
Fixing default amount of of allocated video memory from AGP for i810: Use
    16MB if less than 192MB are installed else use 24MB (Matthias Hopf).
This commit is contained in:
Egbert Eich 2004-10-11 09:58:04 +00:00
parent ca1fda2a3f
commit 4ab7d316ec
2 changed files with 12 additions and 11 deletions

View File

@ -49,7 +49,7 @@
*/ */
/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */ /* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.2 2004/04/23 19:20:32 eich Exp $ */ /* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.3 2004/07/30 20:56:53 eich Exp $ */
/* [JCH-96/01/21] Extended std reverse map to four buttons. */ /* [JCH-96/01/21] Extended std reverse map to four buttons. */
@ -1333,6 +1333,10 @@ xf86VTSwitch()
#ifdef DEBUG #ifdef DEBUG
ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n", ErrorF("xf86VTSwitch: Leaving, xf86Exiting is %s\n",
BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE)); BOOLTOSTRING((dispatchException & DE_TERMINATE) ? TRUE : FALSE));
#endif
#ifdef DPMSExtension
if (DPMSPowerLevel != DPMSModeOn)
DPMSSet(DPMSModeOn);
#endif #endif
for (i = 0; i < xf86NumScreens; i++) { for (i = 0; i < xf86NumScreens; i++) {
if (!(dispatchException & DE_TERMINATE)) if (!(dispatchException & DE_TERMINATE))
@ -1353,13 +1357,9 @@ xf86VTSwitch()
} }
#endif /* !__UNIXOS2__ */ #endif /* !__UNIXOS2__ */
xf86EnterServerState(SETUP); xf86EnterServerState(SETUP);
for (i = 0; i < xf86NumScreens; i++) { for (i = 0; i < xf86NumScreens; i++)
#ifdef DPMSExtension
if (xf86Screens[i]->DPMSSet)
xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
#endif
xf86Screens[i]->LeaveVT(i, 0); xf86Screens[i]->LeaveVT(i, 0);
}
for (ih = InputHandlers; ih; ih = ih->next) for (ih = InputHandlers; ih; ih = ih->next)
xf86DisableInputHandler(ih); xf86DisableInputHandler(ih);
xf86AccessLeave(); /* We need this here, otherwise */ xf86AccessLeave(); /* We need this here, otherwise */

View File

@ -96,6 +96,7 @@ extern int xtest_command_key;
#ifdef DPMSExtension #ifdef DPMSExtension
#define DPMS_SERVER #define DPMS_SERVER
#include "extensions/dpms.h" #include "extensions/dpms.h"
#include "dpmsproc.h"
#endif #endif
@ -1253,6 +1254,10 @@ AbortDDX()
#ifdef HAS_USL_VTS #ifdef HAS_USL_VTS
/* Need the sleep when starting X from within another X session */ /* Need the sleep when starting X from within another X session */
sleep(1); sleep(1);
#endif
#ifdef DPMSExtension /* Turn screens back on */
if (DPMSPowerLevel != DPMSModeOn)
DPMSSet(DPMSModeOn);
#endif #endif
if (xf86Screens) { if (xf86Screens) {
if (xf86Screens[0]->vtSema) if (xf86Screens[0]->vtSema)
@ -1265,10 +1270,6 @@ AbortDDX()
* screen explicitely. * screen explicitely.
*/ */
xf86EnableAccess(xf86Screens[i]); xf86EnableAccess(xf86Screens[i]);
#ifdef DPMSExtension
if (xf86Screens[i]->DPMSSet)
xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
#endif
(xf86Screens[i]->LeaveVT)(i, 0); (xf86Screens[i]->LeaveVT)(i, 0);
} }
} }