Lines Matching defs:pVBInfo

58 BOOLEAN CheckDualChip(PVB_DEVICE_INFO pVBInfo);
59 static BOOLEAN XGI_IsLCDDualLink(PVB_DEVICE_INFO pVBInfo);
62 PVB_DEVICE_INFO pVBInfo);
63 BOOLEAN XGI_BacklightByDrv(PVB_DEVICE_INFO pVBInfo);
65 BOOLEAN XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo);
66 BOOLEAN XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo);
67 BOOLEAN XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo);
70 PVB_DEVICE_INFO pVBInfo);
72 PVB_DEVICE_INFO pVBInfo);
73 BOOLEAN XGI_BridgeIsOn(PVB_DEVICE_INFO pVBInfo);
77 PVB_DEVICE_INFO pVBInfo);
79 PVB_DEVICE_INFO pVBInfo);
81 PVB_DEVICE_INFO pVBInfo);
82 USHORT XGI_GetVGAHT2(PVB_DEVICE_INFO pVBInfo);
85 PVB_DEVICE_INFO pVBInfo);
86 void XGI_VBLongWait(PVB_DEVICE_INFO pVBInfo);
87 void XGI_SaveCRT2Info(USHORT ModeNo, PVB_DEVICE_INFO pVBInfo);
89 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
91 PVB_DEVICE_INFO pVBInfo);
94 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
97 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
100 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
103 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
107 PVB_DEVICE_INFO pVBInfo);
109 PVB_DEVICE_INFO pVBInfo);
113 PVB_DEVICE_INFO pVBInfo);
115 PVB_DEVICE_INFO pVBInfo);
117 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
119 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
120 void XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo);
122 PVB_DEVICE_INFO pVBInfo);
124 PVB_DEVICE_INFO pVBInfo);
125 void XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo);
126 void XGI_SetPanelPower(USHORT tempah, USHORT tempbl, PVB_DEVICE_INFO pVBInfo);
127 void XGI_EnablePWD(PVB_DEVICE_INFO pVBInfo);
128 void XGI_DisablePWD(PVB_DEVICE_INFO pVBInfo);
129 void XGI_AutoThreshold(PVB_DEVICE_INFO pVBInfo);
130 void XGI_SetTap4Regs(PVB_DEVICE_INFO pVBInfo);
131 void SetDualChipRegs(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo);
132 void XGI_DisplayOn(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo);
133 void XGI_DisplayOff(PXGI_HW_DEVICE_INFO HwDeviceExtension,PVB_DEVICE_INFO pVBInfo);
135 USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo);
137 void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
138 void XGI_SetXG21LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo);
139 void XGI_SetXG27CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
140 void XGI_SetXG27LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo);
141 void XGI_UpdateXG21CRTC(USHORT ModeNo, PVB_DEVICE_INFO pVBInfo, USHORT RefreshRateTableIndex);
143 static void XGI_WaitDisplay(PVB_DEVICE_INFO pVBInfo);
144 void XGI_SenseCRT1(PVB_DEVICE_INFO pVBInfo);
147 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo,
149 void XGI_SetCRT1Timing_H(PVB_DEVICE_INFO pVBInfo,
152 PVB_DEVICE_INFO pVBInfo);
155 PVB_DEVICE_INFO pVBInfo);
158 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
160 PVB_DEVICE_INFO pVBInfo);
163 PVB_DEVICE_INFO pVBInfo);
165 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
167 void XGI_LoadDAC(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo);
170 PVB_DEVICE_INFO pVBInfo);
172 PVB_DEVICE_INFO pVBInfo);
174 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
178 PVB_DEVICE_INFO pVBInfo);
180 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
182 PVB_DEVICE_INFO pVBInfo);
183 void XGI_GetVBType(PVB_DEVICE_INFO pVBInfo);
186 PVB_DEVICE_INFO pVBInfo);
188 PVB_DEVICE_INFO pVBInfo);
190 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
191 void InitTo330Pointer(UCHAR, PVB_DEVICE_INFO pVBInfo);
193 PVB_DEVICE_INFO pVBInfo);
195 PVB_DEVICE_INFO pVBInfo);
197 PVB_DEVICE_INFO pVBInfo);
199 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo);
201 PVB_DEVICE_INFO pVBInfo);
202 void XGI_SetDelayComp(PVB_DEVICE_INFO pVBInfo);
203 void XGI_SetLCDCap(PVB_DEVICE_INFO pVBInfo);
204 void XGI_SetLCDCap_A(USHORT tempcx, PVB_DEVICE_INFO pVBInfo);
205 void XGI_SetLCDCap_B(USHORT tempcx, PVB_DEVICE_INFO pVBInfo);
206 void SetSpectrum(PVB_DEVICE_INFO pVBInfo);
208 PVB_DEVICE_INFO pVBInfo);
210 PVB_DEVICE_INFO pVBInfo);
211 void XGI_SetPhaseIncr(PVB_DEVICE_INFO pVBInfo);
213 PVB_DEVICE_INFO pVBInfo);
215 PVB_DEVICE_INFO pVBInfo);
216 USHORT XGI_GetTVPtrIndex(PVB_DEVICE_INFO pVBInfo);
218 PVB_DEVICE_INFO pVBInfo);
221 PVB_DEVICE_INFO pVBInfo);
222 void XGI_UnLockCRT2(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo);
223 void XGI_LockCRT2(PXGI_HW_DEVICE_INFO, PVB_DEVICE_INFO pVBInfo);
224 void XGINew_EnableCRT2(PVB_DEVICE_INFO pVBInfo);
225 void XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo);
229 PVB_DEVICE_INFO pVBInfo);
230 static void XGI_GetLCDVCLKPtr(UCHAR *di, PVB_DEVICE_INFO pVBInfo);
232 USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo);
234 PVB_DEVICE_INFO pVBInfo);
235 USHORT XGI_GetLCDCapPtr(PVB_DEVICE_INFO pVBInfo);
236 USHORT XGI_GetLCDCapPtr1(PVB_DEVICE_INFO pVBInfo);
237 static const XGI301C_Tap4TimingStruct *XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo);
240 void XGI_SetXG21FPBits(PVB_DEVICE_INFO pVBInfo);
241 void XGI_SetXG27FPBits(PVB_DEVICE_INFO pVBInfo);
242 UCHAR XGI_XG21GetPSCValue(PVB_DEVICE_INFO pVBInfo);
243 UCHAR XGI_XG27GetPSCValue(PVB_DEVICE_INFO pVBInfo);
244 void XGI_XG21BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo);
245 void XGI_XG27BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo);
246 void XGI_XG21SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo);
247 BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo );
248 void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo );
249 void XGI_SetXG27LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo );
250 UCHAR XGI_SetDefaultVCLK( PVB_DEVICE_INFO pVBInfo );
306 InitTo330Pointer(UCHAR ChipType, PVB_DEVICE_INFO pVBInfo)
308 pVBInfo->SModeIDTable = XGI330_SModeIDTable;
309 pVBInfo->StandTable = XGI330_StandTable;
310 pVBInfo->EModeIDTable = XGI330_EModeIDTable;
311 pVBInfo->RefIndex = XGI330_RefIndex;
312 pVBInfo->XGINEWUB_CRT1Table = XGI_CRT1Table;
320 (void) memcpy(pVBInfo->MCLKData, XGI340New_MCLKData, sizeof(XGI340New_MCLKData));
321 (void) memcpy(pVBInfo->ECLKData, XGI340_ECLKData, sizeof(XGI340_ECLKData));
324 (void) memcpy(pVBInfo->MCLKData, XGI330New_MCLKData, sizeof(XGI330New_MCLKData));
325 (void) memcpy(pVBInfo->ECLKData, XGI330_ECLKData, sizeof(XGI330_ECLKData));
328 pVBInfo->VCLKData = (const XGI_VCLKDataStruct *)XGI_VCLKData;
329 pVBInfo->VBVCLKData = (const XGI_VBVCLKDataStruct *)XGI_VBVCLKData;
330 pVBInfo->ScreenOffset = XGI330_ScreenOffset;
331 pVBInfo->StResInfo = XGI330_StResInfo;
332 pVBInfo->ModeResInfo = XGI330_ModeResInfo;
334 pVBInfo->OutputSelect = XGI330_OutputSelect;
335 pVBInfo->SoftSetting = XGI330_SoftSetting;
336 pVBInfo->SR07 = XGI330_SR07;
337 pVBInfo->LCDResInfo = 0;
338 pVBInfo->LCDTypeInfo = 0;
339 pVBInfo->LCDInfo = 0;
340 pVBInfo->VBInfo = 0;
341 pVBInfo->TVInfo = 0;
344 (void) memcpy(pVBInfo->SR15, XGI340_SR13, sizeof(XGI340_SR13));
345 (void) memcpy(pVBInfo->CR40, XGI340_CR41, sizeof(XGI340_CR41));
346 (void) memcpy(pVBInfo->SR25, XGI330_SR25, sizeof(XGI330_SR25));
347 pVBInfo->SR31 = XGI330_SR31;
348 pVBInfo->SR32 = XGI330_SR32;
349 (void) memcpy(pVBInfo->CR6B, XGI340_CR6B, sizeof(XGI340_CR6B));
351 (void) memcpy(pVBInfo->XG45CR6E, XGI45_CR6E, sizeof(XGI45_CR6E));
352 (void) memcpy(pVBInfo->XG45CR6F, XGI45_CR6F, sizeof(XGI45_CR6F));
355 (void) memcpy(pVBInfo->CR6E, XGI340_CR6E, sizeof(XGI340_CR6E));
356 (void) memcpy(pVBInfo->CR6F, XGI340_CR6F, sizeof(XGI340_CR6F));
358 (void) memcpy(pVBInfo->CR89, XGI340_CR89, sizeof(XGI340_CR89));
359 (void) memcpy(pVBInfo->AGPReg, XGI340_AGPReg, sizeof(XGI340_AGPReg));
360 (void) memcpy(pVBInfo->SR16, XGI340_SR16, sizeof(XGI340_SR16));
361 pVBInfo->CRCF = XG40_CRCF;
362 pVBInfo->DRAMTypeDefinition = XG40_DRAMTypeDefinition;
365 (void) memcpy(pVBInfo->CR49, XGI330_CR49, sizeof(XGI330_CR49));
366 pVBInfo->SR1F = XGI330_SR1F;
367 pVBInfo->SR21 = XGI330_SR21;
368 pVBInfo->SR22 = XGI330_SR22;
369 pVBInfo->SR23 = XGI330_SR23;
370 pVBInfo->SR24 = XGI330_SR24;
371 pVBInfo->SR33 = XGI330_SR33;
375 pVBInfo->CRT2Data_1_2 = XGI330_CRT2Data_1_2;
376 pVBInfo->CRT2Data_4_D = XGI330_CRT2Data_4_D;
377 pVBInfo->CRT2Data_4_E = XGI330_CRT2Data_4_E;
378 pVBInfo->CRT2Data_4_10 = XGI330_CRT2Data_4_10;
379 pVBInfo->pRGBSenseData = &XGI330_RGBSenseData;
380 pVBInfo->pVideoSenseData = &XGI330_VideoSenseData;
381 pVBInfo->pYCSenseData = &XGI330_YCSenseData;
382 pVBInfo->pRGBSenseData2 = &XGI330_RGBSenseData2;
383 pVBInfo->pVideoSenseData2 = &XGI330_VideoSenseData2;
384 pVBInfo->pYCSenseData2 = &XGI330_YCSenseData2;
386 pVBInfo->NTSCTiming = XGI330_NTSCTiming;
387 pVBInfo->PALTiming = XGI330_PALTiming;
388 pVBInfo->HiTVExtTiming = XGI330_HiTVExtTiming;
389 pVBInfo->HiTVSt1Timing = XGI330_HiTVSt1Timing;
390 pVBInfo->HiTVSt2Timing = XGI330_HiTVSt2Timing;
391 pVBInfo->HiTVTextTiming = XGI330_HiTVTextTiming;
392 pVBInfo->YPbPr750pTiming = XGI330_YPbPr750pTiming;
393 pVBInfo->YPbPr525pTiming = XGI330_YPbPr525pTiming;
394 pVBInfo->YPbPr525iTiming = XGI330_YPbPr525iTiming;
395 pVBInfo->HiTVGroup3Data = XGI330_HiTVGroup3Data;
396 pVBInfo->HiTVGroup3Simu = XGI330_HiTVGroup3Simu;
397 pVBInfo->HiTVGroup3Text = XGI330_HiTVGroup3Text;
398 pVBInfo->Ren525pGroup3 = XGI330_Ren525pGroup3;
399 pVBInfo->Ren750pGroup3 = XGI330_Ren750pGroup3;
402 (void) memcpy(& pVBInfo->TimingH, XGI_TimingH, sizeof(XGI_TimingH));
403 (void) memcpy(& pVBInfo->TimingV, XGI_TimingV, sizeof(XGI_TimingV));
406 pVBInfo->UpdateCRT1 = (XGI_XG21CRT1Struct *) XGI_UpdateCRT1Table ;
408 pVBInfo->CHTVVCLKUNTSC = XGI330_CHTVVCLKUNTSC;
409 pVBInfo->CHTVVCLKONTSC = XGI330_CHTVVCLKONTSC;
410 pVBInfo->CHTVVCLKUPAL = XGI330_CHTVVCLKUPAL;
411 pVBInfo->CHTVVCLKOPAL = XGI330_CHTVVCLKOPAL;
414 if ((pVBInfo->VBType & VB_XGI301LV) || (pVBInfo->VBType & VB_XGI302LV))
415 pVBInfo->LCDCapList = XGI_LCDDLCapList;
417 pVBInfo->LCDCapList = XGI_LCDCapList;
421 pVBInfo->XG21_LVDSCapList = XGI21_LCDCapList ;
423 pVBInfo->XGI_TVDelayList = XGI301TVDelayList;
424 pVBInfo->XGI_TVDelayList2 = XGI301TVDelayList2;
427 pVBInfo->I2CDefinition = XG40_I2CDefinition;
431 pVBInfo->CR97 = XG20_CR97;
437 /* pVBInfo->MCLKData = (XGI_MCLKDataStruct *) XGI27New_MCLKData ; */
438 (void) memcpy(pVBInfo->MCLKData, XGI27New_MCLKData, sizeof(XGI27New_MCLKData));
440 /* pVBInfo->CR40 = XGI27_cr41 ; */
441 (void) memcpy(pVBInfo->CR40, XGI27_cr41, sizeof(XGI27_cr41));
443 pVBInfo->CR97 = XG27_CR97 ;
444 pVBInfo->pSR36 = &XG27_SR36 ;
445 pVBInfo->pCR8F = &XG27_CR8F ;
446 pVBInfo->pCRD0 = XG27_CRD0 ;
447 pVBInfo->pCRDE = XG27_CRDE ;
448 pVBInfo->pSR40 = &XG27_SR40 ;
449 pVBInfo->pSR41 = &XG27_SR41 ;
454 pVBInfo->pDVOSetting = &XG21_DVOSetting ;
455 pVBInfo->pCR2E = &XG21_CR2E ;
456 pVBInfo->pCR2F = &XG21_CR2F ;
457 pVBInfo->pCR46 = &XG21_CR46 ;
458 pVBInfo->pCR47 = &XG21_CR47 ;
475 XGISetModeNew(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo,
483 /* PUCHAR pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress ; */
486 pVBInfo->IF_DEF_LVDS = 0 ;
487 pVBInfo->IF_DEF_VideoCapture = 1;
488 pVBInfo->IF_DEF_ScaleLCD = 1;
497 if ( ( XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x38 ) & 0xE0 ) == 0xC0 )
499 if ( XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x30 ) & 0x20 )
501 pVBInfo->IF_DEF_LVDS = 1 ;
508 XGI_GetVBType( pVBInfo ) ;
511 InitTo330Pointer( HwDeviceExtension->jChipType, pVBInfo ) ;
519 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x05, 0x86);
523 XGI_UnLockCRT2(HwDeviceExtension, pVBInfo);
539 if ( (!XGI_SearchModeID(pVBInfo->SModeIDTable, pVBInfo->EModeIDTable, 0x11, &ModeNo , &ModeIdIndex)) ||
565 /* Jong 11/28/2007; pVBInfo field is not matching VGAINFO argument */
566 /* XGI_SearchModeID( pVBInfo->SModeIDTable, pVBInfo->EModeIDTable, pVBInfo, &ModeNo , &ModeIdIndex ) ; */
567 XGI_SearchModeID( pVBInfo->SModeIDTable, pVBInfo->EModeIDTable, 0x11, &ModeNo , &ModeIdIndex ) ;
604 XGI_GetVBInfo(ModeNo, ModeIdIndex, HwDeviceExtension, pVBInfo);
606 XGI_GetTVInfo(ModeNo, ModeIdIndex, pVBInfo);
608 XGI_GetLCDInfo(ModeNo, ModeIdIndex, pVBInfo);
612 if ( pVBInfo->VBInfo & ( SetSimuScanMode | SwitchToCRT2 ) )
620 XGI_DisableBridge(HwDeviceExtension, pVBInfo);
623 if (pVBInfo->VBInfo & (SetSimuScanMode | SetCRT2ToLCDA)) {
624 XGI_SetCRT1Group(HwDeviceExtension, ModeNo, ModeIdIndex, pVBInfo);
626 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
628 pVBInfo);
632 if (!(pVBInfo->VBInfo & SwitchToCRT2)) {
634 pVBInfo);
635 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
637 pVBInfo);
643 if (pVBInfo->VBInfo & (SetSimuScanMode | SwitchToCRT2)) {
647 XGI_SetCRT2Group301(ModeNo, HwDeviceExtension, pVBInfo); /*add for CRT2 */
651 XGI_SetCRT2Group301(ModeNo, HwDeviceExtension, pVBInfo); /*add for CRT2 */
659 XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0));
660 XGI_SetCRT2ModeRegs(ModeNo, HwDeviceExtension, pVBInfo);
661 XGI_OEM310Setting(ModeNo, ModeIdIndex, pVBInfo); /*0212 */
662 XGI_EnableBridge(HwDeviceExtension, pVBInfo);
664 XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0));
671 if ( pVBInfo->IF_DEF_LVDS == 1 )
673 if ( !XGI_XG21CheckLVDSMode(ModeNo , ModeIdIndex, pVBInfo) )
682 pVBInfo->ModeType =
683 pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag & ModeInfoFlag;
686 pVBInfo->ModeType =
687 pVBInfo->EModeIDTable[ModeIdIndex].
691 pVBInfo->SetFlag = 0;
692 if ( pVBInfo->IF_DEF_CH7007 != 1 )
694 pVBInfo->VBInfo = DisableCRT2Display;
699 XGI_DisplayOff(HwDeviceExtension,pVBInfo);
702 XGI_SetCRT1Group(HwDeviceExtension, ModeNo, ModeIdIndex, pVBInfo);
706 XGI_DisplayOn(HwDeviceExtension, pVBInfo);
714 modeflag = pVBInfo->SModeIDTable[ ModeIdIndex ].St_ModeFlag ;
718 modeflag = pVBInfo->EModeIDTable[ ModeIdIndex ].Ext_ModeFlag ;
720 pVBInfo->ModeType = modeflag&ModeInfoFlag ;
721 pVBInfo->SetFlag = 0x00 ;
722 pVBInfo->VBInfo = DisableCRT2Display ;
723 temp = XGINew_CheckMemorySize( HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ;
728 XGI_DisplayOff( HwDeviceExtension,pVBInfo) ;
729 XGI_SetCRT1Group( HwDeviceExtension , ModeNo , ModeIdIndex, pVBInfo ) ;
730 XGI_DisplayOn( HwDeviceExtension, pVBInfo) ;
733 XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0));
734 XGI_UpdateModeInfo(HwDeviceExtension, pVBInfo);
738 XGI_LockCRT2(HwDeviceExtension, pVBInfo);
746 void XGI_SetCRTVCLK(PVB_DEVICE_INFO pVBInfo, double dwPixelClock)
782 USHORT XGINew_P3cc = pVBInfo->P3cc;
827 if(pVBInfo->IF_DEF_LVDS == 1)
832 case 0x0 : XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x31, 0xCF, 0x10);
834 case 0x4 : XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x31, 0xCF, 0x20);
836 default : XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x31, 0xCF, 0x00);
841 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x2B , (unsigned char) sr2b) ;
842 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x2C , (unsigned char) sr2c) ;
846 void XGI_SetCRTVCLK(PVB_DEVICE_INFO pVBInfo, double dwPixelClock)
911 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2B , (unsigned char) sr2b) ;
912 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2C , (unsigned char) sr2c) ;
919 PVB_DEVICE_INFO pVBInfo
979 temp = XGI_GetReg( pVBInfo->P3c4 , 0x06 ) ;
993 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x05, 0x00, 0x86);
994 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x11, 0x7f, 0x00);
995 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x00, 0x00, (VGAHT & 0xff)); /* HT */
996 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x01, 0x00, (VGAHDE & 0xff)); /* HDEE */
997 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x02, 0x00, (HDE & 0xff)); /* HBS */
998 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x03, 0xe0, (HT & 0x1f)); /* HBE */
999 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x04, 0x00, (HRS & 0xff)); /* HRS */
1000 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x05, 0x60, (((HT & 0x20) << 2) | (HRE & 0x1f))); /* HRE */
1001 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x06, 0x00, (VGAVT & 0xff)); /* VT */
1002 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x07, 0x00, (((VRS & 0x0200) >> 2) | ((VDE & 0x0200) >> 3) | ((VGAVT & 0x0200) >> 4)| ((VGAVDE & 0x0100) >> 5) | ((VRS & 0x0100) >> 6) | ((VDE & 0x0100) >> 7) | ((VGAVT & 0x0100) >> 8)));
1003 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x09, 0xdf, ((VGAVDE & 0x0200) >> 4));
1004 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x10, 0x00, (VRS & 0xff)); /* VRS */
1005 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x11, 0xf0, (VRE & 0x0f)); /* VRE */
1006 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x12, 0x00, (VDE & 0xff)); /* VDEE */
1007 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x13, 0x00, (temp1 & 0xff));
1008 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x15, 0x00, (VGAVDE & 0xff)); /* VBS */
1009 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x16, 0x00, (VT & 0xff)); /* VBE */
1013 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x2e, 0x00, ((HRS-1) & 0xff)); /* HRS */
1014 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x2f, 0x00, (((HRE-1) & 0x3f)<<2) | (((HRS-1) & 0x0300) >> 8)); /* HRS */
1015 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x33, 0xFE, (((VRS) & 0x01))); /* VRS */
1016 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x34, 0x00, (((VRS) & 0x01FE)>>1)); /* VRS */
1017 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x3F, 0x00, (((VRS) & 0x0600)>>9) | (((VRE) & 0x003F)<<2 )); /* VRS */
1023 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x2e, 0x00, ((HRS-1) & 0xff)); /* HRS SR2E[7:0] */
1024 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x2f, 0x00, (((HRE-1) & 0x3f)<<2) | (((HRS-1) & 0x0300) >> 8)); /* HRE SR2F[7:2] HRS SR2F[1:0] */
1025 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x34, 0x00, ((VRS) & 0x0FF) ); /* VRS SR34[7:0] */
1026 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x35, 0xF8, (((VRS) & 0x0700)>>8)); /* VRS SR35[2:0] */
1027 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x3F, 0xFC, (((VRE) & 0x003F)<<2 )); /* VRE SR3F[7:2] */
1033 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0f, 0xf7, 0x08);
1037 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x07, 0xef, ((VGAVDE & 0x0100) >> 4));
1038 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x09, 0xbf, ((VGAVDE & 0x0200) >> 3));
1039 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x18, 0x00, (VGAVDE & 0x0ff));
1042 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x11, 0xff, 0x80);
1043 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0a, 0xc0, (((VRE & 0x10) << 1) | ((VT & 0x0100) >> 4) | ((VRS & 0x0400) >> 7) | ((VGAVDE & 0x0400) >> 8) | ((VDE & 0x0400) >> 9) | ((VGAVT & 0x0400) >> 10)));
1044 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0b, 0x00, (((VGAHT & 0xff00) >> 8) | ((VGAHDE & 0xff00) >> 6) | ((HDE & 0xff00) >> 4) | ((HRS & 0xff00) >> 2)));
1045 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0c, 0xf8, (((HRE & 0x20) >> 3) | ((HT & 0xc0) >> 6)));
1046 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0e, 0xf0, ((temp1 & 0xff00) >> 8));
1047 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x10, 0x00, temp);
1049 XGI_SetCRTVCLK (pVBInfo, pXGIHWDE->DCLK/1000.0);
1053 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x14, 0xE0, 0x0f);
1054 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3ce, 0x05, 0xBF, 0x0);
1055 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x06, 0xE3, 0x10);
1057 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x10, temp);
1061 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x14, 0xE0, 0x0f);
1062 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3ce, 0x05, 0xBF, 0x0);
1063 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x06, 0xE3, 0x08);
1065 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x10, temp);
1069 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x06, 0xE3, 0x00);
1071 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x10, temp);
1084 USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
1086 const USHORT StandTableIndex = XGI_GetModePtr(pVBInfo->SModeIDTable,
1087 pVBInfo->ModeType,
1093 USHORT XGINew_P3cc = pVBInfo->P3cc;
1095 USHORT XGINew_P3c2 = pVBInfo->P3c2;
1101 XGI_SetSeqRegs(StandTableIndex, pVBInfo);
1102 XGI_SetMiscRegs(StandTableIndex, pVBInfo);
1103 XGI_SetCRTCRegs(StandTableIndex, pVBInfo);
1104 XGI_SetATTRegs(ModeNo, StandTableIndex, ModeIdIndex, pVBInfo);
1105 XGI_SetGRCRegs(StandTableIndex, pVBInfo);
1106 XGI_ClearExt1Regs(ModeNo, pVBInfo);
1115 if ( pVBInfo->IF_DEF_LVDS == 0 )
1117 XGI_SetDefaultVCLK( pVBInfo ) ;
1122 pVBInfo->SetFlag &= temp;
1123 pVBInfo->SelectCRT2Rate = 0;
1127 if (pVBInfo->
1130 if (pVBInfo->
1132 pVBInfo->SetFlag |= ProgrammingCRT2;
1137 /* RefreshRateTableIndex = XGI_GetRatePtrCRT2( ModeNo, ModeIdIndex, pVBInfo); */
1138 RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo, ModeIdIndex, pVBInfo);
1143 XGI_SetSync(RefreshRateTableIndex, pVBInfo);
1144 XGI_SetCRT1CRTC(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo,
1147 RefreshRateTableIndex, pVBInfo);
1149 HwDeviceExtension, pVBInfo);
1151 RefreshRateTableIndex, pVBInfo);
1162 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2B, 0x4E);
1163 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2C, 0xE9);
1168 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2B, 0x1B);
1169 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2C, 0xE3);
1180 temp = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x38 ) ;
1185 /*XGINew_SetRegAND( pVBInfo->P3d4 , 0x4A , ~0x20 ) ;*/ /* Enable write GPIOF */
1186 /*XGINew_SetRegAND( pVBInfo->P3d4 , 0x48 , ~0x20 ) ;*/ /* P. DWN */
1189 XGI_SetXG27CRTC( ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo );
1191 XGI_SetXG21CRTC( ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo );
1195 XGI_UpdateXG21CRTC( ModeNo , pVBInfo , RefreshRateTableIndex) ;
1198 XGI_SetXG27LCD( pVBInfo , RefreshRateTableIndex , ModeNo );
1200 XGI_SetXG21LCD( pVBInfo , RefreshRateTableIndex , ModeNo );
1204 if ( pVBInfo->IF_DEF_LVDS == 1 )
1207 XGI_SetXG27LVDSPara(ModeNo,ModeIdIndex, pVBInfo );
1209 XGI_SetXG21LVDSPara(ModeNo,ModeIdIndex, pVBInfo );
1213 /*XGINew_SetRegOR( pVBInfo->P3d4 , 0x48 , 0x20 ) ;*/ /* P. ON */
1217 pVBInfo->SetFlag &= (~ProgrammingCRT2);
1218 XGI_SetCRT1FIFO(ModeNo, HwDeviceExtension, pVBInfo);
1220 RefreshRateTableIndex, pVBInfo);
1224 XGI_SetCRTTiming( HwDeviceExtension, pVBInfo );
1230 if (CheckDualChip(pVBInfo))
1231 SetDualChipRegs(HwDeviceExtension, pVBInfo);
1238 XGI_LoadDAC(ModeNo, ModeIdIndex, pVBInfo);
1250 XGI_SetSeqRegs(USHORT StandTableIndex, const VB_DEVICE_INFO *pVBInfo)
1255 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x00, 0x03); /* Set SR0 */
1256 SRdata = pVBInfo->StandTable[StandTableIndex].SR[0];
1258 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
1262 if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) {
1263 if (pVBInfo->VBInfo & SetInSlaveMode)
1269 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01, SRdata); /* Set SR1 */
1274 SRdata = pVBInfo->StandTable[StandTableIndex].SR[i - 1];
1275 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, i, SRdata);
1287 XGI_SetMiscRegs(USHORT StandTableIndex, const VB_DEVICE_INFO *pVBInfo)
1291 Miscdata = pVBInfo->StandTable[StandTableIndex].MISC; /* Get Misc from file */
1293 if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) )
1295 if ( pVBInfo->VBInfo & SetCRT2ToLCDA )
1302 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c2, Miscdata); /* Set Misc(3c2) */
1313 XGI_SetCRTCRegs(unsigned StandTableIndex, const VB_DEVICE_INFO *pVBInfo)
1318 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->P3d4, 0x11, 0x7f);
1323 pVBInfo->StandTable[StandTableIndex].CRTC[i];
1326 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, i, CRTCdata);
1339 const VB_DEVICE_INFO *pVBInfo)
1343 ? pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag
1344 : pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
1347 UCHAR ARdata = pVBInfo->StandTable[StandTableIndex].ATTR[i];
1354 if (pVBInfo->VBInfo & SetCRT2ToLCDA)
1357 if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD)) {
1358 if (pVBInfo->VBInfo & SetInSlaveMode)
1365 XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da); /* reset 3da */
1366 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c0, i); /* set index */
1367 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c0, ARdata); /* set data */
1370 XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da); /* reset 3da */
1371 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c0, 0x14); /* set index */
1372 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c0, 0x00); /* set data */
1374 XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da); /* Enable Attribute */
1375 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c0, 0x20);
1376 XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da);
1387 XGI_SetGRCRegs(unsigned StandTableIndex, const VB_DEVICE_INFO *pVBInfo)
1394 const unsigned GRdata = pVBInfo->StandTable[StandTableIndex].GRC[i];
1395 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3ce, i, GRdata);
1398 if (pVBInfo->ModeType > ModeVGA) {
1400 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->P3ce, 0x05, 0xBF);
1412 XGI_ClearExt1Regs(unsigned ModeNo, const VB_DEVICE_INFO *pVBInfo)
1418 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, i, 0x00);
1428 XGI_SetRegAND(pVBInfo->P3c4, 0x37, 0xFE);
1430 XGI_SetReg(pVBInfo->P3c4, 0x0e, 0x20);
1444 UCHAR XGI_SetDefaultVCLK( PVB_DEVICE_INFO pVBInfo )
1448 /* XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 , 0x20 ) ; */
1449 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 , 0x10 ) ;
1450 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2B , pVBInfo->VCLKData[ 0 ].SR2B ) ;
1451 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2C , pVBInfo->VCLKData[ 0 ].SR2C ) ;
1453 /* XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 , 0x10 ) ; */
1454 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 , 0x20 ) ;
1455 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2B , pVBInfo->VCLKData[ 1 ].SR2B ) ;
1456 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2C , pVBInfo->VCLKData[ 1 ].SR2C ) ;
1458 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 ) ;
1469 XGI_GetRatePtrCRT2(PXGI_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
1478 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
1481 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
1487 index = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x33);
1488 index = index >> pVBInfo->SelectCRT2Rate;
1491 if (pVBInfo->LCDInfo & (LCDNonExpanding | EnableScalingLCD))
1497 if (pVBInfo->SetFlag & ProgrammingCRT2) {
1498 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
1501 if( pVBInfo->IF_DEF_LVDS == 0 )
1504 if (pVBInfo->
1507 temp = LCDARefreshIndex[pVBInfo->LCDResInfo & 0x0F]; /* 301b */
1509 temp = LCDRefreshIndex[pVBInfo->LCDResInfo & 0x0F];
1522 RefreshRateTableIndex = pVBInfo->EModeIDTable[ModeIdIndex].REFindex;
1523 ModeNo = pVBInfo->RefIndex[RefreshRateTableIndex].ModeID;
1530 if ( pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag & XG2xNotSupport )
1536 if ( ( pVBInfo->RefIndex[ RefreshRateTableIndex ].XRes == 800 ) &&
1537 ( pVBInfo->RefIndex[ RefreshRateTableIndex ].YRes == 600 ) )
1541 if ( ( pVBInfo->RefIndex[ RefreshRateTableIndex ].XRes == 1024 ) &&
1542 ( pVBInfo->RefIndex[ RefreshRateTableIndex ].YRes == 768 ) )
1546 if ( ( pVBInfo->RefIndex[ RefreshRateTableIndex ].XRes == 1280 ) &&
1547 ( pVBInfo->RefIndex[ RefreshRateTableIndex ].YRes == 1024 ) )
1554 if ( ( pVBInfo->RefIndex[ RefreshRateTableIndex ].XRes == 1600 ) &&
1555 ( pVBInfo->RefIndex[ RefreshRateTableIndex ].YRes == 1200 ) )
1565 if (pVBInfo->RefIndex[RefreshRateTableIndex + i].ModeID != ModeNo)
1567 temp = pVBInfo->RefIndex[RefreshRateTableIndex + i].Ext_InfoFlag;
1569 if (temp < pVBInfo->ModeType)
1577 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) {
1578 if (pVBInfo->VBInfo & SetInSlaveMode) {
1580 pVBInfo->RefIndex[RefreshRateTableIndex + i - 1].Ext_InfoFlag;
1588 if ((pVBInfo->SetFlag & ProgrammingCRT2)) {
1591 pVBInfo);
1607 PVB_DEVICE_INFO pVBInfo)
1612 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */
1615 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
1618 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
1619 tempbx = pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].ModeID;
1623 if ( pVBInfo->IF_DEF_LVDS == 0 )
1625 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) {
1628 if (pVBInfo->VBType & VB_XGI301C)
1632 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { /* 301b */
1635 if (pVBInfo->LCDResInfo != Panel1280x1024) {
1636 if (pVBInfo->LCDResInfo != Panel1280x960) {
1637 if (pVBInfo->LCDInfo & LCDNonExpanding) {
1647 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) { /* for HiTV */
1648 if ((pVBInfo->VBType & VB_XGI301LV)
1649 && (pVBInfo->VBExtInfo == VB_YPbPr1080i)) {
1651 if (pVBInfo->VBInfo & SetInSlaveMode) {
1664 if (pVBInfo->VBInfo & SetInSlaveMode) {
1669 if (pVBInfo->SetFlag & TVSimuMode)
1679 if (pVBInfo->
1684 if (pVBInfo->
1690 if (!(pVBInfo->VBInfo & SetPALTV)) {
1692 if (pVBInfo->VBInfo & SetInSlaveMode) {
1693 if (!(pVBInfo->VBInfo & SetNotSimuMode)) {
1704 if ( pVBInfo->VBInfo & SetCRT2ToLCD )
1711 if ( pVBInfo->LCDResInfo < Panel1024x768 )
1722 for (; pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].ModeID == tempbx;
1725 pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
1735 pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].Ext_InfoFlag;
1736 if (pVBInfo->RefIndex[RefreshRateTableIndex + (*i)].ModeID != tempbx) {
1755 XGI_SetSync(unsigned RefreshRateTableIndex, const VB_DEVICE_INFO *pVBInfo)
1758 (pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag >> 8) & 0xC0;
1761 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c2, sync | 0x2F);
1773 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo,
1782 index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC; /* Get index */
1785 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11);
1787 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */
1790 pVBInfo->TimingH.data[i] =
1791 pVBInfo->XGINEWUB_CRT1Table[index].CR[i];
1794 pVBInfo->TimingV.data[i] =
1795 pVBInfo->XGINEWUB_CRT1Table[index].CR[i + 8];
1797 XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension);
1801 XGI_SetCRT1Timing_V(ModeIdIndex, ModeNo, pVBInfo);
1804 if (pVBInfo->ModeType > 0x03)
1805 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x14, 0x4F);
1816 XGI_SetCRT1Timing_H(PVB_DEVICE_INFO pVBInfo,
1822 /* XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x51 , 0 ) ; */
1823 /* XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x56 , 0 ) ; */
1824 /* XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4 ,0x11 , 0x7f , 0x00 ) ; */
1826 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11); /* unlock cr0-7 */
1828 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11, data);
1830 data = pVBInfo->TimingH.data[0];
1831 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0, data);
1834 data = pVBInfo->TimingH.data[i];
1835 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) (i + 1), data);
1839 data = pVBInfo->TimingH.data[i];
1840 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, (USHORT) (i + 6), data);
1843 j = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0e);
1845 data = pVBInfo->TimingH.data[7];
1848 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0e, data);
1852 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x04);
1854 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x04, data);
1855 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x05);
1861 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0c);
1863 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0c, data);
1868 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x05, data);
1869 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0e);
1875 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0e, ~0xE0, data);
1888 PVB_DEVICE_INFO pVBInfo)
1893 /* XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x51 , 0 ) ; */
1894 /* XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x56 , 0 ) ; */
1895 /* XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4 , 0x11 , 0x7f , 0x00 ) ; */
1898 data = pVBInfo->TimingV.data[i];
1899 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) (i + 6), data);
1903 data = pVBInfo->TimingV.data[i];
1904 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) (i + 0x0e), data);
1908 data = pVBInfo->TimingV.data[i];
1909 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) (i + 0x11), data);
1912 j = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0a);
1914 data = pVBInfo->TimingV.data[6];
1917 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0a, data);
1919 data = pVBInfo->TimingV.data[6];
1924 i = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
1926 i = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
1932 j = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x09);
1935 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x09, data);
1945 void XGI_SetXG21CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
1952 StandTableIndex = XGI_GetModePtr( pVBInfo->SModeIDTable,
1953 pVBInfo->ModeType,
1955 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 4 ] ; /* CR04 HRS */
1956 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2E , Tempax ) ; /* SR2E [7:0]->HRS */
1957 Tempbx = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 5 ] ; /* Tempbx: CR05 HRE */
1965 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , Tempdx ) ; /* SR2F [7:2]->HRE */
1966 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0xE3 , 00 ) ;
1968 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 16 ] ; /* Tempax: CR16 VRS */
1971 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x33 , Tempax ) ; /* SR33[0]->VRS */
1972 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 7 ] ; /* Tempax: CR7 VRS */
1977 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x34 , Tempdx ) ; /* SR34[7:0]: VRS[8:1] */
1985 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 17 ] ; /* CR16 VRE */
2000 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , Tempax ) ; /* SR3F D[7:2]->VRE D[1:0]->VRS */
2004 index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ;
2005 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 3 ] ; /* Tempax: CR4 HRS */
2007 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2E , Tempax ) ; /* SR2E[7:0]->HRS */
2009 Tempdx = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 5 ] ; /* SRB */
2015 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 4 ] ; /* CR5 HRE */
2018 Tempbx = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 6 ] ; /* SRC */
2035 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , Tempax ) ; /* SR2F D[7:2]->HRE, D[1:0]->HRS */
2036 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0xE3 , 00 ) ;
2038 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 10 ] ; /* CR10 VRS */
2041 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x33 , Tempax ) ; /* SR33[0]->VRS[0] */
2042 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 9 ] ; /* CR7[2][7] VRE */
2047 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x34 , Tempcx ) ; /* SR34[8:1]->VRS */
2055 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 14 ] ; /* Tempax: SRA */
2061 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 11 ] ; /* Tempax: CR11 VRE */
2063 Tempbx = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 14 ] ; /* Tempbx: SRA */
2082 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , Tempax ) ; /* SR3F D[7:2]->VRE D[1:0]->VRS */
2087 void XGI_SetXG27CRTC(USHORT ModeNo, USHORT ModeIdIndex, USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
2094 /* StandTableIndex = XGI_GetModePtr( ModeNo , ModeIdIndex, pVBInfo ) ; */
2095 StandTableIndex = XGI_GetModePtr( pVBInfo->SModeIDTable,
2096 pVBInfo->ModeType,
2099 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 4 ] ; /* CR04 HRS */
2100 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2E , Tempax ) ; /* SR2E [7:0]->HRS */
2101 Tempbx = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 5 ] ; /* Tempbx: CR05 HRE */
2109 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , Tempdx ) ; /* SR2F [7:2]->HRE */
2110 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0xE3 , 00 ) ;
2112 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 16 ] ; /* Tempax: CR10 VRS */
2113 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x34 , Tempax ) ; /* SR34[7:0]->VRS */
2115 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 7 ] ; /* Tempax[7][2]: CR7[7][2] VRS[9][8] */
2119 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x01, Tempax ) ; /* SR35 D[0]->VRS D[8] */
2124 Tempax = pVBInfo->StandTable[ StandTableIndex ].CRTC[ 17 ] ; /* CR11 VRE */
2134 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , ~0xFC, Tempax ) ; /* SR3F D[7:2]->VRE D[5:0] */
2135 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x06, Tempcx ) ; /* SR35 D[2:1]->VRS[10:9] */
2139 index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC ;
2140 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 3 ] ; /* Tempax: CR4 HRS */
2142 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2E , Tempax ) ; /* SR2E[7:0]->HRS */
2144 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 5 ] ; /* SR0B */
2148 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 4 ] ; /* CR5 HRE */
2152 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 6 ] ; /* SRC */
2160 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 3 ] ; /* Tempax: CR4 HRS */
2165 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 5 ] ; /* SR0B */
2169 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , Tempax ) ; /* SR2F [7:2][1:0]: HRE[5:0]HRS[9:8] */
2170 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0xE3 , 00 ) ;
2172 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 10 ] ; /* CR10 VRS */
2173 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x34 , Tempax ) ; /* SR34[7:0]->VRS[7:0] */
2176 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 9 ] ; /* CR7[7][2] VRS[9][8] */
2180 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x01 , Tempax ) ; /* SR35[0]: VRS[8] */
2183 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 14 ] ; /* Tempax: SR0A */
2188 Tempax = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 11 ] ; /* Tempax: CR11 VRE */
2190 Tempbx = pVBInfo->XGINEWUB_CRT1Table[ index ].CR[ 14 ] ; /* Tempbx: SR0A */
2202 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , ~0xFC , Tempax ) ; /* SR3F[7:2]:VRE[5:0] */
2204 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x07 , Tempax ) ; /* SR35[2:0]:VRS[10:8] */
2216 void XGI_SetXG21LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo)
2222 Data = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ;
2223 XGI_P3cc = pVBInfo->P3cc ;
2225 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2E , 0x00 ) ;
2226 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2F , 0x00 ) ;
2227 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x46 , 0x00 ) ;
2228 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x47 , 0x00 ) ;
2229 if ( ((*pVBInfo->pDVOSetting)&0xC0) == 0xC0 )
2231 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2E , *pVBInfo->pCR2E ) ;
2232 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2F , *pVBInfo->pCR2F ) ;
2233 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x46 , *pVBInfo->pCR46 ) ;
2234 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x47 , *pVBInfo->pCR47 ) ;
2237 Temp = XGI_GetReg( pVBInfo->P3d4 , 0x37 ) ;
2241 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x06 , 0x40 ) ; /* 18 bits FP */
2242 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x09 , 0x40 ) ;
2245 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x1E , 0x01 ) ; /* Negative blank polarity */
2247 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , ~0x20 ) ;
2248 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x80 ) ;
2256 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0x20 ) ; /* Hsync polarity */
2258 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , 0x80 ) ; /* Vsync polarity */
2264 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0x20 ) ; /* Hsync polarity */
2266 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , 0x80 ) ; /* Vsync polarity */
2271 void XGI_SetXG27LCD(PVB_DEVICE_INFO pVBInfo,USHORT RefreshRateTableIndex,USHORT ModeNo)
2279 Data = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_InfoFlag ;
2281 XGI_P3cc = pVBInfo->P3cc ;
2285 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2E , 0x00 ) ;
2286 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2F , 0x00 ) ;
2287 XGI_SetReg( pVBInfo->P3d4 , 0x46 , 0x00 ) ;
2288 XGI_SetReg( pVBInfo->P3d4 , 0x47 , 0x00 ) ;
2292 Temp = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x37 ) ;
2298 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x46 , 0x13 ) ;
2299 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x47 , 0x13 ) ;
2304 if ( ((*pVBInfo->pDVOSetting)&0xC0) == 0xC0 )
2306 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2E , *pVBInfo->pCR2E ) ;
2307 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2F , *pVBInfo->pCR2F ) ;
2308 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x46 , *pVBInfo->pCR46 ) ;
2309 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x47 , *pVBInfo->pCR47 ) ;
2314 XGI_SetXG27FPBits(pVBInfo);
2318 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x1E , 0x01 ) ; /* Negative blank polarity */
2320 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , ~0x20 ) ; /* Hsync polarity */
2321 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x80 ) ; /* Vsync polarity */
2333 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0x20 ) ; /* Hsync polarity */
2335 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , 0x80 ) ; /* Vsync polarity */
2343 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , 0x20 ) ; /* Hsync polarity */
2345 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , 0x80 ) ; /* Vsync polarity */
2358 void XGI_UpdateXG21CRTC( USHORT ModeNo , PVB_DEVICE_INFO pVBInfo , USHORT RefreshRateTableIndex )
2364 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 , 0x7F ) ; /* Unlock CR0~7 */
2372 if ( ModeNo == pVBInfo->UpdateCRT1[ i ].ModeID )
2378 if ( ModeNo == 0x2E && ( pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC == RES640x480x60 ) )
2380 else if ( ModeNo == 0x2E && ( pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRT1CRTC == RES640x480x72 ) )
2394 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x02 , pVBInfo->UpdateCRT1[ index ].CR02 ) ;
2395 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x03 , pVBInfo->UpdateCRT1[ index ].CR03 ) ;
2396 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x15 , pVBInfo->UpdateCRT1[ index ].CR15 ) ;
2397 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x16 , pVBInfo->UpdateCRT1[ index ].CR16 ) ;
2412 PVB_DEVICE_INFO pVBInfo)
2416 const USHORT resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
2420 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
2421 tempax = pVBInfo->StResInfo[resindex].HTotal;
2422 tempbx = pVBInfo->StResInfo[resindex].VTotal;
2425 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
2426 tempax = pVBInfo->ModeResInfo[resindex].HTotal;
2427 tempbx = pVBInfo->ModeResInfo[resindex].VTotal;
2437 temp = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
2455 temp = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11);
2456 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11);
2458 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */
2459 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x01, (USHORT) (tempcx & 0xff));
2460 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x0b, ~0x0c,
2462 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x12, (USHORT) (tempbx & 0xff));
2472 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x07, ~0x42, tempax);
2473 data = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x07);
2480 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x0a, ~0x02, tempax);
2481 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11, temp);
2492 XGI_GetResInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
2495 ? pVBInfo->SModeIDTable[ModeIdIndex].St_ResInfo
2496 : pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
2501 get_mode_xres_yres(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo,
2504 const USHORT resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
2510 xres = pVBInfo->StResInfo[resindex].HTotal;
2511 yres = pVBInfo->StResInfo[resindex].VTotal;
2515 pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
2517 xres = pVBInfo->ModeResInfo[resindex].HTotal;
2518 yres = pVBInfo->ModeResInfo[resindex].VTotal;
2542 PVB_DEVICE_INFO pVBInfo)
2547 temp = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeInfo;
2549 temp = pVBInfo->ScreenOffset[temp];
2551 temp2 = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
2557 temp2 = pVBInfo->ModeType - ModeEGA;
2592 i = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0E);
2595 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0E, i);
2599 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x13, temp);
2602 temp2 = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
2620 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x10, ah);
2633 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
2641 if ( pVBInfo->IF_DEF_LVDS == 1 )
2643 index = pVBInfo->RefIndex[ RefreshRateTableIndex ].Ext_CRTVCLK ;
2644 clka = pVBInfo->VCLKData[ index ].SR2B;
2645 clkb = pVBInfo->VCLKData[ index ].SR2C;
2647 else if ((pVBInfo->VBType & VB_XGI301BLV302BLV)
2648 && (pVBInfo->VBInfo & SetCRT2ToLCDA)) {
2650 pVBInfo);
2652 clka = pVBInfo->VBVCLKData[index].Part4_A;
2653 clkb = pVBInfo->VBVCLKData[index].Part4_B;
2656 index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
2658 clka = pVBInfo->VCLKData[index].SR2B;
2659 clkb = pVBInfo->VCLKData[index].SR2C;
2662 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->P3c4, 0x31, 0xCF);
2663 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2B, clka);
2664 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2C, clkb);
2665 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2D, 0x01);
2669 && (pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag & HalfDCLK)) {
2675 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2B);
2676 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2B, data);
2683 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2C);
2690 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2C, data);
2703 PVB_DEVICE_INFO pVBInfo)
2707 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D);
2709 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D, data); /* diable auto-threshold */
2712 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x08, 0x34);
2713 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x09);
2718 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x09, data); */
2720 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4 , 0x09 , data | 0x30) ;
2722 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D);
2724 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3D, data);
2729 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x08 , 0x0E ) ;
2730 data = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x09 ) ;
2732 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x09 , data | 0x20 ) ;
2736 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x08, 0xAE);
2737 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x09);
2739 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x09, data);
2746 XGI_SetXG21FPBits(pVBInfo); /* Fix SR9[7:6] can't read back */
2761 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
2766 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
2767 infoflag = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
2770 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */
2772 if (XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x31) & 0x01)
2773 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x1F, 0x3F, 0x00);
2783 if (pVBInfo->ModeType > 0x02) {
2785 data3 = pVBInfo->ModeType - ModeVGA;
2796 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x06, ~0x3F, data2);
2797 /* XGI_SetReg((XGIIOADDRESS)pVBInfo->P3c4,0x06,data2); */
2798 resindex = XGI_GetResInfo(ModeNo, ModeIdIndex, pVBInfo);
2800 xres = pVBInfo->StResInfo[resindex].HTotal;
2802 xres = pVBInfo->ModeResInfo[resindex].HTotal; /* xres->ax */
2813 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x19, 0xFF, data2);
2815 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x19, 0xFC, data2);
2818 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x01, 0xF7, 0x08);
2826 if (pVBInfo->ModeType == ModeEGA)
2830 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x0F, ~0x48, data2);
2832 if (pVBInfo->ModeType != ModeText) {
2834 if (pVBInfo->ModeType != ModeEGA) {
2838 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x21, 0x1F, data);
2841 pVBInfo);
2843 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x31);
2852 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x52 , data ) ;
2853 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x51 , 0x10 ) ;
2861 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x52, data);
2862 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x51, 0x02);
2869 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x52, data);
2883 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
2893 index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
2895 VCLK = pVBInfo->VCLKData[index].CLOCK;
2898 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x32);
2907 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x32, data);
2911 data = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x1F);
2915 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x1F, data);
2930 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x07, 0xFC, data2);
2935 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x40 , 0xFC , data2&0x03 ) ;
2948 XGI_LoadDAC(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
2954 data = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
2956 data = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
2977 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c6, 0xFF);
2978 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c8, 0x00);
2992 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c9, data2);
3002 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c9, data);
3018 XGI_WriteDAC((XGIIOADDRESS) pVBInfo->P3c9, 0, dl,
3029 XGI_WriteDAC((XGIIOADDRESS) pVBInfo->P3c9, 0, dl,
3093 PVB_DEVICE_INFO pVBInfo)
3098 /* pVBInfo->SelectCRT2Rate = 0 ; */
3100 pVBInfo->SetFlag |= ProgrammingCRT2;
3101 RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo, ModeIdIndex, pVBInfo);
3102 XGI_GetLVDSResInfo(ModeNo, ModeIdIndex, pVBInfo);
3103 XGI_GetLVDSData(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
3105 HwDeviceExtension, pVBInfo);
3106 XGI_SetLVDSRegs(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
3107 XGI_SetCRT2ECLK(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
3115 XGI_GetLVDSResInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
3121 get_mode_xres_yres(ModeNo, ModeIdIndex, pVBInfo, &xres, &yres);
3126 pVBInfo->VGAHDE = xres;
3127 pVBInfo->HDE = xres;
3128 pVBInfo->VGAVDE = yres;
3129 pVBInfo->VDE = yres;
3134 get_HDE_VDE(PVB_DEVICE_INFO pVBInfo, ULONG *HDE, ULONG *VDE)
3136 switch (pVBInfo->LCDResInfo) {
3170 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
3177 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
3182 pVBInfo);
3183 pVBInfo->VGAHT = LCDPtr->VGAHT;
3184 pVBInfo->VGAVT = LCDPtr->VGAVT;
3185 pVBInfo->HT = LCDPtr->LCDHT;
3186 pVBInfo->VT = LCDPtr->LCDVT;
3189 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
3190 if (!(pVBInfo->LCDInfo & (SetLCDtoNonExpanding | EnableScalingLCD))) {
3191 get_HDE_VDE(pVBInfo, & pVBInfo->HDE, & pVBInfo->VDE);
3207 PVB_DEVICE_INFO pVBInfo)
3216 index = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC;
3218 index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
3222 if ((pVBInfo->IF_DEF_ScaleLCD == 0)
3223 || ((pVBInfo->IF_DEF_ScaleLCD == 1)
3224 && (!(pVBInfo->LCDInfo & EnableScalingLCD)))) {
3227 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
3232 pVBInfo);
3235 pVBInfo->TimingH.data[i] = LCDPtr[0].Reg[i];
3238 XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension);
3242 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
3247 pVBInfo);
3249 pVBInfo->TimingV.data[i] = LCDPtr1[0].Reg[i];
3252 XGI_SetCRT1Timing_V(ModeIdIndex, ModeNo, pVBInfo);
3266 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
3274 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
3276 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
3278 if (!(pVBInfo->SetFlag & Win9xDOSMode)) {
3279 if (pVBInfo->IF_DEF_OEMUtil == 1) {
3285 pVBInfo);
3288 if ((pVBInfo->IF_DEF_OEMUtil == 0) || (LCDPtr == 0)) {
3290 if (pVBInfo->LCDInfo & EnableScalingLCD)
3295 pVBInfo);
3301 pVBInfo);
3304 XGI_GetLCDSync(&tempax, &tempbx, pVBInfo);
3309 if (pVBInfo->LCDInfo & SetLCDtoNonExpanding) {
3310 get_HDE_VDE(pVBInfo, & pVBInfo->HDE, & pVBInfo->VDE);
3312 pVBInfo->VGAHDE = pVBInfo->HDE;
3313 pVBInfo->VGAVDE = pVBInfo->VDE;
3316 tempax = pVBInfo->HT;
3318 tempbx = (pVBInfo->LCDInfo & EnableScalingLCD)
3321 tempcx = pVBInfo->HDE;
3328 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1A, tempbx & 0x07);
3333 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x16,
3335 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x17,
3338 tempax = pVBInfo->HT;
3340 if (pVBInfo->LCDInfo & EnableScalingLCD)
3347 if (pVBInfo->LCDInfo & EnableScalingLCD)
3364 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x15, tempax);
3365 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x14,
3368 tempax = pVBInfo->VT;
3369 if (pVBInfo->LCDInfo & EnableScalingLCD)
3373 tempcx = pVBInfo->VDE;
3380 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1b,
3382 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1c,
3388 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1d,
3391 tempax = pVBInfo->VT;
3392 if (pVBInfo->LCDInfo & EnableScalingLCD)
3400 if (pVBInfo->LCDInfo & EnableScalingLCD)
3407 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x18,
3409 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x19, ~0x0f,
3414 tempbx = pVBInfo->VGAVDE;
3415 if (tempbx != pVBInfo->VDE)
3418 if (pVBInfo->LCDInfo & EnableLVDSDDA)
3421 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x1a, 0x07,
3424 tempcx = pVBInfo->VGAVT;
3425 tempbx = pVBInfo->VDE;
3426 tempax = pVBInfo->VGAVDE;
3440 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x37,
3442 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x36,
3448 tempbx = pVBInfo->VGAVDE;
3449 if (tempbx == pVBInfo->VDE)
3452 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x35, tempax);
3454 if (pVBInfo->VBType & VB_XGI301C) {
3456 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x3c,
3458 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x3b,
3461 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x3a, ~0xc0,
3464 tempcx = pVBInfo->VGAVDE;
3465 if (tempcx == pVBInfo->VDE)
3466 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x30,
3469 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x30,
3473 tempcx = pVBInfo->VGAHDE;
3474 tempbx = pVBInfo->HDE;
3484 temp1 = pVBInfo->VGAHDE << 16;
3493 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1f, tempax);
3495 temp1 = pVBInfo->VGAVDE << 18;
3499 if (pVBInfo->LCDResInfo == Panel1024x768)
3504 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x20,
3506 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x21,
3514 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x22,
3516 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x23,
3530 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
3535 XGI_GetVCLKPtr(RefreshRateTableIndex, ModeNo, ModeIdIndex, pVBInfo);
3537 XGI_GetVCLKLen(vclkindex, di, pVBInfo);
3538 XGI_GetLCDVCLKPtr(di, pVBInfo);
3541 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x31, ~0x30,
3543 if ((!(pVBInfo->VBInfo & SetCRT2ToLCDA))
3544 && (!(pVBInfo->VBInfo & SetInSlaveMode))) {
3545 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2e, di[0]);
3546 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2f, di[1]);
3549 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2b, di[0]);
3550 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2c, di[1]);
3564 PVB_DEVICE_INFO pVBInfo)
3568 if (pVBInfo->
3573 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01);
3576 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x17);
3581 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x53);
3583 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x63);
3590 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x2e);
3594 tempax = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x13); /* Check ChannelA by Part1_13 [2003/10/03] */
3608 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x00);
3619 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
3624 if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
3626 XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x4d);
3637 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x3d);
3639 if ((pVBInfo->SetFlag & ReserveTVOption)) {
3646 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x3d, tempbl, temp);
3648 if (!(pVBInfo->SetFlag & ReserveTVOption))
3649 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x3e, tempch);
3664 XGI_GetVBType(PVB_DEVICE_INFO pVBInfo)
3669 if ( pVBInfo->IF_DEF_LVDS == 0 )
3672 flag = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x00);
3675 flag = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x01);
3684 tempah = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part4Port,
3693 flag = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x23);
3701 pVBInfo->VBType = tempbx;
3714 PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
3719 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
3722 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
3725 pVBInfo->SetFlag = 0;
3726 pVBInfo->ModeType = modeflag & ModeInfoFlag;
3729 if (pVBInfo->VBType & 0xFFFF) {
3730 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x30); /* Check Display Device */
3732 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x31);
3743 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x38);
3745 if (pVBInfo->IF_DEF_LCDA == 1) {
3746 /* if ( ( pVBInfo->VBType & VB_XGI302B ) || ( pVBInfo->VBType & VB_XGI301LV ) || ( pVBInfo->VBType & VB_XGI302LV ) || ( pVBInfo->VBType & VB_XGI301C ) ) */
3747 if (pVBInfo->
3759 if (pVBInfo->IF_DEF_YPbPr == 1) {
3760 if ((pVBInfo->VBType & VB_XGI301LV)
3761 || (pVBInfo->VBType & VB_XGI302LV)
3762 || (pVBInfo->VBType & VB_XGI301C)) {
3764 if (pVBInfo->IF_DEF_HiVision == 1) {
3765 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x35); /* shampoo add for new scratch */
3783 if ( pVBInfo->IF_DEF_LVDS == 0 )
3785 if (pVBInfo->IF_DEF_YPbPr == 1) {
3786 if (pVBInfo->IF_DEF_HiVision == 1)
3792 if (pVBInfo->IF_DEF_HiVision == 1)
3800 if ( pVBInfo->IF_DEF_CH7017 == 1 )
3802 else if ( pVBInfo->IF_DEF_CH7007 == 1 ) /* [Billy] 07/05/03 */
3816 if (pVBInfo->IF_DEF_LCDA == 1) { /* Select Display Device */
3817 if (!(pVBInfo->VBType & VB_NoLCD)) {
3834 if (pVBInfo->IF_DEF_CRT2Monitor == 1) {
3846 if (!(pVBInfo->VBType & VB_NoLCD)) {
3860 if (pVBInfo->IF_DEF_YPbPr == 1) {
3865 if (pVBInfo->IF_DEF_HiVision == 1) {
3879 if (pVBInfo->IF_DEF_LCDA == 1) {
3884 if (pVBInfo->IF_DEF_VideoCapture == 1) {
3891 pVBInfo->SetFlag |= EnableVCMode;
3901 pVBInfo->SetFlag |= ReserveTVOption;
3906 pVBInfo->VBInfo = tempbx;
3917 XGI_GetTVInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
3924 if (pVBInfo->VBInfo & SetCRT2ToTV) {
3926 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag */
3927 resinfo = pVBInfo->SModeIDTable[ModeIdIndex].St_ResInfo; /* si+St_ResInfo */
3930 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
3931 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO; /* si+Ext_ResInfo */
3934 if (pVBInfo->VBInfo & SetCRT2ToTV) {
3935 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x35);
3948 if ( pVBInfo->IF_DEF_LVDS == 0 )
3950 if (pVBInfo->VBInfo & SetCRT2ToSCART)
3954 if (pVBInfo->IF_DEF_YPbPr == 1) {
3955 if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
3956 index1 = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x35);
3969 if (pVBInfo->IF_DEF_HiVision == 1) {
3970 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
3976 if ( pVBInfo->IF_DEF_LVDS == 0 )
3978 if ((pVBInfo->VBInfo & SetInSlaveMode)
3979 && (!(pVBInfo->VBInfo & SetNotSimuMode)))
3987 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
3988 if (pVBInfo->VBInfo & SetInSlaveMode)
3995 (pVBInfo->
4004 pVBInfo->TVInfo = tempbx;
4015 XGI_GetLCDInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
4019 pVBInfo->LCDResInfo = 0;
4020 pVBInfo->LCDTypeInfo = 0;
4021 pVBInfo->LCDInfo = 0;
4024 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ModeFlag // */
4027 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
4028 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO; /* si+Ext_ResInfo// */
4031 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x36); /* Get LCD Res.Info */
4039 if (pVBInfo->VBInfo & DriverMode) {
4040 tempax = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x33);
4041 if (pVBInfo->VBInfo & SetCRT2ToLCDA)
4057 pVBInfo->LCDResInfo = tempbx;
4061 if (pVBInfo->IF_DEF_OEMUtil == 1) {
4062 pVBInfo->LCDTypeInfo = (temp & 0xf0) >> 4;
4065 if (!(pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) {
4071 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x37);
4075 if ((pVBInfo->IF_DEF_ScaleLCD == 1) && (temp & LCDNonExpanding))
4080 LCDIdIndex = XGI_GetLCDCapPtr1(pVBInfo);
4082 tempax = pVBInfo->LCDCapList[LCDIdIndex].LCD_Capability;
4085 if ( pVBInfo->IF_DEF_LVDS == 0 ) /* shampoo */
4087 if (((pVBInfo->VBType & VB_XGI302LV) || (pVBInfo->VBType & VB_XGI301C))
4094 if ( pVBInfo->IF_DEF_LVDS == 0 )
4096 if ((pVBInfo->LCDResInfo == Panel1400x1050)
4097 && (pVBInfo->VBInfo & SetCRT2ToLCD) && (ModeNo > 0x13)
4109 if (pVBInfo->IF_DEF_ExpLink == 1) {
4111 /* if ( !( pVBInfo->LCDInfo&LCDNonExpanding ) ) */
4117 if (pVBInfo->LCDResInfo == Panel1024x768) {
4127 if (pVBInfo->VBInfo & SetInSlaveMode) {
4128 if (pVBInfo->VBInfo & SetNotSimuMode) {
4136 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x39);
4141 pVBInfo->LCDInfo = tempbx;
4143 if (pVBInfo->IF_DEF_PWD == 1) {
4144 if (pVBInfo->LCDInfo & SetPWDEnable) {
4145 if ((pVBInfo->VBType & VB_XGI302LV)
4146 || (pVBInfo->VBType & VB_XGI301C)) {
4148 pVBInfo->LCDInfo &= ~SetPWDEnable;
4155 if ( pVBInfo->IF_DEF_LVDS == 0 )
4158 if (pVBInfo->VBInfo & SetInSlaveMode) {
4161 pVBInfo->VBInfo &=
4164 pVBInfo->VBInfo |= SetCRT2ToLCDA | SetCRT2ToDualEdge;
4189 USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
4194 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
4197 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
4206 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x14); /* Get DRAM Size */
4252 XGI_DisplayOn(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
4254 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x01, 0xDF, 0x00);
4259 if ( pVBInfo->IF_DEF_LVDS == 1 )
4261 if (!(XGI_XG21GetPSCValue( pVBInfo )&0x1))
4263 XGI_XG21BLSignalVDD( 0x01 , 0x01, pVBInfo ) ; /* LVDS VDD on */
4264 XGI_XG21SetPanelDelay( 2,pVBInfo ) ;
4266 if (!(XGI_XG21GetPSCValue( pVBInfo )&0x20))
4268 XGI_XG21BLSignalVDD( 0x20 , 0x20, pVBInfo ) ; /* LVDS signal on */
4270 XGI_XG21SetPanelDelay( 3,pVBInfo ) ;
4271 XGI_XG21BLSignalVDD( 0x02 , 0x02, pVBInfo ) ; /* LVDS backlight on */
4275 XGI_XG21BLSignalVDD( 0x20 , 0x20, pVBInfo ) ; /* DVO/DVI signal on */
4283 if ( pVBInfo->IF_DEF_LVDS == 1 )
4285 if (!(XGI_XG27GetPSCValue( pVBInfo )&0x1))
4287 XGI_XG27BLSignalVDD( 0x01 , 0x01, pVBInfo ) ; /* LVDS VDD on */
4288 XGI_XG21SetPanelDelay( 2,pVBInfo ) ;
4290 if (!(XGI_XG27GetPSCValue( pVBInfo )&0x20))
4292 XGI_XG27BLSignalVDD( 0x20 , 0x20, pVBInfo ) ; /* LVDS signal on */
4294 XGI_XG21SetPanelDelay( 3,pVBInfo ) ;
4295 XGI_XG27BLSignalVDD( 0x02 , 0x02, pVBInfo ) ; /* LVDS backlight on */
4299 XGI_XG27BLSignalVDD( 0x20 , 0x20, pVBInfo ) ; /* DVO/DVI signal on */
4313 XGI_DisplayOff(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
4320 if ( pVBInfo->IF_DEF_LVDS == 1 )
4322 XGI_XG21BLSignalVDD( 0x02 , 0x00, pVBInfo ) ; /* LVDS backlight off */
4323 XGI_XG21SetPanelDelay( 3,pVBInfo ) ;
4327 XGI_XG21BLSignalVDD( 0x20 , 0x00, pVBInfo ) ; /* DVO/DVI signal off */
4335 if ( pVBInfo->IF_DEF_LVDS == 0 )
4337 PDEBUG(ErrorF("pVBInfo->IF_DEF_LVDS == 0 ...\n"));
4338 XGI_XG27BLSignalVDD( 0x20 , 0x00, pVBInfo ) ; /* DVO/DVI signal off */
4341 else if ((XGI_XG27GetPSCValue( pVBInfo )&0x2)) /* Jong@09232009; bug fixing */
4343 PDEBUG(ErrorF("XGI_XG27GetPSCValue( pVBInfo )&0x2 is true...\n"));
4344 XGI_XG27BLSignalVDD( 0x02 , 0x00, pVBInfo ) ; /* LVDS backlight off */
4346 XGI_XG21SetPanelDelay( 3,pVBInfo ) ;
4351 PDEBUG(ErrorF("Before XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x01, 0xDF, 0x20) ...\n"));
4352 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x01, 0xDF, 0x20);
4361 XGI_WaitDisplay(PVB_DEVICE_INFO pVBInfo)
4363 while ((XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da) & 0x01))
4366 while (!(XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da) & 0x01))
4379 XGI_SenseCRT1(PVB_DEVICE_INFO pVBInfo)
4397 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x05, 0x86);
4400 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x57, 0x4A);
4401 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x53,
4402 (UCHAR) (XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x53) |
4405 SR31 = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x31);
4406 CR63 = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x63);
4407 SR01 = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01);
4409 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01, (UCHAR) (SR01 & 0xDF));
4410 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x63, (UCHAR) (CR63 & 0xBF));
4412 CR17 = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x17);
4413 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x17, (UCHAR) (CR17 | 0x80));
4415 SR1F = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x1F);
4416 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x1F, (UCHAR) (SR1F | 0x04));
4418 SR07 = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x07);
4419 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x07, (UCHAR) (SR07 & 0xFB));
4420 SR06 = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x06);
4421 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x06, (UCHAR) (SR06 & 0xC3));
4423 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x11, 0x00);
4426 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) i, CRTCData[i]);
4429 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) (i + 8),
4433 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, (USHORT) (i + 4),
4437 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, (USHORT) (i - 3),
4440 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x0E,
4443 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x31, 0x00);
4444 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2B, 0x1B);
4445 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x2C, 0xE1);
4447 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c8, 0x00);
4449 XGI_SetRegByte((XGIIOADDRESS) (USHORT) (pVBInfo->P3c8 + 1),
4451 XGI_SetRegByte((XGIIOADDRESS) (USHORT) (pVBInfo->P3c8 + 1),
4453 XGI_SetRegByte((XGIIOADDRESS) (USHORT) (pVBInfo->P3c8 + 1),
4457 XGI_VBLongWait(pVBInfo);
4458 XGI_VBLongWait(pVBInfo);
4459 XGI_VBLongWait(pVBInfo);
4461 XGINew_LCD_Wait_Time(0x01, pVBInfo);
4462 XGI_WaitDisplay(pVBInfo);
4464 temp = XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3c2);
4466 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x32, 0xDF, 0x20);
4469 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x32, 0xDF, 0x00);
4473 XGI_SetRegByte((XGIIOADDRESS) pVBInfo->P3c8, 0x00);
4476 XGI_SetRegByte((XGIIOADDRESS) (USHORT) (pVBInfo->P3c8 + 1), 0);
4477 XGI_SetRegByte((XGIIOADDRESS) (USHORT) (pVBInfo->P3c8 + 1), 0);
4478 XGI_SetRegByte((XGIIOADDRESS) (USHORT) (pVBInfo->P3c8 + 1), 0);
4481 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x01, SR01);
4482 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x63, CR63);
4483 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x31, SR31);
4486 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x53,
4487 (UCHAR) (XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x53) &
4499 CheckDualChip(PVB_DEVICE_INFO pVBInfo)
4503 (XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x3A) &
4517 PVB_DEVICE_INFO pVBInfo)
4525 USHORT XGINew_P3CC = pVBInfo->BaseAddr + MISC_OUTPUT_REG_READ_PORT;
4530 pVBInfo->BaseAddr = (USHORT) HwDeviceExtension->pjIOAddress;
4532 tempal = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, i);
4536 tempal = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3ce, i);
4543 tempal = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x06);
4547 tempal = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x21);
4567 PVB_DEVICE_INFO pVBInfo)
4572 tempbx = pVBInfo->VBInfo;
4573 pVBInfo->SetFlag |= ProgrammingCRT2;
4576 XGI_SearchModeID(pVBInfo->SModeIDTable, pVBInfo->EModeIDTable, 0x11,
4580 pVBInfo->SelectCRT2Rate = 4;
4581 RefreshRateTableIndex = XGI_GetRatePtrCRT2(HwDeviceExtension, ModeNo, ModeIdIndex, pVBInfo);
4582 XGI_SaveCRT2Info(ModeNo, pVBInfo);
4583 XGI_GetCRT2ResInfo(ModeNo, ModeIdIndex, pVBInfo);
4584 XGI_GetCRT2Data(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
4586 RefreshRateTableIndex, pVBInfo);
4588 RefreshRateTableIndex, pVBInfo);
4590 RefreshRateTableIndex, pVBInfo);
4592 HwDeviceExtension, pVBInfo);
4594 RefreshRateTableIndex, pVBInfo);
4595 XGI_SetTap4Regs(pVBInfo);
4596 XGI_SetGroup3(ModeNo, ModeIdIndex, pVBInfo);
4598 HwDeviceExtension, pVBInfo);
4599 XGI_SetCRT2VCLK(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
4600 XGI_SetGroup5(ModeNo, ModeIdIndex, pVBInfo);
4601 XGI_AutoThreshold(pVBInfo);
4613 XGI_AutoThreshold(PVB_DEVICE_INFO pVBInfo)
4615 if (!(pVBInfo->SetFlag & Win9xDOSMode))
4616 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x01, 0x40);
4627 XGI_SaveCRT2Info(USHORT ModeNo, PVB_DEVICE_INFO pVBInfo)
4631 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x34, ModeNo); /* reserve CR34 for CRT1 Mode No */
4632 temp1 = (pVBInfo->VBInfo & SetInSlaveMode) >> 8;
4634 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x31, temp2, temp1);
4645 XGI_GetCRT2ResInfo(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
4651 get_mode_xres_yres(ModeNo, ModeIdIndex, pVBInfo, &xres, &yres);
4653 if ((pVBInfo->VBInfo & SetCRT2ToLCD)
4654 && !(pVBInfo->LCDInfo & (EnableScalingLCD | LCDNonExpanding))) {
4655 switch (pVBInfo->LCDResInfo) {
4657 if (!(pVBInfo->LCDInfo & LCDVESATiming) && (yres == 1024)) {
4668 else if ((pVBInfo->LCDInfo & LCDVESATiming) && (yres == 360)) {
4675 if (!(pVBInfo->LCDInfo & (LCDVESATiming | LCDNonExpanding))) {
4694 pVBInfo->VGAHDE = xres;
4695 pVBInfo->HDE = xres;
4696 pVBInfo->VGAVDE = yres;
4697 pVBInfo->VDE = yres;
4708 XGI_IsLCDDualLink(PVB_DEVICE_INFO pVBInfo)
4710 return (((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) != 0)
4711 && ((pVBInfo->LCDInfo & SetLCDDualLink) != 0));
4723 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
4734 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
4735 resinfo = pVBInfo->SModeIDTable[ModeIdIndex].St_ResInfo;
4738 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */
4739 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
4742 pVBInfo->NewFlickerMode = 0;
4743 pVBInfo->RVBHRS = 50;
4745 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) {
4747 pVBInfo);
4753 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
4757 pVBInfo);
4762 pVBInfo->RVBHCMAX = LCDPtr->RVBHCMAX;
4763 pVBInfo->RVBHCFACT = LCDPtr->RVBHCFACT;
4764 pVBInfo->VGAHT = LCDPtr->VGAHT;
4765 pVBInfo->VGAVT = LCDPtr->VGAVT;
4766 pVBInfo->HT = LCDPtr->LCDHT;
4767 pVBInfo->VT = LCDPtr->LCDVT;
4769 if (pVBInfo->LCDResInfo == Panel1024x768) {
4773 if (!(pVBInfo->LCDInfo & LCDVESATiming)) {
4774 if (pVBInfo->VGAVDE == 357)
4776 else if (pVBInfo->VGAVDE == 420)
4778 else if (pVBInfo->VGAVDE == 525)
4780 else if (pVBInfo->VGAVDE == 600)
4782 /* else if(pVBInfo->VGAVDE==350) tempbx=560; */
4783 /* else if(pVBInfo->VGAVDE==400) tempbx=640; */
4790 else if (pVBInfo->LCDResInfo == Panel1024x768x75) {
4794 else if (pVBInfo->LCDResInfo == Panel1280x1024) {
4796 if (pVBInfo->VGAVDE == 360)
4798 else if (pVBInfo->VGAVDE == 375)
4800 else if (pVBInfo->VGAVDE == 405)
4805 else if (pVBInfo->LCDResInfo == Panel1280x1024x75) {
4809 else if (pVBInfo->LCDResInfo == Panel1280x960) {
4811 if (pVBInfo->VGAVDE == 350)
4813 else if (pVBInfo->VGAVDE == 400)
4815 else if (pVBInfo->VGAVDE == 1024)
4820 else if (pVBInfo->LCDResInfo == Panel1400x1050) {
4824 if (pVBInfo->VGAVDE == 1024) {
4829 else if (pVBInfo->LCDResInfo == Panel1600x1200) {
4832 if (!(pVBInfo->LCDInfo & LCDVESATiming)) {
4833 if (pVBInfo->VGAVDE == 350)
4835 else if (pVBInfo->VGAVDE == 400)
4840 if (pVBInfo->LCDInfo & (LCDNonExpanding | EnableScalingLCD)) {
4841 tempax = pVBInfo->VGAHDE;
4842 tempbx = pVBInfo->VGAVDE;
4845 pVBInfo->HDE = tempax;
4846 pVBInfo->VDE = tempbx;
4850 if (pVBInfo->VBInfo & (SetCRT2ToTV)) {
4854 RefreshRateTableIndex, pVBInfo);
4855 pVBInfo->RVBHCMAX = TVPtr->RVBHCMAX;
4856 pVBInfo->RVBHCFACT = TVPtr->RVBHCFACT;
4857 pVBInfo->VGAHT = TVPtr->VGAHT;
4858 pVBInfo->VGAVT = TVPtr->VGAVT;
4859 pVBInfo->HDE = TVPtr->TVHDE;
4860 pVBInfo->VDE = TVPtr->TVVDE;
4861 pVBInfo->RVBHRS = TVPtr->RVBHRS;
4862 pVBInfo->NewFlickerMode = TVPtr->FlickerMode;
4864 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
4866 pVBInfo->NewFlickerMode = 0x40;
4868 pVBInfo->NewFlickerMode = 0x40;
4870 pVBInfo->NewFlickerMode = 0x40;
4872 if (pVBInfo->VGAVDE == 350)
4873 pVBInfo->TVInfo |= TVSimuMode;
4878 if (pVBInfo->VBInfo & SetInSlaveMode) {
4879 if (pVBInfo->TVInfo & TVSimuMode) {
4890 else if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
4891 if (pVBInfo->TVInfo & SetYPbPrMode750p) {
4896 if (pVBInfo->TVInfo & SetYPbPrMode525p) {
4900 else if (pVBInfo->TVInfo & SetYPbPrMode525i) {
4903 if (pVBInfo->TVInfo & NTSC1024x768)
4910 if (!(pVBInfo->TVInfo & SetPALTV)) {
4913 if (pVBInfo->TVInfo & NTSC1024x768)
4918 pVBInfo->HT = tempax;
4919 pVBInfo->VT = tempbx;
4933 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
4937 XGI_GetVCLKPtr(RefreshRateTableIndex, ModeNo, ModeIdIndex, pVBInfo);
4939 XGI_GetVCLKLen(vclkindex, di, pVBInfo);
4940 XGI_GetLCDVCLKPtr(di, pVBInfo);
4942 if (pVBInfo->VBType & VB_XGI301) { /* shampoo 0129 *//* 301 */
4943 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0A, 0x10);
4944 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0B, di[1]);
4945 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0A, di[0]);
4948 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0A, di[0]);
4949 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0B, di[1]);
4952 if ((pVBInfo->LCDInfo & EnableReduceTiming)
4953 && (pVBInfo->LCDResInfo == Panel1600x1200)) {
4954 if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO == 0x0A) {
4955 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0A, 0x5A);
4956 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0B, 0x24);
4960 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x00, 0x12);
4962 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC)
4963 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x12, 0x28);
4965 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x12, 0x08);
4976 XGI_GetLCDVCLKPtr(UCHAR *di, PVB_DEVICE_INFO pVBInfo)
4978 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
4979 if ((pVBInfo->IF_DEF_ScaleLCD != 1)
4980 || !(pVBInfo->LCDInfo & EnableScalingLCD)) {
4981 const unsigned index = XGI_GetLCDCapPtr1(pVBInfo);
4983 if (pVBInfo->VBInfo & SetCRT2ToLCD) { /* LCDB */
4984 di[0] = pVBInfo->LCDCapList[index].LCUCHAR_VCLKData1;
4985 di[1] = pVBInfo->LCDCapList[index].LCUCHAR_VCLKData2;
4988 di[0] = pVBInfo->LCDCapList[index].LCDA_VCLKData1;
4989 di[1] = pVBInfo->LCDCapList[index].LCDA_VCLKData2;
5006 USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
5010 ? pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag
5011 : pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
5014 if ((pVBInfo->SetFlag & ProgrammingCRT2)
5015 && (!(pVBInfo->LCDInfo & EnableScalingLCD))) { /* {LCDA/LCDB} */
5016 const unsigned index = XGI_GetLCDCapPtr(pVBInfo);
5017 vclk = pVBInfo->LCDCapList[index].LCD_VCLK;
5019 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))
5023 if (pVBInfo->
5026 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5027 if (pVBInfo->TVInfo & TVSimuMode) {
5032 vclk = (pVBInfo->TVInfo & RPLLDIV2XO)
5038 else if (pVBInfo->TVInfo & SetYPbPrMode750p) {
5041 else if (pVBInfo->TVInfo & SetYPbPrMode525p) {
5047 if (!(pVBInfo->TVInfo & NTSC1024x768)) {
5048 vclk = (pVBInfo->TVInfo & RPLLDIV2XO)
5052 if (pVBInfo->VBInfo & SetCRT2ToTV)
5057 vclk = XGI_GetRegByte((XGIIOADDRESS) (pVBInfo->P3ca + 0x02));
5061 if ((pVBInfo->LCDInfo & EnableScalingLCD)
5063 && ((pVBInfo->IF_DEF_VideoCapture) == 1)) {
5070 return pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK;
5081 XGI_GetVCLKLen(unsigned vclkindex, UCHAR *di, PVB_DEVICE_INFO pVBInfo)
5083 if (pVBInfo->
5086 if ((!(pVBInfo->VBInfo & SetCRT2ToLCDA))
5087 && (pVBInfo->SetFlag & ProgrammingCRT2)) {
5109 PVB_DEVICE_INFO pVBInfo)
5114 if (pVBInfo->VBInfo & SetInSlaveMode) {
5120 HwDeviceExtension, pVBInfo);
5122 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, temp);
5124 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x09, temp);
5126 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x03, temp);
5138 PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
5145 modeinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeInfo;
5149 infoflag = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
5154 temp = pVBInfo->ScreenOffset[index];
5160 colordepth = XGI_GetColorDepth(ModeNo, ModeIdIndex, pVBInfo);
5193 XGI_SetCRT2FIFO(PVB_DEVICE_INFO pVBInfo)
5195 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x01, 0x3B); /* threshold high ,disable auto threshold */
5196 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x02, ~(0x3F), 0x04); /* threshold low default 04h */
5209 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
5217 CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
5219 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
5223 HwDeviceExtension, pVBInfo);
5224 XGI_SetCRT2FIFO(pVBInfo);
5228 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, tempcx, 0x0);
5231 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x02, 0x44); /* temp 0206 */
5244 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
5252 CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
5254 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
5258 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
5261 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
5266 temp = (pVBInfo->VGAHT / 2 - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */
5267 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, temp);
5268 temp = (((pVBInfo->VGAHT / 2 - 1) & 0xFF00) >> 8) << 4;
5269 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x09, ~0x0F0,
5271 temp = (pVBInfo->VGAHDE / 2 + 16) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */
5272 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0A, temp);
5273 tempcx = ((pVBInfo->VGAHT - pVBInfo->VGAHDE) / 2) >> 2;
5274 pushbx = pVBInfo->VGAHDE / 2 + 16;
5279 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) {
5280 tempbx = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[4];
5282 ((pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[14] & 0xC0) << 2);
5284 tempcx = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[5];
5286 temp = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[15];
5294 if (tempcx > (pVBInfo->VGAHT / 2))
5295 tempcx = pVBInfo->VGAHT / 2;
5299 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0B, temp);
5302 temp = (pVBInfo->VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */
5303 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, temp);
5304 temp = (((pVBInfo->VGAHT - 1) & 0xFF00) >> 8) << 4;
5305 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x09, ~0x0F0,
5307 temp = (pVBInfo->VGAHDE + 16) & 0x0FF; /* BTVGA2HDEE 0x0A,0x0C */
5308 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0A, temp);
5309 tempcx = (pVBInfo->VGAHT - pVBInfo->VGAHDE) >> 2; /* cx */
5310 pushbx = pVBInfo->VGAHDE + 16;
5315 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) {
5316 tempbx = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[3];
5318 ((pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[5] & 0xC0) << 2);
5320 tempcx = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[4];
5322 temp = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[6];
5329 if (tempcx > pVBInfo->VGAHT)
5330 tempcx = pVBInfo->VGAHT;
5333 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0B, temp);
5341 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0C, temp);
5343 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0D, temp);
5344 tempcx = (pVBInfo->VGAVT - 1);
5347 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0E, temp);
5348 tempbx = pVBInfo->VGAVDE - 1;
5350 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0F, temp);
5353 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x12, temp);
5355 tempax = pVBInfo->VGAVDE;
5356 tempbx = pVBInfo->VGAVDE;
5357 tempcx = pVBInfo->VGAVT;
5358 tempbx = (pVBInfo->VGAVT + pVBInfo->VGAVDE) >> 1; /* BTVGA2VRS 0x10,0x11 */
5359 tempcx = ((pVBInfo->VGAVT - pVBInfo->VGAVDE) >> 4) + tempbx + 1; /* BTVGA2VRE 0x11 */
5361 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) {
5362 tempbx = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[10];
5363 temp = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[9];
5371 temp = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[14];
5376 temp = pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[11];
5381 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x10, temp);
5384 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x11, temp);
5393 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2C, ~0x0C0, tempax);
5406 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
5412 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
5413 resinfo = pVBInfo->SModeIDTable[ModeIdIndex].St_ResInfo;
5416 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */
5417 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
5418 CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
5422 if (!(pVBInfo->VBInfo & SetInSlaveMode)) {
5427 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x03, temp);
5432 if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C))
5435 tempax = pVBInfo->VGAHDE; /* 0x04 Horizontal Display End */
5443 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x04, temp);
5447 if (pVBInfo->VBInfo & SetCRT2ToTV) {
5449 (pVBInfo->
5454 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5455 if (pVBInfo->VBType & VB_XGI301LV) {
5456 if (pVBInfo->VBExtInfo == VB_YPbPr1080i) {
5466 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x05, temp); /* 0x05 Horizontal Display Start */
5467 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x06, 0x03); /* 0x06 Horizontal Blank end */
5469 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { /* 030226 bainy */
5470 if (pVBInfo->VBInfo & SetCRT2ToTV)
5471 tempax = pVBInfo->VGAHT;
5473 tempax = XGI_GetVGAHT2(pVBInfo);
5476 if (tempax >= pVBInfo->VGAHT) {
5477 tempax = pVBInfo->VGAHT;
5486 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5490 if (pVBInfo->TVInfo & TVSimuMode) {
5503 if (pVBInfo->VBInfo & SetCRT2ToTV) {
5508 if (pVBInfo->VGAHDE >= 800) {
5517 if (pVBInfo->LCDResInfo != Panel1280x960) {
5518 if (pVBInfo->VGAHDE >= 800) {
5520 if (pVBInfo->ModeType == ModeEGA) {
5521 if (pVBInfo->VGAVDE == 1024) {
5523 if (pVBInfo->LCDResInfo != Panel1280x1024) {
5529 if (pVBInfo->VGAHDE >= 1280) {
5530 if (pVBInfo->LCDResInfo != Panel1280x960) {
5532 (pVBInfo->
5545 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, temp); /* 0x07 Horizontal Retrace Start */
5546 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0); /* 0x08 Horizontal Retrace End */
5548 if (pVBInfo->VBInfo & SetCRT2ToTV) {
5549 if (pVBInfo->TVInfo & TVSimuMode) {
5552 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x5b);
5553 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x03);
5557 if (pVBInfo->TVInfo & SetNTSCTV) {
5558 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x2A);
5559 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x61);
5562 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x2A);
5563 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x41);
5564 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0C, 0xF0);
5569 if (pVBInfo->TVInfo & SetNTSCTV) {
5570 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x54);
5571 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x00);
5574 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x55);
5575 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x00);
5576 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0C, 0xF0);
5582 if (pVBInfo->TVInfo & SetNTSCTV) {
5583 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x30);
5584 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x03);
5587 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x07, 0x2f);
5588 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x08, 0x02);
5594 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x18, 0x03); /* 0x18 SR0B */
5595 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x19, 0xF0, 0x00);
5596 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x09, 0xFF); /* 0x09 Set Max VT */
5598 tempbx = pVBInfo->VGAVT;
5601 tempbx = pVBInfo->VGAVDE; /* 0x0E Virtical Display End */
5616 if (pVBInfo->VBInfo & SetCRT2ToLCD) {
5617 if (pVBInfo->LCDResInfo == Panel1024x768) {
5618 if (!(pVBInfo->LCDInfo & LCDVESATiming)) {
5630 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x10, temp); /* 0x10 vertical Blank Start */
5634 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0E, temp);
5651 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0B, temp);
5657 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x11, 0x00); /* 0x11 Vertival Blank End */
5669 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5670 if (pVBInfo->VBType & VB_XGI301LV) {
5671 if (pVBInfo->TVInfo & SetYPbPrMode1080i)
5674 if (pVBInfo->TVInfo & TVSimuMode) {
5675 if (pVBInfo->TVInfo & SetPALTV) {
5676 if (pVBInfo->VBType & VB_XGI301LV) {
5678 (pVBInfo->
5693 if (pVBInfo->TVInfo & TVSimuMode) {
5694 if (pVBInfo->TVInfo & SetPALTV) {
5695 if (pVBInfo->VBType & VB_XGI301LV) {
5697 (pVBInfo->
5713 if ((pVBInfo->TVInfo & SetPALTV)) {
5722 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0C, temp);
5725 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x10, temp);
5732 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x0B, 0x0FF, 0x20);
5752 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0D, temp); /* 0x0D vertical Retrace End */
5759 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0A, temp); /* 0x0A CR07 */
5761 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x17, temp); /* 0x17 SR0A */
5767 if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C))
5770 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x16, temp); /* 0x16 SR01 */
5771 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x0F, 0); /* 0x0F CR14 */
5772 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x12, 0); /* 0x12 CR17 */
5774 if (pVBInfo->LCDInfo & LCDRGB18Bit)
5779 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1A, temp); /* 0x1A SR0E */
5793 PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
5819 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
5820 resinfo = pVBInfo->SModeIDTable[ModeIdIndex].St_ResInfo;
5821 crt2crtc = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC;
5824 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */
5825 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
5826 crt2crtc = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
5831 if (!(pVBInfo->VBInfo & SetCRT2ToAVIDEO))
5834 if (!(pVBInfo->VBInfo & SetCRT2ToSVIDEO))
5837 if (pVBInfo->VBInfo & SetCRT2ToSCART)
5840 if (!(pVBInfo->TVInfo & SetPALTV))
5843 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
5846 if (pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p))
5850 XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0));
5851 ErrorF(" pVBInfo->VBInfo =%x", pVBInfo->VBInfo);
5855 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0, tempax);
5856 TimingPoint = pVBInfo->NTSCTiming;
5858 if (pVBInfo->TVInfo & SetPALTV) {
5859 TimingPoint = pVBInfo->PALTiming;
5862 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5863 TimingPoint = pVBInfo->HiTVExtTiming;
5865 if (pVBInfo->VBInfo & SetInSlaveMode)
5866 TimingPoint = pVBInfo->HiTVSt2Timing;
5868 if (pVBInfo->SetFlag & TVSimuMode)
5869 TimingPoint = pVBInfo->HiTVSt1Timing;
5872 TimingPoint = pVBInfo->HiTVTextTiming;
5875 if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
5876 if (pVBInfo->TVInfo & SetYPbPrMode525i)
5877 TimingPoint = pVBInfo->YPbPr525iTiming;
5879 if (pVBInfo->TVInfo & SetYPbPrMode525p)
5880 TimingPoint = pVBInfo->YPbPr525pTiming;
5882 if (pVBInfo->TVInfo & SetYPbPrMode750p)
5883 TimingPoint = pVBInfo->YPbPr750pTiming;
5887 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, i, TimingPoint[j]);
5891 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, i, TimingPoint[j]); /* di->temp2[j] */
5894 if (pVBInfo->VBInfo & SetCRT2ToTV) {
5895 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x3A, 0x1F, 0x00);
5898 temp = pVBInfo->NewFlickerMode;
5900 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x0A, 0xFF, temp);
5902 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
5905 if (pVBInfo->TVInfo & SetPALTV)
5910 if (pVBInfo->VDE <= tempax) {
5911 tempax -= pVBInfo->VDE;
5918 if (pVBInfo->
5921 if (pVBInfo->
5924 tempcx = pVBInfo->VGAHDE;
5927 if (pVBInfo->TVInfo & SetPALTV)
5933 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x01, temp);
5938 if (pVBInfo->
5941 if ((pVBInfo->
5944 tempcx = pVBInfo->VGAHDE;
5947 if (pVBInfo->TVInfo & SetPALTV)
5952 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x02, temp);
5956 tempcx = pVBInfo->HT;
5958 if (XGI_IsLCDDualLink(pVBInfo))
5963 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x1B, temp);
5966 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x1D, ~0x0F, temp);
5968 tempcx = pVBInfo->HT >> 1;
5972 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5978 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x22, 0x0F, temp);
5984 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x24, temp);
5987 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x25, 0x0F, temp);
5991 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
5997 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x29, 0x0F, temp);
6002 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x27, temp);
6004 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x28, 0x0F, temp);
6007 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
6013 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x2A, 0x0F, temp);
6021 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x2D, 0x0F, temp);
6025 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) {
6026 tempax = XGI_GetVGAHT2(pVBInfo);
6030 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x2E, temp);
6032 tempbx = pVBInfo->VDE;
6034 if (pVBInfo->VGAVDE == 360)
6036 if (pVBInfo->VGAVDE == 375)
6038 if (pVBInfo->VGAVDE == 405)
6041 if (pVBInfo->VBInfo & SetCRT2ToTV) {
6042 if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) {
6043 if (!(pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p)))
6053 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
6054 if (pVBInfo->VBType & VB_XGI301LV) {
6055 if (pVBInfo->TVInfo & SetYPbPrMode1080i) {
6056 if (pVBInfo->VBInfo & SetInSlaveMode) {
6063 if (pVBInfo->VBInfo & SetInSlaveMode) {
6070 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x2F, temp);
6075 if (!(pVBInfo->VBInfo & SetCRT2ToHiVisionTV)) {
6076 if (pVBInfo->VBType & VB_XGI301LV) {
6077 if (pVBInfo->TVInfo & SetYPbPrMode1080i) {
6080 if (!(pVBInfo->VBInfo & SetCRT2ToSVIDEO))
6086 if (!(pVBInfo->VBInfo & SetCRT2ToSVIDEO))
6091 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x30, temp);
6093 if (pVBInfo->VBType & (VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) { /* TV gatingno */
6094 tempbx = pVBInfo->VDE;
6097 if (pVBInfo->VBInfo & SetCRT2ToTV) {
6098 if (!(pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p)))
6102 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
6110 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x10, temp);
6114 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x46, temp);
6116 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x47, temp);
6122 tempcx = pVBInfo->VGAHDE;
6123 if (tempcx >= pVBInfo->HDE) {
6131 if (pVBInfo->VBInfo & SetCRT2ToTV) { /*301b */
6132 if (pVBInfo->VGAHDE >= 1024) {
6134 if (pVBInfo->VGAHDE >= 1280) {
6147 tempeax = pVBInfo->VGAHDE;
6156 if (pVBInfo->
6163 tempecx = pVBInfo->HDE;
6173 if (pVBInfo->
6190 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x44, temp);
6192 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x45, ~0x03F, temp);
6198 if (!(pVBInfo->VBInfo & SetCRT2ToLCD))
6201 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x46, ~0x1F, temp);
6202 if (pVBInfo->TVInfo & SetPALTV) {
6212 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x4b, temp);
6214 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x4c, temp);
6220 if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
6223 if (pVBInfo->TVInfo & SetYPbPrMode525p)
6226 if (pVBInfo->TVInfo & SetYPbPrMode750p)
6230 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x4d, temp);
6231 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x43); /* 301b change */
6232 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x43, (USHORT) (temp - 3));
6234 if (!(pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p))) {
6235 if (pVBInfo->TVInfo & NTSC1024x768) {
6238 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, i,
6241 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x43, 0x72);
6246 if (pVBInfo->VBType & VB_XGI301C) {
6247 if (pVBInfo->TVInfo & SetPALMTV)
6248 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x4E, ~0x08, 0x08); /* PALM Mode */
6251 if (pVBInfo->TVInfo & SetPALMTV) {
6252 tempax = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x01);
6254 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part2Port, 0x01, tempax);
6256 /* if ( !( pVBInfo->VBType & VB_XGI301C ) ) */
6257 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part2Port, 0x00, 0xEF);
6260 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV) {
6261 if (!(pVBInfo->VBInfo & SetInSlaveMode)) {
6262 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0B, 0x00);
6266 if (pVBInfo->VBInfo & SetCRT2ToTV) {
6270 XGI_GetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0));
6283 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
6297 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
6298 resinfo = pVBInfo->SModeIDTable[ModeIdIndex].St_ResInfo;
6301 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */
6302 resinfo = pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO;
6303 CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
6307 if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) {
6311 tempbx = pVBInfo->HDE; /* RHACTE=HDE-1 */
6313 if (XGI_IsLCDDualLink(pVBInfo))
6318 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x2C, temp);
6321 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x2B, 0x0F, temp);
6324 if (pVBInfo->LCDResInfo == Panel1280x1024) {
6325 if (pVBInfo->ModeType == ModeEGA) {
6326 if (pVBInfo->VGAHDE >= 1024) {
6328 if (pVBInfo->LCDInfo & LCDVESATiming)
6334 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x0B, temp);
6335 tempbx = pVBInfo->VDE; /* RTVACTEO=(VDE-1)&0xFF */
6339 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x03, temp);
6341 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x0C, ~0x07, temp);
6343 tempcx = pVBInfo->VT - 1;
6346 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x19, temp);
6349 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x1A, temp);
6350 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x09, 0xF0, 0x00);
6351 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x0A, 0xF0, 0x00);
6352 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x17, 0xFB, 0x00);
6353 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x18, 0xDF, 0x00);
6358 pVBInfo);
6360 if (pVBInfo->LCDInfo & EnableScalingLCD) {
6361 tempbx = pVBInfo->HDE;
6362 tempcx = pVBInfo->VDE;
6365 get_HDE_VDE(pVBInfo, & tempbx, & tempcx);
6369 tempax = pVBInfo->VT;
6370 pVBInfo->LCDHDES = LCDBDesPtr->LCDHDES;
6371 pVBInfo->LCDHRS = LCDBDesPtr->LCDHRS;
6372 pVBInfo->LCDVDES = LCDBDesPtr->LCDVDES;
6373 pVBInfo->LCDVRS = LCDBDesPtr->LCDVRS;
6374 tempbx = pVBInfo->LCDVDES;
6381 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x05, temp);
6383 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x06, temp);
6389 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x02, tempah);
6392 XGI_GetLCDSync(&tempax, &tempbx, pVBInfo);
6393 if (pVBInfo->LCDInfo & EnableScalingLCD) {
6397 pVBInfo);
6401 tempax = pVBInfo->VT;
6402 tempbx = pVBInfo->LCDVRS;
6410 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x04, temp);
6414 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x01, temp);
6416 tempax = pVBInfo->HT;
6417 tempbx = pVBInfo->LCDHDES;
6420 if (XGI_IsLCDDualLink(pVBInfo)) {
6426 if (pVBInfo->VBType & VB_XGI302LV)
6429 if (pVBInfo->VBType & VB_XGI301C) /* tap4 */
6438 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x1F, temp); /* RHBLKE=lcdhdes */
6440 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x20, temp);
6442 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x23, temp); /* RHEQPLE=lcdhdee */
6444 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x25, temp);
6447 XGI_GetLCDSync(&tempax, &tempbx, pVBInfo);
6448 if (pVBInfo->LCDInfo & EnableScalingLCD) {
6452 pVBInfo);
6456 tempax = pVBInfo->HT;
6457 tempbx = pVBInfo->LCDHRS;
6459 if (XGI_IsLCDDualLink(pVBInfo)) {
6465 if (pVBInfo->VBType & VB_XGI302LV)
6474 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x1C, temp);
6478 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x1D, ~0x0F0, temp);
6480 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x21, temp);
6482 if (!(pVBInfo->LCDInfo & LCDVESATiming)) {
6483 if (pVBInfo->VGAVDE == 525) {
6484 if (pVBInfo->
6492 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x2f, temp);
6493 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x30, 0xB3);
6496 if (pVBInfo->VGAVDE == 420) {
6497 if (pVBInfo->
6504 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x2f, temp);
6517 XGI_GetTap4Ptr(USHORT tempcx, PVB_DEVICE_INFO pVBInfo)
6524 tempax = pVBInfo->VGAHDE;
6525 tempbx = pVBInfo->HDE;
6528 tempax = pVBInfo->VGAVDE;
6529 tempbx = pVBInfo->VDE;
6539 if (pVBInfo->TVInfo & SetPALTV)
6543 if (pVBInfo->VBInfo & SetCRT2ToYPbPr) {
6544 if (pVBInfo->TVInfo & SetYPbPrMode525i)
6546 if (pVBInfo->TVInfo & SetYPbPrMode525p)
6548 if (pVBInfo->TVInfo & SetYPbPrMode750p)
6552 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
6572 XGI_SetTap4Regs(PVB_DEVICE_INFO pVBInfo)
6582 if (!(pVBInfo->VBType & VB_XGI301C))
6586 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part2Port, 0x4E, 0xEB); /* Disable Tap4 */
6589 Tap4TimingPtr = XGI_GetTap4Ptr(0, pVBInfo); /* Set Horizontal Scaling */
6591 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, i,
6594 if ((pVBInfo->VBInfo & SetCRT2ToTV)
6595 && (!(pVBInfo->VBInfo & SetCRT2ToHiVisionTV))) {
6596 Tap4TimingPtr = XGI_GetTap4Ptr(1, pVBInfo); /* Set Vertical Scaling */
6598 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, i,
6602 if ((pVBInfo->VBInfo & SetCRT2ToTV)
6603 && (!(pVBInfo->VBInfo & SetCRT2ToHiVisionTV)))
6604 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x4E, ~0x14, 0x04); /* Enable V.Scaling */
6606 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x4E, ~0x14, 0x10); /* Enable H.Scaling */
6617 XGI_SetGroup3(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
6624 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
6627 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */
6631 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x00, 0x00);
6632 if (pVBInfo->TVInfo & SetPALTV) {
6633 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x13, 0xFA);
6634 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x14, 0xC8);
6637 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x13, 0xF5);
6638 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x14, 0xB7);
6641 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) {
6645 if (pVBInfo->TVInfo & SetPALMTV) {
6646 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x13, 0xFA);
6647 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x14, 0xC8);
6648 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x3D, 0xA8);
6651 if ((pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
6652 || (pVBInfo->VBInfo & SetCRT2ToYPbPr)) {
6653 if (pVBInfo->TVInfo & SetYPbPrMode525i) {
6656 tempdi = pVBInfo->HiTVGroup3Data;
6657 if (pVBInfo->SetFlag & TVSimuMode) {
6658 tempdi = pVBInfo->HiTVGroup3Simu;
6660 tempdi = pVBInfo->HiTVGroup3Text;
6664 if (pVBInfo->TVInfo & SetYPbPrMode525p) {
6665 tempdi = pVBInfo->Ren525pGroup3;
6667 if (pVBInfo->TVInfo & SetYPbPrMode750p) {
6668 tempdi = pVBInfo->Ren750pGroup3;
6672 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, i, tempdi[i]);
6674 if (pVBInfo->VBType & VB_XGI301C) { /* Marcovision */
6675 if (pVBInfo->TVInfo & SetYPbPrMode525p) {
6676 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part3Port, 0x28, 0x3f);
6692 PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
6703 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
6706 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag; /* si+Ext_ResInfo */
6709 temp = pVBInfo->RVBHCFACT;
6710 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x13, temp);
6712 tempbx = pVBInfo->RVBHCMAX;
6714 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x14, temp);
6716 tempcx = pVBInfo->VGAHT - 1;
6718 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x16, temp);
6723 tempcx = pVBInfo->VGAVT - 1;
6724 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) {
6729 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x17, temp);
6731 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x15, temp);
6732 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x0D, 0x08);
6733 tempcx = pVBInfo->VBInfo;
6734 tempbx = pVBInfo->VGAHDE;
6740 if (XGI_IsLCDDualLink(pVBInfo))
6757 if (pVBInfo->VBInfo & SetCRT2ToLCD) {
6764 if (pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p)) {
6766 if (pVBInfo->VGAHDE == 1280)
6768 if (pVBInfo->VGAHDE == 1024)
6771 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x0E, ~0xEF, temp);
6773 tempebx = pVBInfo->VDE;
6780 tempcx = pVBInfo->RVBHRS;
6782 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x18, temp);
6784 tempeax = pVBInfo->VGAVDE;
6790 tempeax = pVBInfo->VGAVDE;
6807 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x1B, temp);
6810 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x1A, temp);
6815 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x19, temp);
6818 if (pVBInfo->
6822 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x1C, temp);
6823 tempax = pVBInfo->VGAHDE;
6828 if (XGI_IsLCDDualLink(pVBInfo))
6831 /* if((pVBInfo->VBInfo&(SetCRT2ToLCD))||((pVBInfo->TVInfo&SetYPbPrMode525p)||(pVBInfo->TVInfo&SetYPbPrMode750p))) { */
6832 if (pVBInfo->VBInfo & SetCRT2ToLCD) {
6837 if (pVBInfo->VGAHDE > 800) {
6838 if (pVBInfo->VGAHDE == 1024)
6847 if ( pVBInfo->VBInfo & ( SetCRT2ToTV | SetCRT2ToHiVisionTV ) )
6849 if ( pVBInfo->VBType & VB_XGI301LV )
6851 if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p | SetYPbPrMode1080i ) ) )
6853 if ( pVBInfo->VGAHDE > 800 )
6855 if ( pVBInfo->VGAHDE == 1024 )
6864 if ( pVBInfo->VGAHDE > 800 )
6866 if ( pVBInfo->VGAHDE == 1024 )
6877 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x1E, temp);
6879 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x1D, temp);
6881 if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToHiVisionTV)) {
6882 if (pVBInfo->VGAHDE > 800) {
6883 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x1E, 0x08);
6888 if (pVBInfo->VBInfo & SetCRT2ToTV) {
6890 (pVBInfo->
6894 if ((pVBInfo->VBInfo & SetInSlaveMode)
6895 && (!(pVBInfo->TVInfo & TVSimuMode)))
6900 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x1F, 0x00C0,
6902 tempbx = pVBInfo->HT;
6903 if (XGI_IsLCDDualLink(pVBInfo))
6907 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x21, 0x00C0,
6910 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x22, temp);
6914 if (pVBInfo->ISXPDOS == 0)
6915 XGI_SetCRT2VCLK(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo);
6926 XGI_SetGroup5(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
6930 Pindex = pVBInfo->Part5Port;
6931 Pdata = pVBInfo->Part5Port + 1;
6932 if (pVBInfo->ModeType == ModeVGA) {
6934 (pVBInfo->
6936 XGINew_EnableCRT2(pVBInfo);
6937 /* LoadDAC2(pVBInfo->Part5Port,ModeNo,ModeIdIndex); */
6952 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
6962 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
6963 tempal = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC;
6966 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
6967 tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
6970 if (pVBInfo->LCDInfo & EnableScalingLCD) { /* ScaleLCD */
6971 if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO == 0x14) {
6974 else if (pVBInfo->EModeIDTable[ModeIdIndex].Ext_RESINFO == 0x0F) {
6983 tempal = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC; /* find no Ext_CRT2CRTC2 */
6986 tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
6989 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
6991 tempal = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC2;
6994 pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC2;
7005 if (pVBInfo->LCDInfo & EnableScalingLCD) { /* ScaleLCD */
7052 tempdx = pVBInfo->LCDResInfo;
7055 tempdx = pVBInfo->LCDTypeInfo;
7058 if (pVBInfo->LCDInfo & EnableScalingLCD) {
7059 if ((pVBInfo->LCDInfo & EnableReduceTiming)
7060 && (pVBInfo->LCDResInfo == Panel1600x1200)) {
7069 tempdx = pVBInfo->LCDInfo;
7336 if ((pVBInfo->VBType & VB_XGI301LV)
7337 || (pVBInfo->VBType & VB_XGI302LV))
7343 if ((pVBInfo->VBType & VB_XGI301LV)
7344 || (pVBInfo->VBType & VB_XGI302LV))
7350 if ((pVBInfo->VBType & VB_XGI301LV)
7351 || (pVBInfo->VBType & VB_XGI302LV))
7357 if ((pVBInfo->VBType & VB_XGI301LV)
7358 || (pVBInfo->VBType & VB_XGI302LV))
7364 if ((pVBInfo->VBType & VB_XGI301LV)
7365 || (pVBInfo->VBType & VB_XGI302LV))
7377 if ((pVBInfo->VBType & VB_XGI301LV)
7378 || (pVBInfo->VBType & VB_XGI302LV))
7384 if ((pVBInfo->VBType & VB_XGI301LV)
7385 || (pVBInfo->VBType & VB_XGI302LV))
7403 if ((pVBInfo->VBType & VB_XGI301LV)
7404 || (pVBInfo->VBType & VB_XGI302LV))
7410 if ((pVBInfo->VBType & VB_XGI301LV)
7411 || (pVBInfo->VBType & VB_XGI302LV))
7417 if ((pVBInfo->VBType & VB_XGI301LV)
7418 || (pVBInfo->VBType & VB_XGI302LV))
7457 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
7465 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
7466 tempal = pVBInfo->SModeIDTable[ModeIdIndex].St_CRT2CRTC;
7469 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
7470 tempal = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC;
7505 tempdx = pVBInfo->TVInfo;
7507 if (pVBInfo->VBInfo & SetInSlaveMode)
7616 XGI_BacklightByDrv(PVB_DEVICE_INFO pVBInfo)
7620 tempah = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x3A);
7635 void XGI_FirePWDDisable( PVB_DEVICE_INFO pVBInfo )
7637 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port , 0x26 , 0x00 , 0xFC ) ;
7648 XGI_FirePWDEnable(PVB_DEVICE_INFO pVBInfo)
7650 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x26, 0x03, 0xFC);
7662 PVB_DEVICE_INFO pVBInfo)
7664 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x63, 0xBF, 0x40);
7676 PVB_DEVICE_INFO pVBInfo)
7679 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3d4, 0x63, 0xBF, 0x00);
7694 XGI_SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo)
7701 index = XGI_GetLCDCapPtr(pVBInfo);
7704 XGINew_LCD_Wait_Time(pVBInfo->LCDCapList[index].PSC_S1, pVBInfo);
7707 XGINew_LCD_Wait_Time(pVBInfo->LCDCapList[index].PSC_S2, pVBInfo);
7710 XGINew_LCD_Wait_Time(pVBInfo->LCDCapList[index].PSC_S3, pVBInfo);
7713 XGINew_LCD_Wait_Time(pVBInfo->LCDCapList[index].PSC_S4, pVBInfo);
7728 XGI_SetPanelPower(USHORT tempah, USHORT tempbl, PVB_DEVICE_INFO pVBInfo)
7730 if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C))
7731 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x26, tempbl,
7734 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->P3c4, 0x11, tempbl, tempah);
7760 UCHAR XGI_XG21GetPSCValue(PVB_DEVICE_INFO pVBInfo)
7764 CR4A = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A ) ;
7765 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A , ~0x23 ) ; /* enable GPIO write */
7767 temp = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x48 ) ;
7771 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A , CR4A ) ;
7782 UCHAR XGI_XG27GetPSCValue(PVB_DEVICE_INFO pVBInfo)
7788 CR4A = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A ) ;
7790 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A , ~0x0C ) ; /* enable GPIO write */
7793 temp = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x48 ) ;
7799 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A , CR4A ) ;
7802 CRB4 = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0xB4 ) ;
7821 void XGI_XG21BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo)
7825 CR4A = XGI_GetReg( (XGIIOADDRESS)pVBInfo->P3d4 , 0x4A ) ;
7828 XGI_SetRegAND( (XGIIOADDRESS)pVBInfo->P3d4 , 0x4A , ~tempbh ) ; /* enable GPIO write */
7834 XGI_SetRegANDOR( (XGIIOADDRESS)pVBInfo->P3d4 , 0xB4 , ~0x02 , temp) ; /* CR B4[1] */
7838 temp = XGI_GetReg( (XGIIOADDRESS)pVBInfo->P3d4 , 0x48 ) ;
7844 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x48 , temp ) ;
7848 void XGI_XG27BLSignalVDD(USHORT tempbh,USHORT tempbl, PVB_DEVICE_INFO pVBInfo)
7867 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0xB4 , ~0x02 , temp) ; /* CR B4[1] */
7872 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0xB4 , ~tempbh0 , tempbl0 ) ; /* CR B4[0] if tempbh0 = 0x01 */
7876 CR4A = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A ) ;
7883 XGI_SetRegAND( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4A , ~tempbh ) ; /* enable GPIO write */
7885 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x48 , ~tempbh , tempbl ) ;
7891 USHORT XGI_GetLVDSOEMTableIndex(PVB_DEVICE_INFO pVBInfo)
7896 index = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x36 ) ;
7919 void XGI_XG21SetPanelDelay(USHORT tempbl, PVB_DEVICE_INFO pVBInfo)
7925 index = XGI_GetLVDSOEMTableIndex( pVBInfo );
7931 XGINew_LCD_Wait_Time( pVBInfo->XG21_LVDSCapList[ index ].PSC_S1, pVBInfo ) ;
7938 XGINew_LCD_Wait_Time( pVBInfo->XG21_LVDSCapList[ index ].PSC_S2, pVBInfo ) ;
7945 XGINew_LCD_Wait_Time( pVBInfo->XG21_LVDSCapList[ index ].PSC_S3, pVBInfo ) ;
7952 XGINew_LCD_Wait_Time( pVBInfo->XG21_LVDSCapList[ index ].PSC_S4, pVBInfo ) ;
7958 BOOLEAN XGI_XG21CheckLVDSMode(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo )
7967 resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ;
7970 xres = pVBInfo->StResInfo[ resindex ].HTotal ;
7971 yres = pVBInfo->StResInfo[ resindex ].VTotal ;
7972 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
7976 xres = pVBInfo->ModeResInfo[ resindex ].HTotal ; /* xres->ax */
7977 yres = pVBInfo->ModeResInfo[ resindex ].VTotal ; /* yres->bx */
7978 modeflag = pVBInfo->EModeIDTable[ ModeIdIndex].Ext_ModeFlag ; /* si+St_ModeFlag */
7999 lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo );
8000 if ( xres > (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE) )
8003 if ( yres > (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE) )
8008 if ( ( xres != (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE) ) ||
8009 ( yres != (pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE)) )
8011 colordepth = XGI_GetColorDepth( ModeNo , ModeIdIndex, pVBInfo ) ;
8022 void XGI_SetXG21FPBits(PVB_DEVICE_INFO pVBInfo)
8026 temp = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x37 ) ; /* D[0] 1: 18bit */
8028 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x06 , ~0x40 , temp ) ; /* SR06[6] 18bit Dither */
8029 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x09 , ~0xc0 , temp | 0x80 ) ; /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: dual 12bits */
8034 void XGI_SetXG27FPBits(PVB_DEVICE_INFO pVBInfo)
8038 temp = XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x37 ) ; /* D[1:0] 01: 18bit, 00: dual 12, 10: single 24 */
8040 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x06 , ~0xc0 , temp & 0x80 ) ; /* SR06[7]0: dual 12/1: single 24 [6] 18bit Dither <= 0 h/w recommend */
8041 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x09 , ~0xc0 , temp | 0x80 ) ; /* SR09[7] enable FP output, SR09[6] 1: sigle 18bits, 0: 24bits */
8046 void XGI_SetXG21LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo )
8059 lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo );
8061 temp = (UCHAR) ( ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & (LCDPolarity << 8 ) ) >> 8 );
8063 Miscdata =(UCHAR) XGI_GetRegByte(pVBInfo->P3cc) ;
8065 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c2 , (Miscdata & 0x3F) | temp ) ;
8067 temp = (UCHAR) ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & LCDPolarity ) ;
8068 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x80 , temp&0x80 ) ; /* SR35[7] FP VSync polarity */
8069 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , ~0x20 , (temp&0x40)>>1 ) ; /* SR30[5] FP HSync polarity */
8071 XGI_SetXG21FPBits(pVBInfo);
8072 resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ;
8075 xres = pVBInfo->StResInfo[ resindex ].HTotal ;
8076 yres = pVBInfo->StResInfo[ resindex ].VTotal ;
8077 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
8081 xres = pVBInfo->ModeResInfo[ resindex ].HTotal ; /* xres->ax */
8082 yres = pVBInfo->ModeResInfo[ resindex ].VTotal ; /* yres->bx */
8083 modeflag = pVBInfo->EModeIDTable[ ModeIdIndex].Ext_ModeFlag ; /* si+St_ModeFlag */
8089 LVDSHT = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHT;
8091 LVDSHBS = xres + ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE - xres ) / 2 ;
8098 LVDSHRS = LVDSHBS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHFP ;
8101 LVDSHRE = LVDSHRS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHSYNC ;
8104 LVDSHBE = LVDSHBS + LVDSHT - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE ;
8106 LVDSVT = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVT;
8108 LVDSVBS = yres + ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE - yres ) / 2 ;
8115 LVDSVRS = LVDSVBS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVFP ;
8118 LVDSVRE = LVDSVRS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVSYNC ;
8121 LVDSVBE = LVDSVBS + LVDSVT - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE ;
8123 temp = ( UCHAR )XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 ) ;
8124 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 , temp & 0x7f ) ; /* Unlock CRTC */
8128 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x1 , 0x1 ) ;
8133 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0B , ~0x03 , ( value & 0x300 ) >> 8 ) ;
8134 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x0 , (value & 0xFF) ) ;
8138 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0B , ~0x30 , ( value & 0x300 ) >> 4 ) ;
8139 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2 , (value & 0xFF) ) ;
8143 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0C , ~0x03 , ( value & 0xC0 ) >> 6 ) ;
8144 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x05 , ~0x80 , ( value & 0x20 ) << 2 ) ;
8145 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x03 , ~0x1F , value & 0x1F ) ;
8149 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0B , ~0xC0 , ( value & 0x300 ) >> 2 ) ;
8150 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4 , (value & 0xFF) ) ;
8154 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , ~0x03 , ( value & 0x300 ) >> 8 ) ;
8155 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2E , (value & 0xFF) ) ;
8159 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0C , ~0x04 , ( value & 0x20 ) >> 3 ) ;
8160 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x05 , ~0x1F , value & 0x1F ) ;
8164 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , ~0xFC , value << 2 ) ;
8168 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x01 , ( value & 0x400 ) >> 10 ) ;
8169 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x20 , ( value & 0x200 ) >> 4 ) ;
8170 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x01 , ( value & 0x100 ) >> 8 ) ;
8171 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x06 , (value & 0xFF) ) ;
8175 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x04 , ( value & 0x400 ) >> 8 ) ;
8176 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x09 , ~0x20 , ( value & 0x200 ) >> 4 ) ;
8177 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x08 , ( value & 0x100 ) >> 5 ) ;
8178 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x15 , (value & 0xFF) ) ;
8182 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x10 , ( value & 0x100 ) >> 4 ) ;
8183 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x16 , (value & 0xFF) ) ;
8187 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x08 , ( value & 0x400 ) >> 7 ) ;
8188 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x80 , ( value & 0x200 ) >> 2 ) ;
8189 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x04 , ( value & 0x100 ) >> 6 ) ;
8190 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x10 , (value & 0xFF) ) ;
8193 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , ~0x03 , ( value & 0x600 ) >> 9 ) ;
8194 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x34 , (value >> 1) & 0xFF ) ;
8195 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x33 , ~0x01 , value & 0x01 ) ;
8199 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x20 , ( value & 0x10 ) << 1 ) ;
8200 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 , ~0x0F , value & 0x0F ) ;
8203 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , ~0xFC , ( value << 2 ) & 0x7C ) ;
8208 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 , value ) ;
8209 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2B , pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1) ;
8210 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2C , pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData2) ;
8216 XGI_GetRegByte( (XGIIOADDRESS) pVBInfo->P3da ) ; /* reset 3da */
8217 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c0 , 0x13 ) ; /* set index */
8218 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c0 , 0x00 ) ; /* set data, panning = 0, shift left 1 dot*/
8220 XGI_GetRegByte( (XGIIOADDRESS) pVBInfo->P3da ) ; /* Enable Attribute */
8221 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c0 , 0x20 ) ;
8223 XGI_GetRegByte( (XGIIOADDRESS) pVBInfo->P3da ) ; /* reset 3da */
8231 void XGI_SetXG27LVDSPara(USHORT ModeNo,USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo )
8244 lvdstableindex = XGI_GetLVDSOEMTableIndex( pVBInfo );
8245 temp = (UCHAR) ( ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & (LCDPolarity << 8 ) ) >> 8 );
8247 Miscdata =(UCHAR) XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3cc) ;
8249 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c2 , (Miscdata & 0x3F) | temp ) ;
8251 temp = (UCHAR) ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDS_Capability & LCDPolarity ) ;
8252 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x80 , temp&0x80 ) ; /* SR35[7] FP VSync polarity */
8253 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x30 , ~0x20 , (temp&0x40)>>1 ) ; /* SR30[5] FP HSync polarity */
8255 XGI_SetXG27FPBits(pVBInfo);
8256 resindex = XGI_GetResInfo( ModeNo , ModeIdIndex, pVBInfo ) ;
8259 xres = pVBInfo->StResInfo[ resindex ].HTotal ;
8260 yres = pVBInfo->StResInfo[ resindex ].VTotal ;
8261 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag; /* si+St_ResInfo */
8265 xres = pVBInfo->ModeResInfo[ resindex ].HTotal ; /* xres->ax */
8266 yres = pVBInfo->ModeResInfo[ resindex ].VTotal ; /* yres->bx */
8267 modeflag = pVBInfo->EModeIDTable[ ModeIdIndex].Ext_ModeFlag ; /* si+St_ModeFlag */
8273 LVDSHT = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHT;
8275 LVDSHBS = xres + ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE - xres ) / 2 ;
8282 LVDSHRS = LVDSHBS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHFP ;
8285 LVDSHRE = LVDSHRS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHSYNC ;
8288 LVDSHBE = LVDSHBS + LVDSHT - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSHDE ;
8290 LVDSVT = pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVT;
8292 LVDSVBS = yres + ( pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE - yres ) / 2 ;
8299 LVDSVRS = LVDSVBS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVFP ;
8302 LVDSVRE = LVDSVRS + pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVSYNC ;
8305 LVDSVBE = LVDSVBS + LVDSVT - pVBInfo->XG21_LVDSCapList[lvdstableindex].LVDSVDE ;
8307 temp = ( UCHAR )XGI_GetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 ) ;
8308 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 , temp & 0x7f ) ; /* Unlock CRTC */
8312 XGI_SetRegOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x1 , 0x1 ) ;
8317 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0B , ~0x03 , ( value & 0x300 ) >> 8 ) ;
8318 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x0 , (value & 0xFF) ) ;
8322 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0B , ~0x30 , ( value & 0x300 ) >> 4 ) ;
8323 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x2 , (value & 0xFF) ) ;
8327 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0C , ~0x03 , ( value & 0xC0 ) >> 6 ) ;
8328 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x05 , ~0x80 , ( value & 0x20 ) << 2 ) ;
8329 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x03 , ~0x1F , value & 0x1F ) ;
8333 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0B , ~0xC0 , ( value & 0x300 ) >> 2 ) ;
8334 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x4 , (value & 0xFF) ) ;
8338 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , ~0x03 , ( value & 0x300 ) >> 8 ) ;
8339 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2E , (value & 0xFF) ) ;
8343 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0C , ~0x04 , ( value & 0x20 ) >> 3 ) ;
8344 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x05 , ~0x1F , value & 0x1F ) ;
8348 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2F , ~0xFC , value << 2 ) ;
8352 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x01 , ( value & 0x400 ) >> 10 ) ;
8353 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x20 , ( value & 0x200 ) >> 4 ) ;
8354 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x01 , ( value & 0x100 ) >> 8 ) ;
8355 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x06 , (value & 0xFF) ) ;
8359 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x04 , ( value & 0x400 ) >> 8 ) ;
8360 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x09 , ~0x20 , ( value & 0x200 ) >> 4 ) ;
8361 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x08 , ( value & 0x100 ) >> 5 ) ;
8362 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x15 , (value & 0xFF) ) ;
8366 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x10 , ( value & 0x100 ) >> 4 ) ;
8367 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x16 , (value & 0xFF) ) ;
8371 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x08 , ( value & 0x400 ) >> 7 ) ;
8372 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x80 , ( value & 0x200 ) >> 2 ) ;
8373 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x07 , ~0x04 , ( value & 0x100 ) >> 6 ) ;
8374 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3d4 , 0x10 , (value & 0xFF) ) ;
8377 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x35 , ~0x07 , ( value & 0x700 ) >> 8 ) ;
8378 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x34 , value & 0xFF ) ;
8382 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x0A , ~0x20 , ( value & 0x10 ) << 1 ) ;
8383 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3d4 , 0x11 , ~0x0F , value & 0x0F ) ;
8386 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x3F , ~0xFC , ( value << 2 ) & 0xFC ) ;
8391 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->P3c4 , 0x31 , ~0x30 , value ) ;
8392 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2B , pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData1) ;
8393 XGI_SetReg( (XGIIOADDRESS) pVBInfo->P3c4 , 0x2C , pVBInfo->XG21_LVDSCapList[lvdstableindex].VCLKData2) ;
8399 XGI_GetRegByte( (XGIIOADDRESS) pVBInfo->P3da ) ; /* reset 3da */
8400 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c0 , 0x13 ) ; /* set index */
8401 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c0 , 0x00 ) ; /* set data, panning = 0, shift left 1 dot*/
8403 XGI_GetRegByte( (XGIIOADDRESS) pVBInfo->P3da ) ; /* Enable Attribute */
8404 XGI_SetRegByte( (XGIIOADDRESS) pVBInfo->P3c0 , 0x20 ) ;
8406 XGI_GetRegByte( (XGIIOADDRESS) pVBInfo->P3da ) ; /* reset 3da */
8419 XGI_IsLCDON(PVB_DEVICE_INFO pVBInfo)
8423 tempax = pVBInfo->VBInfo;
8440 XGI_EnablePWD(PVB_DEVICE_INFO pVBInfo)
8444 index = XGI_GetLCDCapPtr(pVBInfo);
8445 temp = pVBInfo->LCDCapList[index].PWD_2B;
8446 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x2B, temp);
8447 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x2C,
8448 pVBInfo->LCDCapList[index].PWD_2C);
8449 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x2D,
8450 pVBInfo->LCDCapList[index].PWD_2D);
8451 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x2E,
8452 pVBInfo->LCDCapList[index].PWD_2E);
8453 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x2F,
8454 pVBInfo->LCDCapList[index].PWD_2F);
8455 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x27, 0x80); /* enable PWD */
8466 XGI_DisablePWD(PVB_DEVICE_INFO pVBInfo)
8468 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part4Port, 0x27, 0x7F); /* disable PWD */
8479 XGI_DisableChISLCD(PVB_DEVICE_INFO pVBInfo)
8483 tempbx = pVBInfo->SetFlag & (DisableChA | DisableChB);
8484 tempah = ~((USHORT) XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x2E));
8508 XGI_EnableChISLCD(PVB_DEVICE_INFO pVBInfo)
8513 tempbx = pVBInfo->SetFlag & (EnableChA | EnableChB);
8514 tempah = ~((USHORT) XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x2E));
8538 XGI_GetLCDCapPtr(PVB_DEVICE_INFO pVBInfo)
8542 tempah = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x36);
8546 tempbl = pVBInfo->LCDCapList[i].LCD_ID;
8559 tempbl = pVBInfo->LCDCapList[i].LCD_ID;
8573 XGI_GetLCDCapPtr1(PVB_DEVICE_INFO pVBInfo)
8577 tempal = pVBInfo->LCDResInfo;
8578 tempah = pVBInfo->LCDTypeInfo;
8581 tempbl = pVBInfo->LCDCapList[i].LCD_ID;
8593 tempbl = pVBInfo->LCDCapList[i].LCD_ID;
8597 pVBInfo->LCDResInfo = Panel1024x768;
8598 pVBInfo->LCDTypeInfo = 0;
8614 PVB_DEVICE_INFO pVBInfo)
8618 Index = XGI_GetLCDCapPtr(pVBInfo);
8619 *HSyncWidth = pVBInfo->LCDCapList[Index].LCD_HSyncWidth;
8620 *VSyncWidth = pVBInfo->LCDCapList[Index].LCD_VSyncWidth;
8635 PVB_DEVICE_INFO pVBInfo)
8642 if (pVBInfo->SetFlag == Win9xDOSMode) {
8643 if (pVBInfo->
8646 XGI_DisplayOn(HwDeviceExtension, pVBInfo);
8655 if (!XGI_DisableChISLCD(pVBInfo)) {
8656 if ((XGI_EnableChISLCD(pVBInfo))
8657 || (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))) {
8658 if (pVBInfo->LCDInfo & SetPWDEnable) {
8659 XGI_EnablePWD(pVBInfo);
8662 pVBInfo->LCDInfo &= (~SetPWDEnable);
8663 if (pVBInfo->
8673 XGI_SetPanelPower(tempah, tempbl, pVBInfo);
8674 XGI_SetPanelDelay(1, pVBInfo);
8682 if (pVBInfo->
8685 if (!(pVBInfo->SetFlag & DisableChA)) {
8686 if (pVBInfo->SetFlag & EnableChA) {
8687 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1E, 0x20); /* Power on */
8690 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) { /* SetCRT2ToLCDA ) */
8691 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x1E, 0x20); /* Power on */
8696 if (!(pVBInfo->SetFlag & DisableChB)) {
8697 if ((pVBInfo->SetFlag & EnableChB)
8698 || (pVBInfo->
8702 (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x32);
8704 if (pVBInfo->VBInfo & SetInSlaveMode) {
8705 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC))
8708 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x32, tempah);
8709 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->P3c4, 0x1E,
8714 (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port,
8718 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2E, 0x80); /* BVBDOENABLE = 1 */
8720 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, 0x7F); /* BScreenOFF = 0 */
8724 if ((pVBInfo->SetFlag & (EnableChA | EnableChB))
8725 || (!(pVBInfo->VBInfo & DisableCRT2Display))) {
8726 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x00, ~0xE0, 0x20); /* shampoo 0129 */
8727 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
8728 if (!XGI_DisableChISLCD(pVBInfo)) {
8729 if (XGI_EnableChISLCD(pVBInfo)
8730 || (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)))
8731 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part4Port, 0x2A, 0x7F); /* LVDS PLL power on */
8733 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part4Port, 0x30, 0x7F); /* LVDS Driver power on */
8739 if (!(pVBInfo->VBInfo & DisableCRT2Display)) {
8742 if (!(pVBInfo->VBInfo & SetSimuScanMode)) {
8743 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
8744 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) {
8746 if (pVBInfo->VBInfo & SetCRT2ToLCDA)
8749 if (pVBInfo->SetFlag & DisableChB)
8752 if (pVBInfo->SetFlag & DisableChA)
8755 if (pVBInfo->SetFlag & EnableChB)
8758 if (pVBInfo->SetFlag & EnableChA)
8765 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x1F, tempah); /* EnablePart4_1F */
8767 if (pVBInfo->SetFlag & Win9xDOSMode) {
8768 XGI_DisplayOn(HwDeviceExtension, pVBInfo);
8772 if (!(pVBInfo->SetFlag & DisableChA)) {
8773 XGI_VBLongWait(pVBInfo);
8774 if (!(pVBInfo->SetFlag & GatingCRT)) {
8775 XGI_DisableGatingCRT(HwDeviceExtension, pVBInfo);
8776 XGI_DisplayOn(HwDeviceExtension, pVBInfo);
8777 XGI_VBLongWait(pVBInfo);
8783 if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD | SetCRT2ToLCDA))
8784 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x1E, 0x20); /* enable CRT2 */
8788 tempah = (UCHAR) XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x2E);
8790 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2E, 0x80); /* BVBDOENABLE = 1 */
8792 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, 0x7F);
8793 XGI_DisplayOn(HwDeviceExtension, pVBInfo);
8798 if (!XGI_EnableChISLCD(pVBInfo)) {
8799 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
8800 if (XGI_BacklightByDrv(pVBInfo))
8807 if (pVBInfo->LCDInfo & SetPWDEnable) {
8808 XGI_FirePWDEnable(pVBInfo);
8812 XGI_SetPanelDelay(2, pVBInfo);
8814 if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) {
8822 XGI_SetPanelPower(tempah, tempbl, pVBInfo);
8835 PVB_DEVICE_INFO pVBInfo)
8839 if (pVBInfo->SetFlag == Win9xDOSMode)
8844 if ((!(pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)))
8845 || (XGI_DisableChISLCD(pVBInfo))) {
8846 if (!XGI_IsLCDON(pVBInfo)) {
8847 if (pVBInfo->LCDInfo & SetPWDEnable)
8848 XGI_EnablePWD(pVBInfo);
8850 pVBInfo->LCDInfo &= ~SetPWDEnable;
8851 XGI_DisablePWD(pVBInfo);
8852 if (pVBInfo->
8861 XGI_SetPanelPower(tempax, tempbx, pVBInfo);
8862 XGI_SetPanelDelay(3, pVBInfo);
8864 } /* end if(!XGI_IsLCDON(pVBInfo)) */
8869 if (pVBInfo->
8873 if (!(pVBInfo->VBInfo & (DisableCRT2Display | SetSimuScanMode))) {
8874 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
8875 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) {
8877 if (!(pVBInfo->VBInfo & SetCRT2ToLCDA))
8880 if (pVBInfo->SetFlag & DisableChB)
8883 if (pVBInfo->SetFlag & DisableChA)
8889 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part4Port, 0x1F, tempah); /* disable part4_1f */
8891 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
8892 if (((pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)))
8893 || (XGI_DisableChISLCD(pVBInfo)) || (XGI_IsLCDON(pVBInfo)))
8894 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x30, 0x80); /* LVDS Driver power down */
8897 if ((pVBInfo->SetFlag & DisableChA)
8898 || (pVBInfo->
8901 if (pVBInfo->SetFlag & GatingCRT)
8902 XGI_EnableGatingCRT(HwDeviceExtension, pVBInfo);
8903 XGI_DisplayOff(HwDeviceExtension, pVBInfo);
8906 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
8907 if ((pVBInfo->SetFlag & DisableChA)
8908 || (pVBInfo->VBInfo & SetCRT2ToLCDA))
8909 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part1Port, 0x1e, 0xdf); /* Power down */
8912 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->P3c4, 0x32, 0xdf); /* disable TV as primary VGA swap */
8914 if ((pVBInfo->VBInfo & (SetSimuScanMode | SetCRT2ToDualEdge)))
8915 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part2Port, 0x00, 0xdf);
8917 if ((pVBInfo->SetFlag & DisableChB)
8918 || (pVBInfo->VBInfo & (DisableCRT2Display | SetSimuScanMode))
8919 || ((!(pVBInfo->VBInfo & SetCRT2ToLCDA))
8920 && (pVBInfo->
8922 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, 0x80); /* BScreenOff=1 */
8924 if ((pVBInfo->SetFlag & DisableChB)
8925 || (pVBInfo->VBInfo & (DisableCRT2Display | SetSimuScanMode))
8926 || (!(pVBInfo->VBInfo & SetCRT2ToLCDA))
8927 || (pVBInfo->
8929 tempah = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x00); /* save Part1 index 0 */
8930 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, 0x10); /* BTDAC = 1, avoid VB reset */
8931 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part1Port, 0x1E, 0xDF); /* disable CRT2 */
8932 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, tempah); /* restore Part1 index 0 */
8937 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) {
8938 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, 0x80); /* BScreenOff=1 */
8939 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part1Port, 0x1E, 0xDF); /* Disable CRT2 */
8940 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->P3c4, 0x32, 0xDF); /* Disable TV asPrimary VGA swap */
8943 if (pVBInfo->
8945 XGI_DisplayOff(HwDeviceExtension,pVBInfo);
8952 if (!(pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))
8953 || (XGI_DisableChISLCD(pVBInfo)) || (XGI_IsLCDON(pVBInfo))) {
8954 if (pVBInfo->LCDInfo & SetPWDEnable) {
8955 if (pVBInfo->LCDInfo & SetPWDEnable)
8956 XGI_BacklightByDrv(pVBInfo);
8958 XGI_SetPanelDelay(4, pVBInfo);
8959 if (pVBInfo->VBType & VB_XGI301LV) {
8969 XGI_SetPanelPower(tempah, tempbl, pVBInfo);
8993 XGI_GetTVPtrIndex(PVB_DEVICE_INFO pVBInfo)
8997 if (pVBInfo->TVInfo & SetPALTV)
8999 if (pVBInfo->TVInfo & SetYPbPrMode1080i)
9001 if (pVBInfo->TVInfo & SetYPbPrMode525i)
9003 if (pVBInfo->TVInfo & SetYPbPrMode525p)
9005 if (pVBInfo->TVInfo & SetYPbPrMode750p)
9007 if (pVBInfo->TVInfo & TVSimuMode)
9021 XGI_OEM310Setting(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
9023 if (pVBInfo->SetFlag & Win9xDOSMode)
9027 XGI_SetDelayComp(pVBInfo);
9029 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA))
9030 XGI_SetLCDCap(pVBInfo);
9032 if (pVBInfo->VBInfo & SetCRT2ToTV) {
9034 XGI_SetPhaseIncr(pVBInfo);
9035 XGI_SetYFilter(ModeNo, ModeIdIndex, pVBInfo);
9036 XGI_SetAntiFlicker(ModeNo, ModeIdIndex, pVBInfo);
9038 if (pVBInfo->VBType & VB_XGI301)
9039 XGI_SetEdgeEnhance(ModeNo, ModeIdIndex, pVBInfo);
9051 XGI_SetDelayComp(PVB_DEVICE_INFO pVBInfo)
9060 if (pVBInfo->
9063 if (pVBInfo->
9069 index = XGI_GetTVPtrIndex(pVBInfo); /* Get TV Delay */
9070 tempbl = pVBInfo->XGI_TVDelayList[index];
9072 if (pVBInfo->
9075 tempbl = pVBInfo->XGI_TVDelayList2[index];
9077 if (pVBInfo->VBInfo & SetCRT2ToDualEdge)
9080 if ( pVBInfo->VBInfo & SetCRT2ToRAMDAC )
9083 if ( pVBInfo->VBType & ( VB_XGI301B | VB_XGI302B | VB_XGI301LV | VB_XGI302LV | VB_XGI301C ) )
9086 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) {
9087 index = XGI_GetLCDCapPtr(pVBInfo); /* Get LCD Delay */
9088 tempbh = pVBInfo->LCDCapList[index].LCD_DelayCompensation;
9090 if (!(pVBInfo->VBInfo & SetCRT2ToLCDA))
9096 tempah = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x2D);
9098 if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD | SetCRT2ToTV)) { /* Channel B */
9103 if (pVBInfo->VBInfo & SetCRT2ToLCDA) { /* Channel A */
9107 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x2D, tempah);
9111 else if ( pVBInfo->IF_DEF_LVDS == 1 )
9115 if ( pVBInfo->VBInfo & SetCRT2ToLCD )
9117 tempah = pVBInfo->LCDCapList[ XGI_GetLCDCapPtr(pVBInfo) ].LCD_DelayCompensation ; /* / Get LCD Delay */
9120 XGI_SetRegANDOR( (XGIIOADDRESS) pVBInfo->Part1Port , 0x2D , 0x0f , tempah ) ;
9134 XGI_SetLCDCap(PVB_DEVICE_INFO pVBInfo)
9138 tempcx = pVBInfo->LCDCapList[XGI_GetLCDCapPtr(pVBInfo)].LCD_Capability;
9140 if (pVBInfo->
9143 if (pVBInfo->VBType & (VB_XGI301LV | VB_XGI302LV | VB_XGI301C)) { /* 301LV/302LV only */
9145 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x24,
9149 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x0D,
9156 if (pVBInfo->
9159 if (pVBInfo->VBInfo & SetCRT2ToLCD)
9160 XGI_SetLCDCap_B(tempcx, pVBInfo);
9161 else if (pVBInfo->VBInfo & SetCRT2ToLCDA)
9162 XGI_SetLCDCap_A(tempcx, pVBInfo);
9164 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
9166 SetSpectrum(pVBInfo);
9170 XGI_SetLCDCap_A(tempcx, pVBInfo);
9181 XGI_SetLCDCap_A(USHORT tempcx, PVB_DEVICE_INFO pVBInfo)
9185 temp = XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x37);
9188 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x19, 0x0F, (USHORT) (0x20 | (tempcx & 0x00C0))); /* Enable Dither */
9189 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x1A, 0x7F, 0x80);
9192 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x19, 0x0F,
9194 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x1A, 0x7F, 0x00);
9200 XGI_SetRegANDOR((XGIIOADDRESS)pVBInfo->Part1Port,0x19, 0x0F,(USHORT)(0x30|(tempcx&0x00C0)) );
9201 XGI_SetRegANDOR((XGIIOADDRESS)pVBInfo->Part1Port,0x1A,0x7F,0x00);
9205 XGI_SetRegANDOR((XGIIOADDRESS)pVBInfo->Part1Port,0x19, 0x0F,(USHORT)(0x20|(tempcx&0x00C0)) );//Enable Dither
9206 XGI_SetRegANDOR((XGIIOADDRESS)pVBInfo->Part1Port,0x1A,0x7F,0x80);
9219 XGI_SetLCDCap_B(USHORT tempcx, PVB_DEVICE_INFO pVBInfo)
9222 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x1A, 0xE0,
9225 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x1A, 0xE0, (USHORT) (((tempcx & 0x00ff) >> 6) | 0x18)); /* Enable Dither */
9236 SetSpectrum(PVB_DEVICE_INFO pVBInfo)
9240 index = XGI_GetLCDCapPtr(pVBInfo);
9242 XGI_SetRegAND((XGIIOADDRESS) pVBInfo->Part4Port, 0x30, 0x8F); /* disable down spectrum D[4] */
9243 XGI_WaitEndRetrace(pVBInfo->RelIO);
9244 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x30, 0x20); /* reset spectrum */
9245 XGI_WaitEndRetrace(pVBInfo->RelIO);
9247 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x31,
9248 pVBInfo->LCDCapList[index].Spectrum_31);
9249 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x32,
9250 pVBInfo->LCDCapList[index].Spectrum_32);
9251 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x33,
9252 pVBInfo->LCDCapList[index].Spectrum_33);
9253 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x34,
9254 pVBInfo->LCDCapList[index].Spectrum_34);
9255 XGI_WaitEndRetrace(pVBInfo->RelIO);
9256 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x30, 0x40); /* enable spectrum */
9267 XGI_SetAntiFlicker(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
9273 if (pVBInfo->TVInfo & (SetYPbPrMode525p | SetYPbPrMode750p))
9276 tempbx = XGI_GetTVPtrIndex(pVBInfo);
9280 index = pVBInfo->SModeIDTable[ModeIdIndex].VB_StTVFlickerIndex;
9283 index = pVBInfo->EModeIDTable[ModeIdIndex].VB_ExtTVFlickerIndex;
9290 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x0A, 0x8F, tempah);
9301 XGI_SetEdgeEnhance(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
9308 tempbx = XGI_GetTVPtrIndex(pVBInfo);
9312 index = pVBInfo->SModeIDTable[ModeIdIndex].VB_StTVEdgeIndex;
9315 index = pVBInfo->EModeIDTable[ModeIdIndex].VB_ExtTVEdgeIndex;
9322 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part2Port, 0x3A, 0x1F, tempah);
9333 XGI_SetPhaseIncr(PVB_DEVICE_INFO pVBInfo)
9341 XGI_GetTVPtrIndex2(&tempbx, &tempcl, &tempch, pVBInfo); /* bx, cl, ch */
9344 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x31,
9346 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x32,
9348 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x33,
9350 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x34,
9362 XGI_SetYFilter(USHORT ModeNo, USHORT ModeIdIndex, PVB_DEVICE_INFO pVBInfo)
9369 XGI_GetTVPtrIndex2(&tempbx, &tempcl, &tempch, pVBInfo); /* bx, cl, ch */
9413 tempal = pVBInfo->SModeIDTable[ModeIdIndex].VB_StTVYFilterIndex;
9415 tempal = pVBInfo->EModeIDTable[ModeIdIndex].VB_ExtTVYFilterIndex;
9423 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x35, 0);
9424 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x36, 0);
9425 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x37, 0);
9426 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x38,
9430 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x35,
9432 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x36,
9434 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x37,
9436 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x38,
9440 if (pVBInfo->
9443 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x48,
9445 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x49,
9447 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part2Port, 0x4A,
9471 PVB_DEVICE_INFO pVBInfo)
9477 if (pVBInfo->TVInfo & SetPALTV)
9480 if (pVBInfo->TVInfo & SetPALMTV)
9483 if (pVBInfo->TVInfo & SetPALNTV)
9486 if (pVBInfo->TVInfo & NTSC1024x768) {
9488 if (pVBInfo->TVInfo & SetPALMTV)
9492 if (pVBInfo->
9495 if ((!(pVBInfo->VBInfo & SetInSlaveMode))
9496 || (pVBInfo->TVInfo & TVSimuMode)) {
9502 if (pVBInfo->
9517 PVB_DEVICE_INFO pVBInfo)
9527 /* XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port , 0x03 , 0x00 ) ; // fix write part1 index 0 BTDRAM bit Bug */
9529 if (!(pVBInfo->VBInfo & DisableCRT2Display)) {
9530 tempah = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x00);
9534 if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD)) {
9537 tempcl = pVBInfo->ModeType;
9546 if (pVBInfo->VBInfo & SetInSlaveMode)
9552 if ( pVBInfo->VBInfo & DisableCRT2Display )
9557 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port , 0x00 , tempah ) ;
9558 if ( pVBInfo->VBInfo & ( SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD ) )
9560 tempcl = pVBInfo->ModeType ;
9577 if ( pVBInfo->VBInfo & SetInSlaveMode )
9584 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part1Port, 0x00, tempah);
9588 if (pVBInfo->VBInfo & DisableCRT2Display)
9589 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2e, tempbl,
9595 if (pVBInfo->
9598 if ((pVBInfo->VBInfo & SetCRT2ToLCDA)
9599 && (!(pVBInfo->VBInfo & SetSimuScanMode))) {
9602 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2e,
9606 if (pVBInfo->VBInfo & SetCRT2ToLCDA) {
9611 if (pVBInfo->
9616 if (!(pVBInfo->VBInfo & SetInSlaveMode))
9619 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) {
9621 if (!(pVBInfo->VBInfo & SetCRT2ToLCD))
9625 if (!(pVBInfo->VBInfo & SetCRT2ToDualEdge))
9627 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2e,
9631 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2e,
9636 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2e, tempbl,
9640 if (pVBInfo->
9644 if ((pVBInfo->ModeType == ModeVGA)
9645 && (!(pVBInfo->VBInfo & SetInSlaveMode))) {
9650 if (pVBInfo->VBInfo & SetCRT2ToTV) {
9651 /* if ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) */
9655 if (pVBInfo->VBInfo & DriverMode)
9661 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x0D, ~0x0BF,
9665 if (pVBInfo->LCDInfo & SetLCDDualLink)
9668 if (pVBInfo->VBInfo & SetCRT2ToTV) {
9669 /* if ( ( !( pVBInfo->VBInfo & SetCRT2ToHiVisionTV ) ) && ( !( pVBInfo->TVInfo & ( SetYPbPrMode525p | SetYPbPrMode750p ) ) ) ) */
9671 if (pVBInfo->TVInfo & RPLLDIV2XO)
9676 if ((pVBInfo->LCDResInfo == Panel1280x1024)
9677 || (pVBInfo->LCDResInfo == Panel1280x1024x75))
9680 if (pVBInfo->LCDResInfo == Panel1280x960)
9683 XGI_SetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x0C, tempah);
9686 if (pVBInfo->
9692 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) {
9694 if (pVBInfo->VBInfo & SetCRT2ToLCDA)
9698 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x13, tempbl,
9702 if (!(pVBInfo->VBInfo & DisableCRT2Display)) {
9703 if (pVBInfo->VBInfo & SetCRT2ToDualEdge)
9707 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2c, tempbl,
9712 if (!(pVBInfo->VBInfo & DisableCRT2Display)) {
9713 if (pVBInfo->VBInfo & SetCRT2ToDualEdge)
9716 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x21, tempbl,
9722 if (!(pVBInfo->VBInfo & SetCRT2ToLCDA)) {
9724 if (!(pVBInfo->VBInfo & SetCRT2ToDualEdge))
9728 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x23, tempbl, tempah);
9730 if (pVBInfo->VBType & (VB_XGI302LV | VB_XGI301C)) {
9731 if (pVBInfo->LCDInfo & SetLCDDualLink) {
9732 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x27, 0x20);
9733 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->Part4Port, 0x34, 0x10);
9747 USHORT RefreshRateTableIndex, PVB_DEVICE_INFO pVBInfo)
9754 pVBInfo->RVBHCMAX = 1;
9755 pVBInfo->RVBHCFACT = 1;
9758 const USHORT StandTableIndex = XGI_GetModePtr(pVBInfo->SModeIDTable,
9759 pVBInfo->ModeType,
9762 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
9763 tempax = pVBInfo->StandTable[StandTableIndex].CRTC[0];
9764 tempbx = pVBInfo->StandTable[StandTableIndex].CRTC[6];
9765 temp1 = pVBInfo->StandTable[StandTableIndex].CRTC[7];
9768 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
9769 CRT1Index = pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
9771 temp1 = (USHORT) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[0];
9772 temp2 = (USHORT) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[5];
9774 tempbx = (USHORT) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[8];
9775 tempcx = (USHORT) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[14] << 8;
9779 temp1 = (USHORT) pVBInfo->XGINEWUB_CRT1Table[CRT1Index].CR[9];
9794 pVBInfo->VGAHT = tempax;
9795 pVBInfo->HT = tempax;
9797 pVBInfo->VGAVT = tempbx;
9798 pVBInfo->VT = tempbx;
9811 const VB_DEVICE_INFO *pVBInfo)
9818 modeflag = pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag;
9821 modeflag = pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
9841 XGI_UnLockCRT2(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
9844 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2f, 0xFF, 0x01);
9856 XGI_LockCRT2(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
9858 XGI_SetRegANDOR((XGIIOADDRESS) pVBInfo->Part1Port, 0x2F, 0xFE, 0x00);
9869 XGINew_EnableCRT2(PVB_DEVICE_INFO pVBInfo)
9871 XGI_SetRegOR((XGIIOADDRESS) pVBInfo->P3c4, 0x1E, SR1E_ENABLE_CRT2);
9883 XGINew_LCD_Wait_Time(UCHAR DelayTime, PVB_DEVICE_INFO pVBInfo)
9920 XGI_BridgeIsOn(PVB_DEVICE_INFO pVBInfo)
9925 if ( pVBInfo->IF_DEF_LVDS == 1 )
9931 flag = XGI_GetReg((XGIIOADDRESS) pVBInfo->Part4Port, 0x00);
9947 XGI_VBLongWait(PVB_DEVICE_INFO pVBInfo)
9951 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) {
9955 tempal = XGI_GetRegByte((XGIIOADDRESS) pVBInfo->P3da);
9979 XGI_WaitEndRetrace(pVBInfo->RelIO);
9994 XGI_GetVGAHT2(PVB_DEVICE_INFO pVBInfo)
9999 ((pVBInfo->VGAVT - pVBInfo->VGAVDE) * pVBInfo->RVBHCMAX) & 0xFFFF;
10000 tempax = (pVBInfo->VT - pVBInfo->VDE) * pVBInfo->RVBHCFACT;
10001 tempax = (tempax * pVBInfo->HT) / tempbx;
10017 PVB_DEVICE_INFO pVBInfo)
10034 ? pVBInfo->SModeIDTable[ModeIdIndex].St_ModeFlag
10035 : pVBInfo->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
10038 if ( pVBInfo->IF_DEF_LVDS == 0 )
10042 if (((pVBInfo->VBInfo & SetCRT2ToLCD) | SetCRT2ToLCDA)) { /*301b */
10043 VCLKIndex = (pVBInfo->LCDResInfo != Panel1024x768)
10048 if (pVBInfo->VBInfo & SetCRT2ToTV) /* for TV */
10050 if (pVBInfo->VBInfo & SetCRT2ToHiVisionTV)
10052 VCLKIndex = (pVBInfo->SetFlag & RPLLDIV2XO)
10057 if (pVBInfo->SetFlag & TVSimuMode) {
10064 if (pVBInfo->VBType & VB_XGI301LV) {
10065 switch (pVBInfo->VBExtInfo) {
10076 VCLKIndex = (pVBInfo->SetFlag & RPLLDIV2XO)
10083 VCLKIndex = (pVBInfo->SetFlag & RPLLDIV2XO)
10091 VCLKIndex = XGI_GetRegByte((XGIIOADDRESS) (pVBInfo->P3ca + 0x02));
10095 (pVBInfo->RefIndex[RefreshRateTableIndex].Ext_CRTVCLK
10108 if ( pVBInfo->IF_DEF_CH7005 == 1 )
10110 if ( !( pVBInfo->VBInfo & SetCRT2ToLCD ) )
10115 if ( pVBInfo->VBInfo & SetPALTV )
10118 if ( pVBInfo->VBInfo & SetCHTVOverScan )
10124 CHTVVCLKPtr = pVBInfo->CHTVVCLKUNTSC ;
10127 CHTVVCLKPtr = pVBInfo->CHTVVCLKONTSC ;
10130 CHTVVCLKPtr = pVBInfo->CHTVVCLKUPAL ;
10133 CHTVVCLKPtr = pVBInfo->CHTVVCLKOPAL ;
10145 if ( ( pVBInfo->LCDResInfo == Panel800x600 ) || ( pVBInfo->LCDResInfo == Panel320x480 ) )
10147 else if ( ( pVBInfo->LCDResInfo == Panel1024x768 ) || ( pVBInfo->LCDResInfo == Panel1024x768x75 ) )
10158 void XGIInitMiscVBInfo(PXGI_HW_DEVICE_INFO HwDeviceExtension, PVB_DEVICE_INFO pVBInfo)
10161 pVBInfo->ROMAddr = HwDeviceExtension->pjVirtualRomBase ;
10162 pVBInfo->BaseAddr = ( ULONG )HwDeviceExtension->pjIOAddress ;
10164 pVBInfo->P3c4 = pVBInfo->BaseAddr + 0x14 ;
10165 pVBInfo->P3d4 = pVBInfo->BaseAddr + 0x24 ;
10166 pVBInfo->P3c0 = pVBInfo->BaseAddr + 0x10 ;
10167 pVBInfo->P3ce = pVBInfo->BaseAddr + 0x1e ;
10168 pVBInfo->P3c2 = pVBInfo->BaseAddr + 0x12 ;
10169 pVBInfo->P3cc = pVBInfo->BaseAddr + 0x1C ;
10170 pVBInfo->P3ca = pVBInfo->BaseAddr + 0x1a ;
10171 pVBInfo->P3c6 = pVBInfo->BaseAddr + 0x16 ;
10172 pVBInfo->P3c7 = pVBInfo->BaseAddr + 0x17 ;
10173 pVBInfo->P3c8 = pVBInfo->BaseAddr + 0x18 ;
10174 pVBInfo->P3c9 = pVBInfo->BaseAddr + 0x19 ;
10175 pVBInfo->P3da = pVBInfo->BaseAddr + 0x2A ;
10177 pVBInfo->Part0Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_00 ;
10178 pVBInfo->Part1Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_04 ;
10179 pVBInfo->Part2Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_10 ;
10180 pVBInfo->Part3Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_12 ;
10181 pVBInfo->Part4Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 ;
10182 pVBInfo->Part5Port = pVBInfo->BaseAddr + XGI_CRT2_PORT_14 + 2 ;
10184 pVBInfo->IF_DEF_LVDS = 0 ;
10185 pVBInfo->IF_DEF_CH7005 = 0 ;
10186 pVBInfo->IF_DEF_LCDA = 1 ;
10187 pVBInfo->IF_DEF_CH7017 = 0 ;
10188 pVBInfo->IF_DEF_CH7007 = 0 ; /* [Billy] 2007/05/14 */
10189 pVBInfo->IF_DEF_VideoCapture = 0 ;
10190 pVBInfo->IF_DEF_ScaleLCD = 0 ;
10191 pVBInfo->IF_DEF_OEMUtil = 0 ;
10192 pVBInfo->IF_DEF_PWD = 0 ;
10197 pVBInfo->IF_DEF_YPbPr = 0 ;
10198 pVBInfo->IF_DEF_HiVision = 0 ;
10199 pVBInfo->IF_DEF_CRT2Monitor = 0 ;
10203 pVBInfo->IF_DEF_YPbPr = 1 ;
10204 pVBInfo->IF_DEF_HiVision = 1 ;
10205 pVBInfo->IF_DEF_CRT2Monitor = 1 ;
10209 pVBInfo->IF_DEF_YPbPr = 1 ;
10210 pVBInfo->IF_DEF_HiVision = 1 ;
10211 pVBInfo->IF_DEF_CRT2Monitor = 0 ;
10216 if ( ( XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x38 ) & 0xE0 ) == 0xC0 )
10218 pVBInfo->IF_DEF_LVDS = 1 ;
10221 if ( (XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4, 0x38) >> 5 & 0x07) == 0x03 ) /*CH7007 CR38 D[7-5]=011b*/
10223 pVBInfo->IF_DEF_CH7007 = 1 ;
10225 XGI_SetReg((XGIIOADDRESS) pVBInfo->P3c4, 0x30, 0x09); /* For if (pHWDE->bVGAEnabled)== 0 */
10235 if ( ( XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x38 ) & 0xE0 ) == 0xC0 )
10237 if ( XGI_GetReg((XGIIOADDRESS) pVBInfo->P3d4 , 0x30 ) & 0x20 )
10239 pVBInfo->IF_DEF_LVDS = 1 ;