diff options
author | Hans-Juergen Mauser <hjmauser@gmx.net> | 2012-05-27 20:03:13 +0200 |
---|---|---|
committer | Tormod Volden <debian.tormod@gmail.com> | 2012-05-27 20:39:43 +0200 |
commit | 9d80cfc650e39c57581fb77df1991796bd545295 (patch) | |
tree | 5dcb49ccd068c42ff5ed140011efef03411419f4 | |
parent | 06878b40025cfabdcf7138cf6bae90ffe0c83f0c (diff) |
Save output device settings when changing to text mode
When switching to text mode, the driver updates its config and
restores the initial setting as intended. The old behavior would reset
the active output device register at every mode change, so that for
instance the (usually sane) text mode configuration from boot would be
lost.
Also check if active outputs really needs changing by comparing the
active device bits only.
Signed-off-by: Hans-Juergen Mauser <hjmauser@gmx.net>
[Tormod: patch split out from a big diff]
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r-- | src/savage_vbe.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/savage_vbe.c b/src/savage_vbe.c index 7171582..c7c62ba 100644 --- a/src/savage_vbe.c +++ b/src/savage_vbe.c @@ -39,8 +39,21 @@ SavageClearVM86Regs( xf86Int10InfoPtr pInt ) void SavageSetTextMode( SavagePtr psav ) { - /* Restore display device if changed. */ - if( psav->iDevInfo != psav->iDevInfoPrim ) { + int iDevInfo; + + /* The BIOS settings currently in effect (which are retrieved by SavageGetDevice) are the reference for comparison */ + iDevInfo = SavageGetDevice(psav); + + /* Save the BIOS settings (which are in effect) as current if they are different from the last state saved as "current" */ + if (iDevInfo != psav->iDevInfo) { + psav->iDevInfo = iDevInfo; + } + + /* TODO: should the original settings also be corrected for the DuoView flag? */ + + /* Restore display device to original (primary) state if changed since last mode switch AWAY from text. */ + /* avoid unnecessary changes - mask for ACTIVE_DEVICES only */ + if( (iDevInfo & ACTIVE_DEVICES) != (psav->iDevInfoPrim & ACTIVE_DEVICES) ) { SavageClearVM86Regs( psav->pVbe->pInt10 ); psav->pVbe->pInt10->ax = 0x4f14; psav->pVbe->pInt10->bx = 0x0003; |