mirror of
https://github.com/X11Libre/xf86-video-ast.git
synced 2026-03-24 01:24:41 +00:00
use same search mode criteria with ast drm driver
This commit is contained in:
@@ -495,6 +495,8 @@ static Bool bGetAST1000VGAModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIO
|
||||
ASTRecPtr pAST;
|
||||
ULONG ulModeID, ulColorIndex, ulRefreshRate, ulRefreshRateIndex = 0;
|
||||
ULONG ulHBorder, ulVBorder;
|
||||
Bool check_sync;
|
||||
PVBIOS_ENHTABLE_STRUCT loop, best = NULL;
|
||||
|
||||
pAST = ASTPTR(pScrn);
|
||||
|
||||
@@ -560,27 +562,34 @@ static Bool bGetAST1000VGAModeInfo(ScrnInfoPtr pScrn, DisplayModePtr mode, PVBIO
|
||||
}
|
||||
|
||||
/* Get Proper Mode Index */
|
||||
if (pVGAModeInfo->pEnhTableEntry->Flags & WideScreenMode)
|
||||
{
|
||||
/* parsing for wide screen reduced blank mode */
|
||||
if ((mode->Flags & V_NVSYNC) && (mode->Flags & V_PHSYNC)) /* CVT RB */
|
||||
pVGAModeInfo->pEnhTableEntry++;
|
||||
}
|
||||
else
|
||||
{
|
||||
ulRefreshRate = (mode->Clock * 1000) / (mode->HTotal * mode->VTotal);
|
||||
|
||||
while (pVGAModeInfo->pEnhTableEntry->ulRefreshRate < ulRefreshRate)
|
||||
{
|
||||
pVGAModeInfo->pEnhTableEntry++;
|
||||
if ((pVGAModeInfo->pEnhTableEntry->ulRefreshRate > ulRefreshRate) ||
|
||||
(pVGAModeInfo->pEnhTableEntry->ulRefreshRate == 0xFF))
|
||||
{
|
||||
pVGAModeInfo->pEnhTableEntry--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ulRefreshRate = (mode->Clock * 1000) / (mode->HTotal * mode->VTotal) + 1;
|
||||
loop = pVGAModeInfo->pEnhTableEntry;
|
||||
check_sync = loop->Flags & WideScreenMode;
|
||||
do {
|
||||
while (loop->ulRefreshRate != 0xff) {
|
||||
if ((check_sync) &&
|
||||
(((mode->Flags & V_NVSYNC) &&
|
||||
(loop->Flags & PVSync)) ||
|
||||
((mode->Flags & V_PVSYNC) &&
|
||||
(loop->Flags & NVSync)) ||
|
||||
((mode->Flags & V_NHSYNC) &&
|
||||
(loop->Flags & PHSync)) ||
|
||||
((mode->Flags & V_PHSYNC) &&
|
||||
(loop->Flags & NHSync)))) {
|
||||
loop++;
|
||||
continue;
|
||||
}
|
||||
if (loop->ulRefreshRate <= ulRefreshRate
|
||||
&& (!best || loop->ulRefreshRate > best->ulRefreshRate))
|
||||
best = loop;
|
||||
loop++;
|
||||
}
|
||||
if (best || !check_sync)
|
||||
break;
|
||||
check_sync = 0;
|
||||
} while (1);
|
||||
if (best)
|
||||
pVGAModeInfo->pEnhTableEntry = best;
|
||||
|
||||
/* Update mode CRTC info */
|
||||
ulHBorder = (pVGAModeInfo->pEnhTableEntry->Flags & HBorder) ? 8:0;
|
||||
|
||||
@@ -66,14 +66,18 @@
|
||||
#define HalfDCLK 0x00000002
|
||||
#define DoubleScanMode 0x00000004
|
||||
#define LineCompareOff 0x00000008
|
||||
#define SyncPP 0x00000000
|
||||
#define SyncPN 0x00000040
|
||||
#define SyncNP 0x00000080
|
||||
#define SyncNN 0x000000C0
|
||||
#define HBorder 0x00000020
|
||||
#define VBorder 0x00000010
|
||||
#define WideScreenMode 0x00000100
|
||||
#define NewModeInfo 0x00000200
|
||||
#define WideScreenMode 0x00000100
|
||||
#define NewModeInfo 0x00000200
|
||||
#define NHSync 0x00000400
|
||||
#define PHSync 0x00000800
|
||||
#define NVSync 0x00001000
|
||||
#define PVSync 0x00002000
|
||||
#define SyncPP (PVSync | PHSync)
|
||||
#define SyncPN (PVSync | NHSync)
|
||||
#define SyncNP (NVSync | PHSync)
|
||||
#define SyncNN (NVSync | NHSync)
|
||||
|
||||
/* DAC Definition */
|
||||
#define DAC_NUM_TEXT 64
|
||||
|
||||
Reference in New Issue
Block a user