summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Juergen Mauser <hjmauser@gmx.net>2012-05-10 20:41:29 +0200
committerTormod Volden <debian.tormod@gmail.com>2012-05-27 20:50:30 +0200
commit2d411e193987eea54e76a07275f169ac9fd7aa68 (patch)
treec3ceb01ec6dd5eee7110d590d90c39375d5b1981
parent4fd71d6781f78967a6f72bcade28687b9ac3a500 (diff)
Only rewrite TV settings if needed
The BIOS tends to reset itself to defaults if something happens which it doesn't like. Currently it looks as if this reason mainly was the writing of TV mode when the TV output was already active, and with this patch I have not experienced it again. 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.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/savage_vbe.c b/src/savage_vbe.c
index b2a91fa..31da072 100644
--- a/src/savage_vbe.c
+++ b/src/savage_vbe.c
@@ -191,12 +191,16 @@ SavageSetVESAMode( SavagePtr psav, int n, int Refresh )
/* Set TV type if TV is on. */
if( psav->TvOn ) {
- SavageClearVM86Regs( psav->pVbe->pInt10 );
- psav->pVbe->pInt10->ax = 0x4f14; /* S3 extensions */
- psav->pVbe->pInt10->bx = 0x0007; /* TV extensions */
- psav->pVbe->pInt10->cx = psav->PAL ? 0x08 : 0x04;
- psav->pVbe->pInt10->dx = 0x0c;
- xf86ExecX86int10( psav->pVbe->pInt10 );
+ /* make this conditional to avoid unnecessary writes */
+ if (((psav->PAL) && (iTVInfo & BIOS_TV_NTSC))
+ || ((!(psav->PAL)) && (iTVInfo & BIOS_TV_PAL))) {
+ SavageClearVM86Regs( psav->pVbe->pInt10 );
+ psav->pVbe->pInt10->ax = 0x4f14; /* S3 extensions */
+ psav->pVbe->pInt10->bx = 0x0007; /* TV extensions */
+ psav->pVbe->pInt10->cx = psav->PAL ? 0x08 : 0x04;
+ psav->pVbe->pInt10->dx = 0x0c;
+ xf86ExecX86int10( psav->pVbe->pInt10 );
+ }
}
/* Manipulate output device set. */