summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Juergen Mauser <hjmauser@gmx.net>2012-05-09 11:11:09 +0200
committerTormod Volden <debian.tormod@gmail.com>2012-05-27 20:10:00 +0200
commit81e73bf0e3649e0f352f201c9c4d86b26582e0f3 (patch)
tree072d99913a3fb3fb70b88075bb61df824b35d128
parentf7949c6f6484d1d4c4552ee4e762d6c2cb5469df (diff)
Add SavageGetTV() function to detect active TV format
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_driver.h1
-rw-r--r--src/savage_vbe.c13
2 files changed, 14 insertions, 0 deletions
diff --git a/src/savage_driver.h b/src/savage_driver.h
index 338cfac..9849fdf 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -619,6 +619,7 @@ void SavageSetTextMode( SavagePtr psav );
void SavageSetVESAMode( SavagePtr psav, int n, int Refresh );
void SavageSetPanelEnabled( SavagePtr psav, Bool active );
void SavageFreeBIOSModeTable( SavagePtr psav, SavageModeTablePtr* ppTable );
+int SavageGetTV( SavagePtr psav );
SavageModeTablePtr SavageGetBIOSModeTable( SavagePtr psav, int iDepth );
ModeStatus SavageMatchBiosMode(ScrnInfoPtr pScrn,int width,int height,int refresh,
unsigned int *vesaMode,unsigned int *newRefresh);
diff --git a/src/savage_vbe.c b/src/savage_vbe.c
index d22b560..17a534e 100644
--- a/src/savage_vbe.c
+++ b/src/savage_vbe.c
@@ -222,6 +222,19 @@ static int SavageGetDevice( SavagePtr psav )
return ((psav->pVbe->pInt10->cx) & 0xf);
}
+/* Function to get TV format. */
+
+int SavageGetTV( SavagePtr psav )
+{
+ SavageClearVM86Regs( psav->pVbe->pInt10 );
+ psav->pVbe->pInt10->ax = 0x4f14; /* S3 extensions */
+ psav->pVbe->pInt10->bx = 0x0107; /* get TV mode */
+
+ xf86ExecX86int10( psav->pVbe->pInt10 );
+
+ return ((psav->pVbe->pInt10->cx) & 0xc); /* TV mode bits are bits 2 and 3 */
+}
+
void
SavageFreeBIOSModeTable( SavagePtr psav, SavageModeTablePtr* ppTable )