Lines Matching defs:XGI_Pr

277 XGI_New_DisplayOn(VB_DEVICE_INFO *XGI_Pr)
279 XGI_SetRegAND(XGI_Pr->P3c4,0x01,0xDF);
283 XGI_New_DisplayOff(VB_DEVICE_INFO *XGI_Pr)
285 XGI_SetRegOR(XGI_Pr->P3c4,0x01,0x20);
293 XGIInitPCIetc(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo)
302 XGI_SetReg(XGI_Pr->P3c4,0x20,0xa1);
309 XGI_SetRegOR(XGI_Pr->P3c4, 0x1E,
319 inXGIIDXREG(XGI_Pr->P3c4, 0x3A, bForce) ;
323 XGI_SetRegAND(XGI_Pr->P3c4,0x1E,0xBF);
335 XGI_New_GetVBType(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo)
339 XGI_Pr->VBType = 0;
341 flag = XGI_GetReg(XGI_Pr->Part4Port,0x00);
345 rev = XGI_GetReg(XGI_Pr->Part4Port,0x01);
349 XGI_Pr->VBType = VB_XGI302B;
352 XGI_Pr->VBType = VB_XGI301C;
354 XGI_Pr->VBType = VB_XGI301B;
356 nolcd = XGI_GetReg(XGI_Pr->Part4Port,0x23);
357 if(!(nolcd & 0x02)) XGI_Pr->VBType |= VB_NoLCD;
359 XGI_Pr->VBType = VB_XGI301;
362 if(XGI_Pr->VBType & (VB_XGI301B | VB_XGI301C | VB_XGI302B)) {
364 flag = XGI_GetReg(XGI_Pr->Part4Port,0x39);
365 if(flag == 0xff) XGI_Pr->VBType = VB_XGI302LV;
366 else XGI_Pr->VBType = VB_XGI302ELV;
368 XGI_Pr->VBType = VB_XGI301LV;
371 PDEBUG(ErrorF("GetVBType: XGI_Pr->VBType=%x \n",XGI_Pr->VBType)); //yilin
444 XGI_DoLowModeTest(VB_DEVICE_INFO *XGI_Pr, USHORT ModeNo, PXGI_HW_DEVICE_INFO HwInfo)
450 temp = XGI_GetReg(XGI_Pr->P3d4,0x11);
451 XGI_SetRegOR(XGI_Pr->P3d4,0x11,0x80);
452 temp1 = XGI_GetReg(XGI_Pr->P3d4,0x00);
453 XGI_SetReg(XGI_Pr->P3d4,0x00,0x55);
454 temp2 = XGI_GetReg(XGI_Pr->P3d4,0x00);
455 XGI_SetReg(XGI_Pr->P3d4,0x00,temp1);
456 XGI_SetReg(XGI_Pr->P3d4,0x11,temp);
464 XGI_SetLowModeTest(VB_DEVICE_INFO *XGI_Pr, USHORT ModeNo, PXGI_HW_DEVICE_INFO HwInfo)
466 if(XGI_DoLowModeTest(XGI_Pr, ModeNo, HwInfo)) {
467 XGI_Pr->SetFlag |= LowModeTests;
472 XGI_HandleCRT1(VB_DEVICE_INFO *XGI_Pr)
474 XGI_SetRegAND(XGI_Pr->P3d4, 0x53, 0xbf);
482 XGI_New_GetOffset(VB_DEVICE_INFO *XGI_Pr,USHORT ModeNo,USHORT ModeIdIndex,
487 infoflag = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
488 xres = XGI_Pr->RefIndex[RefreshRateTableIndex].XRes;
490 colordepth = XGI_GetColorDepth(ModeNo, ModeIdIndex, XGI_Pr);
508 XGI_ResetCRT1VCLK(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo)
510 XGI_SetRegANDOR(XGI_Pr->P3c4,0x31,0xCF,0x20);
511 XGI_SetReg(XGI_Pr->P3c4,0x2B,XGI_Pr->VCLKData[1].SR2B);
512 XGI_SetReg(XGI_Pr->P3c4,0x2C,XGI_Pr->VCLKData[1].SR2C);
513 XGI_SetReg(XGI_Pr->P3c4,0x2D,0x80);
514 XGI_SetRegANDOR(XGI_Pr->P3c4,0x31,0xcf,0x10);
515 XGI_SetReg(XGI_Pr->P3c4,0x2B,XGI_Pr->VCLKData[0].SR2B);
516 XGI_SetReg(XGI_Pr->P3c4,0x2C,XGI_Pr->VCLKData[0].SR2C);
517 XGI_SetReg(XGI_Pr->P3c4,0x2D,0x80);
525 XGI_New_SetCRT1CRTC(VB_DEVICE_INFO *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex,
532 XGI_SetRegAND(XGI_Pr->P3d4,0x11,0x7f); /* unlock cr0-7 */
535 modeflag = XGI_Pr->SModeIDTable[ModeIdIndex].St_ModeFlag;
537 modeflag = XGI_Pr->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
540 index = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_CRT1CRTC;
543 XGI_SetReg(XGI_Pr->P3d4,j,XGI_Pr->XGINEWUB_CRT1Table[index].CR[i]);
546 XGI_SetReg(XGI_Pr->P3d4,j,XGI_Pr->XGINEWUB_CRT1Table[index].CR[i]);
549 XGI_SetReg(XGI_Pr->P3d4,j,XGI_Pr->XGINEWUB_CRT1Table[index].CR[i]);
552 XGI_SetReg(XGI_Pr->P3c4,j,XGI_Pr->XGINEWUB_CRT1Table[index].CR[i]);
555 temp = XGI_Pr->XGINEWUB_CRT1Table[index].CR[16] & 0xE0;
556 XGI_SetReg(XGI_Pr->P3c4,0x0E,temp);
558 temp = ((XGI_Pr->XGINEWUB_CRT1Table[index].CR[16]) & 0x01) << 5;
560 XGI_SetRegANDOR(XGI_Pr->P3d4,0x09,0x5F,temp);
562 if(XGI_Pr->ModeType > ModeVGA) XGI_SetReg(XGI_Pr->P3d4,0x14,0x4F);
572 XGI_New_SetCRT1Offset(VB_DEVICE_INFO *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex,
578 infoflag = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
580 DisplayUnit = XGI_New_GetOffset(XGI_Pr,ModeNo,ModeIdIndex,
584 XGI_SetRegANDOR(XGI_Pr->P3c4,0x0E,0xF0,temp);
587 XGI_SetReg(XGI_Pr->P3d4,0x13,temp);
595 XGI_SetReg(XGI_Pr->P3c4,0x10,temp);
603 XGI_New_SetCRT1VCLK(VB_DEVICE_INFO *XGI_Pr, USHORT ModeNo, USHORT ModeIdIndex,
608 if((XGI_Pr->VBType & VB_XGI301BLV302BLV) && (XGI_Pr->VBInfo & SetCRT2ToLCDA)) {
609 clka = XGI_Pr->VBVCLKData[index].Part4_A;
610 clkb = XGI_Pr->VBVCLKData[index].Part4_B;
612 clka = XGI_Pr->VCLKData[index].SR2B;
613 clkb = XGI_Pr->VCLKData[index].SR2C;
616 XGI_SetRegAND(XGI_Pr->P3c4,0x31,0xCF);
617 XGI_SetReg(XGI_Pr->P3c4,0x2B,clka);
618 XGI_SetReg(XGI_Pr->P3c4,0x2C,clkb);
619 XGI_SetReg(XGI_Pr->P3c4,0x2D,0x01);
627 XGI_New_SetVCLKState(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,
634 VCLK = XGI_Pr->VCLKData[index].CLOCK;
640 XGI_SetRegANDOR(XGI_Pr->P3c4,0x32,0xf3,data);
643 XGI_SetRegAND(XGI_Pr->P3c4,0x1f,0xe7);
647 XGI_SetRegANDOR(XGI_Pr->P3c4,0x07,0xE8,0x10);
651 XGI_New_SetCRT1ModeRegs(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,
658 modeflag = XGI_Pr->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
659 infoflag = XGI_Pr->RefIndex[RefreshRateTableIndex].Ext_InfoFlag;
660 xres = XGI_Pr->ModeResInfo[resindex].HTotal;
662 modeflag = XGI_Pr->SModeIDTable[ModeIdIndex].St_ModeFlag;
663 xres = XGI_Pr->StResInfo[resindex].HTotal;
667 XGI_SetRegAND(XGI_Pr->P3c4,0x1F,0x3F);
671 if(XGI_Pr->ModeType > 0x02) {
673 data |= ((XGI_Pr->ModeType - ModeVGA) << 2);
677 XGI_SetRegANDOR(XGI_Pr->P3c4,0x06,0xC0,data);
685 XGI_SetReg(XGI_Pr->P3d4,0x19,(data & 0xFF));
686 XGI_SetRegANDOR(XGI_Pr->P3d4,0x1a,0xFC,(data >> 8));
689 XGI_SetRegOR(XGI_Pr->P3c4,0x01,0x08);
695 XGI_SetRegANDOR(XGI_Pr->P3c4,0x0F,0xB7,data);
696 if(XGI_Pr->ModeType == ModeEGA) {
698 XGI_SetRegOR(XGI_Pr->P3c4,0x0F,0x40);
702 XGI_SetRegAND(XGI_Pr->P3c4,0x31,0xfb);
705 if(XGI_Pr->ModeType != ModeText) {
707 if(XGI_Pr->ModeType != ModeEGA) {
711 XGI_SetRegANDOR(XGI_Pr->P3c4,0x21,0x1F,data);
713 XGI_New_SetVCLKState(XGI_Pr, HwInfo, ModeNo, RefreshRateTableIndex, ModeIdIndex);
726 XGI_New_LoadDAC(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,
737 data = XGI_Pr->SModeIDTable[ModeIdIndex].St_ModeFlag;
739 data = XGI_Pr->EModeIDTable[ModeIdIndex].Ext_ModeFlag;
754 if( ( (XGI_Pr->VBInfo & SetCRT2ToLCD) && /* 301B-DH LCD */
755 (XGI_Pr->VBType & VB_NoLCD) ) ||
756 (XGI_Pr->VBInfo & SetCRT2ToLCDA) || /* LCDA */
757 (!(XGI_Pr->SetFlag & ProgrammingCRT2)) ) { /* Programming CRT1 */
758 DACAddr = XGI_Pr->P3c8;
759 DACData = XGI_Pr->P3c9;
761 XGI_SetRegByte(XGI_Pr->P3c6,0xFF);
764 DACAddr = XGI_Pr->Part5Port;
765 DACData = XGI_Pr->Part5Port + 1;
821 XGI_New_SetCRT1Group(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,
824 const USHORT StandTableIndex = XGI_GetModePtr(XGI_Pr->SModeIDTable,
825 XGI_Pr->ModeType,
831 if(XGI_Pr->SetFlag & LowModeTests) {
832 if(XGI_Pr->VBInfo & (SetSimuScanMode | SwitchToCRT2)) {
833 XGI_New_DisableBridge(XGI_Pr, HwInfo);
837 XGI_SetSeqRegs(StandTableIndex, XGI_Pr);
838 XGI_SetMiscRegs(StandTableIndex, XGI_Pr);
839 XGI_SetCRTCRegs(StandTableIndex, XGI_Pr);
840 XGI_SetATTRegs(ModeNo, StandTableIndex, ModeIdIndex, XGI_Pr);
841 XGI_SetGRCRegs(StandTableIndex, XGI_Pr);
842 XGI_ClearExt1Regs(ModeNo, XGI_Pr);
843 XGI_ResetCRT1VCLK(XGI_Pr, HwInfo);
845 XGI_Pr->SetFlag &= (~ProgrammingCRT2);
849 XGI_Pr->VBType, XGI_Pr->VBInfo);
852 if(XGI_Pr->VBInfo & SetSimuScanMode) {
853 if(XGI_Pr->VBInfo & SetInSlaveMode) {
854 XGI_Pr->SetFlag |= ProgrammingCRT2;
858 if(XGI_Pr->VBInfo & SetCRT2ToLCDA) {
859 XGI_Pr->SetFlag |= ProgrammingCRT2;
862 if(!(XGI_Pr->VBInfo & SetCRT2ToLCDA)) {
863 XGI_Pr->SetFlag &= ~ProgrammingCRT2;
867 XGI_SetSync(RefreshRateTableIndex, XGI_Pr);
868 XGI_New_SetCRT1CRTC(XGI_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
869 XGI_New_SetCRT1Offset(XGI_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);
870 XGI_New_SetCRT1VCLK(XGI_Pr, ModeNo, ModeIdIndex, HwInfo, RefreshRateTableIndex);
873 XGI_New_SetCRT1ModeRegs(XGI_Pr, HwInfo, ModeNo, ModeIdIndex, RefreshRateTableIndex);
875 XGI_New_LoadDAC(XGI_Pr, HwInfo, ModeNo, ModeIdIndex);
885 XGI_SetPitchCRT1(VB_DEVICE_INFO *XGI_Pr, ScrnInfoPtr pScrn)
890 XGI_SetReg(XGI_Pr->P3d4,0x13,(HDisplay & 0xFF));
891 XGI_SetRegANDOR(XGI_Pr->P3c4,0x0E,0xF0,(HDisplay>>8));
902 XGIBIOSSetMode(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,
960 SetModeRet = XGISetModeNew(HwInfo, XGI_Pr, ModeNo);
967 XGI_SetReg(XGI_Pr->Part1Port, 0x2f, 1); //yilin for crt2pitch it shoude modify if not colone mode
968 XGI_SetReg(XGI_Pr->Part1Port, 0x07, (HDisplay & 0xFF));
969 XGI_SetRegANDOR(XGI_Pr->Part1Port, 0x09, 0xF0, (HDisplay>>8));
973 XGI_SetReg(XGI_Pr->P3d4,0x13,(HDisplay & 0xFF));
974 XGI_SetRegANDOR(XGI_Pr->P3c4,0x0E,0xF0,(HDisplay>>8));
976 XGI_SetReg(XGI_Pr->P3d4,0x13,(HDisplay & 0xFF));
977 XGI_SetRegANDOR(XGI_Pr->P3c4,0x0E,0xF0,(HDisplay>>8)); */
989 XGIBIOSSetModeCRT1(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo,
1011 XGIInitPCIetc(XGI_Pr, HwInfo);
1013 XGI_SetReg(XGI_Pr->P3c4,0x05,0x86);
1015 if (!XGI_SearchModeID(XGI_Pr->SModeIDTable, XGI_Pr->EModeIDTable,
1021 XGI_New_GetVBType(XGI_Pr, HwInfo);
1023 if (XGI_Pr->VBType & VB_XGI301BLV302BLV) {
1024 backupreg = XGI_GetReg(XGI_Pr->P3d4,0x38);
1029 XGI_SetLowModeTest(XGI_Pr, ModeNo, HwInfo);
1032 XGI_New_SetCRT1Group(XGI_Pr, HwInfo, ModeNo, ModeIdIndex);
1034 XGI_SetPitchCRT1(XGI_Pr, pScrn);
1042 backupcr30 = XGI_GetReg(XGI_Pr->P3d4,0x30);
1043 backupcr31 = XGI_GetReg(XGI_Pr->P3d4,0x31);
1044 backupcr35 = XGI_GetReg(XGI_Pr->P3d4,0x35);
1045 backupcr38 = XGI_GetReg(XGI_Pr->P3d4,0x38);
1046 if(XGI_Pr->VBType & VB_XGIVB) {
1049 backupp40d = XGI_GetReg(XGI_Pr->Part4Port,0x0d) & 0x08;
1052 if(XGI_Pr->VBInfo & SetCRT2ToLCDA) {
1053 XGI_SetReg(XGI_Pr->P3d4,0x30,pXGIEnt->CRT2CR30);
1054 XGI_SetReg(XGI_Pr->P3d4,0x31,pXGIEnt->CRT2CR31);
1055 XGI_SetReg(XGI_Pr->P3d4,0x35,pXGIEnt->CRT2CR35);
1056 XGI_SetReg(XGI_Pr->P3d4,0x38,pXGIEnt->CRT2CR38);
1059 XGI_SetReg(XGI_Pr->P3d4,0x30,backupcr30);
1060 XGI_SetReg(XGI_Pr->P3d4,0x31,backupcr31);
1061 XGI_SetReg(XGI_Pr->P3d4,0x35,backupcr35);
1062 XGI_SetReg(XGI_Pr->P3d4,0x38,backupcr38);
1063 if(XGI_Pr->VBType & VB_XGIVB) {
1064 XGI_SetRegANDOR(XGI_Pr->Part4Port,0x0d, ~0x08, backupp40d);
1069 /* Warning: From here, the custom mode entries in XGI_Pr are
1073 XGI_HandleCRT1(XGI_Pr);
1075 XGI_New_DisplayOn(XGI_Pr);
1076 XGI_SetRegByte(XGI_Pr->P3c6,0xFF);