diff options
author | Felix Kuehling <fxkuehl@gmx.de> | 2004-10-20 21:30:56 +0000 |
---|---|---|
committer | Felix Kuehling <fxkuehl@gmx.de> | 2004-10-20 21:30:56 +0000 |
commit | 951ee8825f2efb34dc4350c26dacd458067b5954 (patch) | |
tree | 9eba2cf259aa51630016195617da04c59fe2cbc7 /src/savage_driver.c | |
parent | aed0d07e7ddf045a51f8b1462ad6a5f61dc9e675 (diff) |
Take doublescan and interlace flags into account when choosing a BIOS mode.
Otherwise it choses modes with double refresh rates for double scan
modes or half refresh rates for interlaced modes.
Diffstat (limited to 'src/savage_driver.c')
-rw-r--r-- | src/savage_driver.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c index 012c0ee..d794812 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -3156,6 +3156,19 @@ static int SavageInternalScreenInit(int scrnIndex, ScreenPtr pScreen) } +static int SavageGetRefresh(DisplayModePtr mode) +{ + int refresh = (mode->Clock * 1000) / (mode->HTotal * mode->VTotal); + if (mode->Flags & V_INTERLACE) + refresh *= 2.0; + if (mode->Flags & V_DBLSCAN) + refresh /= 2.0; + if (mode->VScan > 1) + refresh /= mode->VScan; + return refresh; +} + + static ModeStatus SavageValidMode(int index, DisplayModePtr pMode, Bool verbose, int flags) { @@ -3184,7 +3197,7 @@ static ModeStatus SavageValidMode(int index, DisplayModePtr pMode, return MODE_PANEL; if (psav->UseBIOS) { - refresh = (pMode->Clock * 1000) / (pMode->HTotal * pMode->VTotal); + refresh = SavageGetRefresh(pMode); return (SavageMatchBiosMode(pScrn,pMode->HDisplay, pMode->VDisplay, refresh,NULL,NULL)); @@ -3233,7 +3246,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) #endif if (psav->IsSecondary) { - refresh = (mode->Clock * 1000) / (mode->HTotal * mode->VTotal); + refresh = SavageGetRefresh(mode); SavageMatchBiosMode(pScrn,mode->HDisplay,mode->VDisplay,refresh, &newmode,&newrefresh); @@ -3317,7 +3330,7 @@ static Bool SavageModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) int refresh; unsigned int newmode=0, newrefresh=0; - refresh = (mode->Clock * 1000) / (mode->HTotal * mode->VTotal); + refresh = SavageGetRefresh(mode); SavageMatchBiosMode(pScrn,mode->HDisplay,mode->VDisplay,refresh, &newmode,&newrefresh); |