From dfbc3120d191b3f3372a2270bb2388303bddc467 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 3 May 2007 18:08:27 -0700 Subject: [PATCH] Eliminiate XGI_New_SetSeqRegs. Universally use XGI_SetSeqRegs instead. --- src/init.c | 38 +------------------------------------- src/vb_setmode.c | 36 ++++++++++++++---------------------- src/vb_setmode.h | 3 +++ 3 files changed, 18 insertions(+), 59 deletions(-) diff --git a/src/init.c b/src/init.c index 7993c04..ff1685d 100644 --- a/src/init.c +++ b/src/init.c @@ -476,42 +476,6 @@ XGI_New_GetOffset(VB_DEVICE_INFO *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex, return(temp); } -/*********************************************/ -/* SEQ */ -/*********************************************/ - -static void -XGI_New_SetSeqRegs(VB_DEVICE_INFO *XGI_Pr, USHORT StandTableIndex, PXGI_HW_DEVICE_INFO HwInfo) -{ - UCHAR SRdata; - USHORT i; - - XGI_SetReg(XGI_Pr->P3c4,0x00,0x03); /* Set SR0 */ - - SRdata = XGI_Pr->StandTable[StandTableIndex].SR[0]; - - if(XGI_Pr->VBType & VB_XGI301BLV302BLV) { - if(XGI_Pr->VBInfo & SetCRT2ToLCDA) { - SRdata |= 0x01; - } - - if(XGI_Pr->VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) { - if(XGI_Pr->VBInfo & SetInSlaveMode) { - SRdata |= 0x01; /* 8 dot clock */ - } - } - } - - SRdata |= 0x20; /* screen off */ - - XGI_SetReg(XGI_Pr->P3c4,0x01,SRdata); - - for(i = 2; i <= 4; i++) { - SRdata = XGI_Pr->StandTable[StandTableIndex].SR[i-1]; - XGI_SetReg(XGI_Pr->P3c4,i,SRdata); - } -} - /*********************************************/ /* MISC */ /*********************************************/ @@ -972,7 +936,7 @@ XGI_New_SetCRT1Group(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo, } } */ - XGI_New_SetSeqRegs(XGI_Pr, StandTableIndex, HwInfo); + XGI_SetSeqRegs(StandTableIndex, XGI_Pr); XGI_New_SetMiscRegs(XGI_Pr, StandTableIndex, HwInfo); XGI_New_SetCRTCRegs(XGI_Pr, HwInfo, StandTableIndex); XGI_New_SetATTRegs(XGI_Pr, StandTableIndex, HwInfo); diff --git a/src/vb_setmode.c b/src/vb_setmode.c index 4c5c98c..db5c552 100644 --- a/src/vb_setmode.c +++ b/src/vb_setmode.c @@ -135,8 +135,6 @@ void XGI_SetCRT1Group(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo); static void XGI_WaitDisplay(PVB_DEVICE_INFO pVBInfo); void XGI_SenseCRT1(PVB_DEVICE_INFO pVBInfo); -void XGI_SetSeqRegs(USHORT ModeNo, USHORT StandTableIndex, USHORT ModeIdIndex, - PVB_DEVICE_INFO pVBInfo); void XGI_SetMiscRegs(USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); void XGI_SetCRTCRegs(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT StandTableIndex, PVB_DEVICE_INFO pVBInfo); @@ -581,7 +579,7 @@ XGI_SetCRT1Group(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, #endif /* XGINew_CRT1Mode = ModeNo ; // SaveModeID */ - XGI_SetSeqRegs(ModeNo, StandTableIndex, ModeIdIndex, pVBInfo); + XGI_SetSeqRegs(StandTableIndex, pVBInfo); XGI_SetMiscRegs(StandTableIndex, pVBInfo); XGI_SetCRTCRegs(HwDeviceExtension, StandTableIndex, pVBInfo); XGI_SetATTRegs(ModeNo, StandTableIndex, ModeIdIndex, pVBInfo); @@ -653,38 +651,32 @@ XGI_SetCRT1Group(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, /* Description : */ /* --------------------------------------------------------------------- */ void -XGI_SetSeqRegs(USHORT ModeNo, USHORT StandTableIndex, USHORT ModeIdIndex, - PVB_DEVICE_INFO pVBInfo) +XGI_SetSeqRegs(USHORT StandTableIndex, const VB_DEVICE_INFO *pVBInfo) { - UCHAR tempah, SRdata; - - USHORT i, modeflag; - - if (ModeNo <= 0x13) - modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; - else - modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; + unsigned SRdata; + unsigned i; XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x00, 0x03); /* Set SR0 */ - tempah = pVBInfo->StandTable[StandTableIndex].SR[0]; + SRdata = pVBInfo->StandTable[StandTableIndex].SR[0]; - i = SetCRT2ToLCDA; if (pVBInfo->VBInfo & SetCRT2ToLCDA) { - tempah |= 0x01; + SRdata |= 0x01; } else { if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) { if (pVBInfo->VBInfo & SetInSlaveMode) - tempah |= 0x01; + SRdata |= 0x01; } } - tempah |= 0x20; /* screen off */ - XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01, tempah); /* Set SR1 */ + SRdata |= 0x20; /* screen off */ + XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01, SRdata); /* Set SR1 */ - for (i = 02; i <= 04; i++) { - SRdata = pVBInfo->StandTable[StandTableIndex].SR[i - 1]; /* Get SR2,3,4 from file */ - XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, i, SRdata); /* Set SR2 3 4 */ + /* Get SR2, SR3, and SR4 from table and set in hardware. + */ + for (i = 2; i <= 4; i++) { + SRdata = pVBInfo->StandTable[StandTableIndex].SR[i - 1]; + XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, i, SRdata); } } diff --git a/src/vb_setmode.h b/src/vb_setmode.h index d8935d9..563373c 100644 --- a/src/vb_setmode.h +++ b/src/vb_setmode.h @@ -56,4 +56,7 @@ extern USHORT XGI_GetRatePtrCRT2( USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVI extern USHORT XGI_GetColorDepth(USHORT ModeNo, USHORT ModeIdIndex, const VB_DEVICE_INFO *pVBInfo); +extern void XGI_SetSeqRegs(USHORT StandTableIndex, + const VB_DEVICE_INFO *pVBInfo); + #endif