summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Juergen Mauser <hjmauser@gmx.net>2012-05-09 10:01:25 +0200
committerTormod Volden <debian.tormod@gmail.com>2012-05-27 20:50:30 +0200
commit7fa190715c63ad1e8a703348165959bc9ceb07cb (patch)
tree69af1f5e3da380aac75d9f65f97f5bc56ab767b8
parent553385faa386404d11f1a12e4e73ca967f4c6371 (diff)
savage_video.c: Check current output configuration before doing expansionoutput-tormod
When playing video, the driver should check the output config which could have been modified due to Fn+Output key or s3switch. If TV or CRT is on, the LCD expansion must be avoided, otherwise, video image on TV is cropped due to false expansion. Use new SavageUpdateDevices() function. Tormod comment: We should also mask with ACTIVE_DEVICES here also for detecting CrtOnly, no? Tormod comment: Do we need to run these BIOS calls for every video frame? Would it be enough to update this on mode changes? 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.c12
-rw-r--r--src/savage_video.c3
3 files changed, 16 insertions, 0 deletions
diff --git a/src/savage_driver.h b/src/savage_driver.h
index 355a0f0..aa05b9d 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -620,6 +620,7 @@ void SavageSetVESAMode( SavagePtr psav, int n, int Refresh );
void SavageSetPanelEnabled( SavagePtr psav, Bool active );
void SavageFreeBIOSModeTable( SavagePtr psav, SavageModeTablePtr* ppTable );
int SavageGetTV( SavagePtr psav );
+void SavageUpdateDevices(ScrnInfoPtr pScrn);
int SavageCorrectDuoViewFlag(int iDevInfo, Bool bEnableActivate, Bool bEnableDeactivate);
SavageModeTablePtr SavageGetBIOSModeTable( SavagePtr psav, int iDepth );
ModeStatus SavageMatchBiosMode(ScrnInfoPtr pScrn,int width,int height,int refresh,
diff --git a/src/savage_vbe.c b/src/savage_vbe.c
index 5576496..1528896 100644
--- a/src/savage_vbe.c
+++ b/src/savage_vbe.c
@@ -307,6 +307,18 @@ int SavageGetTV( SavagePtr psav )
return ((psav->pVbe->pInt10->cx) & 0xc); /* TV mode bits are bits 2 and 3 */
}
+/* function for online update of current devices and TV format */
+void SavageUpdateDevices(ScrnInfoPtr pScrn)
+{
+ SavagePtr psav;
+
+ psav = SAVPTR(pScrn);
+ psav->iDevInfo = SavageGetDevice(psav);
+ psav->PAL = ((SavageGetTV(psav) & BIOS_TV_PAL) != 0);
+ psav->TvOn = ((psav->iDevInfo & TV_ACTIVE) != 0);
+ psav->CrtOnly = ((psav->iDevInfo & (unsigned char) ~CRT_ACTIVE) == 0);
+}
+
/* Function to correct the DuoView flag in the case of a single display */
int SavageCorrectDuoViewFlag(int iDevInfo, Bool bEnableActivate,
diff --git a/src/savage_video.c b/src/savage_video.c
index 2124032..d7546d2 100644
--- a/src/savage_video.c
+++ b/src/savage_video.c
@@ -1662,6 +1662,9 @@ SavageDisplayVideoNew(
/* Calculate horizontal and vertical scale factors. */
+ /* update device list to get the correct prerequisites for the following calculations */
+ SavageUpdateDevices(pScrn);
+
if ( S3_SAVAGE_MOBILE_SERIES(psav->Chipset) &&
(psav->DisplayType == MT_LCD) &&
!psav->CrtOnly &&