Searched refs:pVBInfo (Results 1 - 2 of 2) sorted by relevance

/linux-4.4.14/drivers/staging/xgifb/
H A Dvb_setmode.c25 void InitTo330Pointer(unsigned char ChipType, struct vb_device_info *pVBInfo) InitTo330Pointer() argument
27 pVBInfo->MCLKData = XGI340New_MCLKData; InitTo330Pointer()
29 pVBInfo->LCDResInfo = 0; InitTo330Pointer()
30 pVBInfo->LCDTypeInfo = 0; InitTo330Pointer()
31 pVBInfo->LCDInfo = 0; InitTo330Pointer()
32 pVBInfo->VBInfo = 0; InitTo330Pointer()
33 pVBInfo->TVInfo = 0; InitTo330Pointer()
35 pVBInfo->SR18 = XGI340_SR18; InitTo330Pointer()
36 pVBInfo->CR40 = XGI340_cr41; InitTo330Pointer()
39 XGI_GetVBType(pVBInfo); InitTo330Pointer()
42 if ((pVBInfo->VBType & VB_SIS301LV) || (pVBInfo->VBType & VB_SIS302LV)) InitTo330Pointer()
43 pVBInfo->LCDCapList = XGI_LCDDLCapList; InitTo330Pointer()
45 pVBInfo->LCDCapList = XGI_LCDCapList; InitTo330Pointer()
48 pVBInfo->XGINew_CR97 = 0x10; InitTo330Pointer()
53 pVBInfo->MCLKData = XGI27New_MCLKData; InitTo330Pointer()
54 pVBInfo->CR40 = XGI27_cr41; InitTo330Pointer()
55 pVBInfo->XGINew_CR97 = 0xc1; InitTo330Pointer()
56 pVBInfo->SR18 = XG27_SR18; InitTo330Pointer()
59 temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B); InitTo330Pointer()
62 pVBInfo->XGINew_CR97 = 0x80; InitTo330Pointer()
67 static void XGI_SetSeqRegs(struct vb_device_info *pVBInfo) XGI_SetSeqRegs() argument
71 xgifb_reg_set(pVBInfo->P3c4, 0x00, 0x03); /* Set SR0 */ XGI_SetSeqRegs()
77 xgifb_reg_set(pVBInfo->P3c4, i+1, SRdata); /* Set SR 1 2 3 4 */ XGI_SetSeqRegs()
81 static void XGI_SetCRTCRegs(struct vb_device_info *pVBInfo) XGI_SetCRTCRegs() argument
86 CRTCdata = xgifb_reg_get(pVBInfo->P3d4, 0x11); XGI_SetCRTCRegs()
88 xgifb_reg_set(pVBInfo->P3d4, 0x11, CRTCdata); /* Unlock CRTC */ XGI_SetCRTCRegs()
93 xgifb_reg_set(pVBInfo->P3d4, i, CRTCdata); /* Set CRTC(3d4) */ XGI_SetCRTCRegs()
98 struct vb_device_info *pVBInfo) XGI_SetATTRegs()
109 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { XGI_SetATTRegs()
111 } else if ((pVBInfo->VBInfo & XGI_SetATTRegs()
113 (pVBInfo->VBInfo & SetInSlaveMode)) { XGI_SetATTRegs()
118 inb(pVBInfo->P3da); /* reset 3da */ XGI_SetATTRegs()
119 outb(i, pVBInfo->P3c0); /* set index */ XGI_SetATTRegs()
120 outb(ARdata, pVBInfo->P3c0); /* set data */ XGI_SetATTRegs()
123 inb(pVBInfo->P3da); /* reset 3da */ XGI_SetATTRegs()
124 outb(0x14, pVBInfo->P3c0); /* set index */ XGI_SetATTRegs()
125 outb(0x00, pVBInfo->P3c0); /* set data */ XGI_SetATTRegs()
126 inb(pVBInfo->P3da); /* Enable Attribute */ XGI_SetATTRegs()
127 outb(0x20, pVBInfo->P3c0); XGI_SetATTRegs()
130 static void XGI_SetGRCRegs(struct vb_device_info *pVBInfo) XGI_SetGRCRegs() argument
138 xgifb_reg_set(pVBInfo->P3ce, i, GRdata); /* Set GR(3ce) */ XGI_SetGRCRegs()
141 if (pVBInfo->ModeType > ModeVGA) { XGI_SetGRCRegs()
142 GRdata = xgifb_reg_get(pVBInfo->P3ce, 0x05); XGI_SetGRCRegs()
144 xgifb_reg_set(pVBInfo->P3ce, 0x05, GRdata); XGI_SetGRCRegs()
148 static void XGI_ClearExt1Regs(struct vb_device_info *pVBInfo) XGI_ClearExt1Regs() argument
153 xgifb_reg_set(pVBInfo->P3c4, i, 0x00); /* Clear SR0A-SR0E */ XGI_ClearExt1Regs()
156 static unsigned char XGI_SetDefaultVCLK(struct vb_device_info *pVBInfo) XGI_SetDefaultVCLK() argument
159 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x20); XGI_SetDefaultVCLK()
160 xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[0].SR2B); XGI_SetDefaultVCLK()
161 xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[0].SR2C); XGI_SetDefaultVCLK()
163 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, 0x10); XGI_SetDefaultVCLK()
164 xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[1].SR2B); XGI_SetDefaultVCLK()
165 xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[1].SR2C); XGI_SetDefaultVCLK()
167 xgifb_reg_and(pVBInfo->P3c4, 0x31, ~0x30); XGI_SetDefaultVCLK()
173 struct vb_device_info *pVBInfo) XGI_AjustCRT2Rate()
182 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) { XGI_AjustCRT2Rate()
185 if (pVBInfo->VBType & VB_XGI301C) XGI_AjustCRT2Rate()
190 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { XGI_AjustCRT2Rate()
193 if (pVBInfo->LCDResInfo != Panel_1280x1024 && XGI_AjustCRT2Rate()
194 pVBInfo->LCDResInfo != Panel_1280x960 && XGI_AjustCRT2Rate()
195 (pVBInfo->LCDInfo & LCDNonExpanding) && XGI_AjustCRT2Rate()
200 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { /* for HiTV */ XGI_AjustCRT2Rate()
202 if ((pVBInfo->VBInfo & SetInSlaveMode) && XGI_AjustCRT2Rate()
204 (resinfo == 3 && (pVBInfo->SetFlag & TVSimuMode)) || XGI_AjustCRT2Rate()
207 } else if (pVBInfo->VBInfo & (SetCRT2ToAVIDEO | SetCRT2ToSVIDEO | XGI_AjustCRT2Rate()
212 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV | XGI_AjustCRT2Rate()
216 if (!(pVBInfo->VBInfo & TVSetPAL) && XGI_AjustCRT2Rate()
218 (pVBInfo->VBInfo & SetInSlaveMode) && XGI_AjustCRT2Rate()
219 (!(pVBInfo->VBInfo & SetNotSimuMode))) XGI_AjustCRT2Rate()
249 struct vb_device_info *pVBInfo) XGI_SetSync()
258 outb(temp, pVBInfo->P3c2); /* Set Misc(3c2) */ XGI_SetSync()
261 static void XGI_SetCRT1Timing_H(struct vb_device_info *pVBInfo, XGI_SetCRT1Timing_H() argument
268 data = xgifb_reg_get(pVBInfo->P3d4, 0x11); XGI_SetCRT1Timing_H()
270 xgifb_reg_set(pVBInfo->P3d4, 0x11, data); XGI_SetCRT1Timing_H()
272 data = pVBInfo->TimingH.data[0]; XGI_SetCRT1Timing_H()
273 xgifb_reg_set(pVBInfo->P3d4, 0, data); XGI_SetCRT1Timing_H()
276 data = pVBInfo->TimingH.data[i]; XGI_SetCRT1Timing_H()
277 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 1), data); XGI_SetCRT1Timing_H()
281 data = pVBInfo->TimingH.data[i]; XGI_SetCRT1Timing_H()
282 xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i + 6), data); XGI_SetCRT1Timing_H()
285 j = xgifb_reg_get(pVBInfo->P3c4, 0x0e); XGI_SetCRT1Timing_H()
287 data = pVBInfo->TimingH.data[7]; XGI_SetCRT1Timing_H()
290 xgifb_reg_set(pVBInfo->P3c4, 0x0e, data); XGI_SetCRT1Timing_H()
293 data = xgifb_reg_get(pVBInfo->P3d4, 0x04); XGI_SetCRT1Timing_H()
295 xgifb_reg_set(pVBInfo->P3d4, 0x04, data); XGI_SetCRT1Timing_H()
296 data = xgifb_reg_get(pVBInfo->P3d4, 0x05); XGI_SetCRT1Timing_H()
302 data = xgifb_reg_get(pVBInfo->P3c4, 0x0c); XGI_SetCRT1Timing_H()
304 xgifb_reg_set(pVBInfo->P3c4, 0x0c, data); XGI_SetCRT1Timing_H()
309 xgifb_reg_set(pVBInfo->P3d4, 0x05, data); XGI_SetCRT1Timing_H()
310 data = xgifb_reg_get(pVBInfo->P3c4, 0x0e); XGI_SetCRT1Timing_H()
316 xgifb_reg_and_or(pVBInfo->P3c4, 0x0e, ~0xE0, data); XGI_SetCRT1Timing_H()
321 struct vb_device_info *pVBInfo) XGI_SetCRT1Timing_V()
327 data = pVBInfo->TimingV.data[i]; XGI_SetCRT1Timing_V()
328 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 6), data); XGI_SetCRT1Timing_V()
332 data = pVBInfo->TimingV.data[i]; XGI_SetCRT1Timing_V()
333 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x0e), data); XGI_SetCRT1Timing_V()
337 data = pVBInfo->TimingV.data[i]; XGI_SetCRT1Timing_V()
338 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 0x11), data); XGI_SetCRT1Timing_V()
341 j = xgifb_reg_get(pVBInfo->P3c4, 0x0a); XGI_SetCRT1Timing_V()
343 data = pVBInfo->TimingV.data[6]; XGI_SetCRT1Timing_V()
346 xgifb_reg_set(pVBInfo->P3c4, 0x0a, data); XGI_SetCRT1Timing_V()
348 data = pVBInfo->TimingV.data[6]; XGI_SetCRT1Timing_V()
357 j = xgifb_reg_get(pVBInfo->P3d4, 0x09); XGI_SetCRT1Timing_V()
360 xgifb_reg_set(pVBInfo->P3d4, 0x09, data); XGI_SetCRT1Timing_V()
365 struct vb_device_info *pVBInfo, XGI_SetCRT1CRTC()
375 data = xgifb_reg_get(pVBInfo->P3d4, 0x11); XGI_SetCRT1CRTC()
377 xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ XGI_SetCRT1CRTC()
380 pVBInfo->TimingH.data[i] XGI_SetCRT1CRTC()
384 pVBInfo->TimingV.data[i] XGI_SetCRT1CRTC()
387 XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension); XGI_SetCRT1CRTC()
389 XGI_SetCRT1Timing_V(ModeIdIndex, pVBInfo); XGI_SetCRT1CRTC()
391 if (pVBInfo->ModeType > 0x03) XGI_SetCRT1CRTC()
392 xgifb_reg_set(pVBInfo->P3d4, 0x14, 0x4F); XGI_SetCRT1CRTC()
402 struct vb_device_info *pVBInfo) XGI_SetXG21CRTC()
412 xgifb_reg_set(pVBInfo->P3c4, 0x2E, Tempax); XGI_SetXG21CRTC()
441 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempax); XGI_SetXG21CRTC()
442 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, 0xE3, 00); XGI_SetXG21CRTC()
448 xgifb_reg_or(pVBInfo->P3c4, 0x33, Tempax); /* SR33[0]->VRS[0] */ XGI_SetXG21CRTC()
455 xgifb_reg_set(pVBInfo->P3c4, 0x34, Tempcx); /* SR34[8:1]->VRS */ XGI_SetXG21CRTC()
494 xgifb_reg_set(pVBInfo->P3c4, 0x3F, Tempax); XGI_SetXG21CRTC()
498 struct vb_device_info *pVBInfo) XGI_SetXG27CRTC()
507 xgifb_reg_set(pVBInfo->P3c4, 0x2E, Tempax); XGI_SetXG27CRTC()
537 xgifb_reg_set(pVBInfo->P3c4, 0x2F, Tempax); XGI_SetXG27CRTC()
538 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, 0xE3, 00); XGI_SetXG27CRTC()
543 xgifb_reg_set(pVBInfo->P3c4, 0x34, Tempax); XGI_SetXG27CRTC()
552 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x01, Tempax); XGI_SetXG27CRTC()
578 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, Tempax); XGI_SetXG27CRTC()
581 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x07, Tempax); XGI_SetXG27CRTC()
584 static void XGI_SetXG27FPBits(struct vb_device_info *pVBInfo) XGI_SetXG27FPBits() argument
589 temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); XGI_SetXG27FPBits()
592 xgifb_reg_and_or(pVBInfo->P3c4, 0x06, ~0xc0, temp & 0x80); XGI_SetXG27FPBits()
594 xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); XGI_SetXG27FPBits()
599 struct vb_device_info *pVBInfo, xgifb_set_lcd()
604 xgifb_reg_set(pVBInfo->P3d4, 0x2E, 0x00); xgifb_set_lcd()
605 xgifb_reg_set(pVBInfo->P3d4, 0x2F, 0x00); xgifb_set_lcd()
606 xgifb_reg_set(pVBInfo->P3d4, 0x46, 0x00); xgifb_set_lcd()
607 xgifb_reg_set(pVBInfo->P3d4, 0x47, 0x00); xgifb_set_lcd()
610 temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); xgifb_set_lcd()
612 xgifb_reg_set(pVBInfo->P3d4, 0x46, 0x13); xgifb_set_lcd()
613 xgifb_reg_set(pVBInfo->P3d4, 0x47, 0x13); xgifb_set_lcd()
618 XGI_SetXG27FPBits(pVBInfo); xgifb_set_lcd()
620 temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); xgifb_set_lcd()
623 xgifb_reg_or(pVBInfo->P3c4, 0x06, 0x40); xgifb_set_lcd()
624 xgifb_reg_or(pVBInfo->P3c4, 0x09, 0x40); xgifb_set_lcd()
628 xgifb_reg_or(pVBInfo->P3c4, 0x1E, 0x01); /* Negative blank polarity */ xgifb_set_lcd()
630 xgifb_reg_and(pVBInfo->P3c4, 0x30, ~0x20); /* Hsync polarity */ xgifb_set_lcd()
631 xgifb_reg_and(pVBInfo->P3c4, 0x35, ~0x80); /* Vsync polarity */ xgifb_set_lcd()
636 xgifb_reg_or(pVBInfo->P3c4, 0x30, 0x20); xgifb_set_lcd()
639 xgifb_reg_or(pVBInfo->P3c4, 0x35, 0x80); xgifb_set_lcd()
649 struct vb_device_info *pVBInfo, XGI_UpdateXG21CRTC()
654 xgifb_reg_and(pVBInfo->P3d4, 0x11, 0x7F); /* Unlock CR0~7 */ XGI_UpdateXG21CRTC()
670 xgifb_reg_set(pVBInfo->P3d4, 0x02, XGI_UpdateXG21CRTC()
672 xgifb_reg_set(pVBInfo->P3d4, 0x03, XGI_UpdateXG21CRTC()
674 xgifb_reg_set(pVBInfo->P3d4, 0x15, XGI_UpdateXG21CRTC()
676 xgifb_reg_set(pVBInfo->P3d4, 0x16, XGI_UpdateXG21CRTC()
683 struct vb_device_info *pVBInfo) XGI_SetCRT1DE()
715 temp = xgifb_reg_get(pVBInfo->P3d4, 0x11); XGI_SetCRT1DE()
716 data = xgifb_reg_get(pVBInfo->P3d4, 0x11); XGI_SetCRT1DE()
718 xgifb_reg_set(pVBInfo->P3d4, 0x11, data); /* Unlock CRTC */ XGI_SetCRT1DE()
719 xgifb_reg_set(pVBInfo->P3d4, 0x01, (unsigned short) (tempcx & 0xff)); XGI_SetCRT1DE()
720 xgifb_reg_and_or(pVBInfo->P3d4, 0x0b, ~0x0c, XGI_SetCRT1DE()
722 xgifb_reg_set(pVBInfo->P3d4, 0x12, (unsigned short) (tempbx & 0xff)); XGI_SetCRT1DE()
732 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x42, tempax); XGI_SetCRT1DE()
733 data = xgifb_reg_get(pVBInfo->P3d4, 0x07); XGI_SetCRT1DE()
739 xgifb_reg_and_or(pVBInfo->P3d4, 0x0a, ~0x02, tempax); XGI_SetCRT1DE()
740 xgifb_reg_set(pVBInfo->P3d4, 0x11, temp); XGI_SetCRT1DE()
747 struct vb_device_info *pVBInfo) XGI_SetCRT1Offset()
762 temp2 = pVBInfo->ModeType - ModeEGA; XGI_SetCRT1Offset()
797 i = xgifb_reg_get(pVBInfo->P3c4, 0x0E); XGI_SetCRT1Offset()
800 xgifb_reg_set(pVBInfo->P3c4, 0x0E, i); XGI_SetCRT1Offset()
804 xgifb_reg_set(pVBInfo->P3d4, 0x13, temp); XGI_SetCRT1Offset()
824 xgifb_reg_set(pVBInfo->P3c4, 0x10, ah); XGI_SetCRT1Offset()
829 struct vb_device_info *pVBInfo) XGI_GetVCLK2Ptr()
836 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { /*301b*/ XGI_GetVCLK2Ptr()
837 if (pVBInfo->LCDResInfo != Panel_1024x768) XGI_GetVCLK2Ptr()
842 } else if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_GetVCLK2Ptr()
843 if (pVBInfo->SetFlag & RPLLDIV2XO) XGI_GetVCLK2Ptr()
848 if (pVBInfo->SetFlag & TVSimuMode) { XGI_GetVCLK2Ptr()
856 if (pVBInfo->VBType & VB_SIS301LV) { XGI_GetVCLK2Ptr()
857 if (pVBInfo->SetFlag & RPLLDIV2XO) XGI_GetVCLK2Ptr()
862 } else if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_GetVCLK2Ptr()
863 if (pVBInfo->SetFlag & RPLLDIV2XO) XGI_GetVCLK2Ptr()
879 struct vb_device_info *pVBInfo) XGI_SetCRT1VCLK()
884 if ((pVBInfo->IF_DEF_LVDS == 0) && XGI_SetCRT1VCLK()
885 (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV | XGI_SetCRT1VCLK()
887 (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) { XGI_SetCRT1VCLK()
889 pVBInfo); XGI_SetCRT1VCLK()
890 data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; XGI_SetCRT1VCLK()
891 xgifb_reg_set(pVBInfo->P3c4, 0x31, data); XGI_SetCRT1VCLK()
893 xgifb_reg_set(pVBInfo->P3c4, 0x2B, data); XGI_SetCRT1VCLK()
895 xgifb_reg_set(pVBInfo->P3c4, 0x2C, data); XGI_SetCRT1VCLK()
896 xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01); XGI_SetCRT1VCLK()
899 data = xgifb_reg_get(pVBInfo->P3c4, 0x31) & 0xCF; XGI_SetCRT1VCLK()
900 xgifb_reg_set(pVBInfo->P3c4, 0x31, data); XGI_SetCRT1VCLK()
901 xgifb_reg_set(pVBInfo->P3c4, 0x2B, XGI_VCLKData[index].SR2B); XGI_SetCRT1VCLK()
902 xgifb_reg_set(pVBInfo->P3c4, 0x2C, XGI_VCLKData[index].SR2C); XGI_SetCRT1VCLK()
903 xgifb_reg_set(pVBInfo->P3c4, 0x2D, 0x01); XGI_SetCRT1VCLK()
909 data = xgifb_reg_get(pVBInfo->P3c4, 0x2B); XGI_SetCRT1VCLK()
910 xgifb_reg_set(pVBInfo->P3c4, 0x2B, data); XGI_SetCRT1VCLK()
911 data = xgifb_reg_get(pVBInfo->P3c4, 0x2C); XGI_SetCRT1VCLK()
918 xgifb_reg_set(pVBInfo->P3c4, 0x2C, data); XGI_SetCRT1VCLK()
923 static void XGI_SetXG21FPBits(struct vb_device_info *pVBInfo) XGI_SetXG21FPBits() argument
927 temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); /* D[0] 1: 18bit */ XGI_SetXG21FPBits()
930 xgifb_reg_and_or(pVBInfo->P3c4, 0x06, ~0x40, temp); XGI_SetXG21FPBits()
932 xgifb_reg_and_or(pVBInfo->P3c4, 0x09, ~0xc0, temp | 0x80); XGI_SetXG21FPBits()
937 struct vb_device_info *pVBInfo) XGI_SetCRT1FIFO()
941 data = xgifb_reg_get(pVBInfo->P3c4, 0x3D); XGI_SetCRT1FIFO()
943 xgifb_reg_set(pVBInfo->P3c4, 0x3D, data); /* disable auto-threshold */ XGI_SetCRT1FIFO()
945 xgifb_reg_set(pVBInfo->P3c4, 0x08, 0x34); XGI_SetCRT1FIFO()
946 data = xgifb_reg_get(pVBInfo->P3c4, 0x09); XGI_SetCRT1FIFO()
948 xgifb_reg_set(pVBInfo->P3c4, 0x09, data | 0x30); XGI_SetCRT1FIFO()
949 data = xgifb_reg_get(pVBInfo->P3c4, 0x3D); XGI_SetCRT1FIFO()
951 xgifb_reg_set(pVBInfo->P3c4, 0x3D, data); XGI_SetCRT1FIFO()
954 XGI_SetXG21FPBits(pVBInfo); /* Fix SR9[7:6] can't read back */ XGI_SetCRT1FIFO()
959 struct vb_device_info *pVBInfo) XGI_SetVCLKState()
970 data = xgifb_reg_get(pVBInfo->P3c4, 0x32); XGI_SetVCLKState()
978 xgifb_reg_set(pVBInfo->P3c4, 0x32, data); XGI_SetVCLKState()
981 data = xgifb_reg_get(pVBInfo->P3c4, 0x1F); XGI_SetVCLKState()
985 xgifb_reg_set(pVBInfo->P3c4, 0x1F, data); XGI_SetVCLKState()
990 xgifb_reg_and_or(pVBInfo->P3c4, 0x07, 0xFC, data2); XGI_SetVCLKState()
992 xgifb_reg_and_or(pVBInfo->P3c4, 0x40, 0xFC, data2 & 0x03); XGI_SetVCLKState()
999 struct vb_device_info *pVBInfo) XGI_SetCRT1ModeRegs()
1007 if (xgifb_reg_get(pVBInfo->P3d4, 0x31) & 0x01) XGI_SetCRT1ModeRegs()
1008 xgifb_reg_and_or(pVBInfo->P3c4, 0x1F, 0x3F, 0x00); XGI_SetCRT1ModeRegs()
1013 data3 = pVBInfo->ModeType - ModeVGA; XGI_SetCRT1ModeRegs()
1021 xgifb_reg_and_or(pVBInfo->P3c4, 0x06, ~0x3F, data2); XGI_SetCRT1ModeRegs()
1033 xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFF, data); XGI_SetCRT1ModeRegs()
1034 xgifb_reg_and_or(pVBInfo->P3d4, 0x19, 0xFC, 0); XGI_SetCRT1ModeRegs()
1037 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xF7, 0x08); XGI_SetCRT1ModeRegs()
1044 xgifb_reg_and_or(pVBInfo->P3c4, 0x0F, ~0x48, data2); XGI_SetCRT1ModeRegs()
1048 xgifb_reg_and_or(pVBInfo->P3c4, 0x21, 0x1F, data); XGI_SetCRT1ModeRegs()
1050 XGI_SetVCLKState(HwDeviceExtension, RefreshRateTableIndex, pVBInfo); XGI_SetCRT1ModeRegs()
1052 data = xgifb_reg_get(pVBInfo->P3d4, 0x31); XGI_SetCRT1ModeRegs()
1059 xgifb_reg_set(pVBInfo->P3d4, 0x52, data); XGI_SetCRT1ModeRegs()
1060 xgifb_reg_or(pVBInfo->P3d4, 0x51, 0x10); XGI_SetCRT1ModeRegs()
1066 xgifb_reg_set(pVBInfo->P3d4, 0x52, data); XGI_SetCRT1ModeRegs()
1067 xgifb_reg_set(pVBInfo->P3d4, 0x51, 0x02); XGI_SetCRT1ModeRegs()
1073 xgifb_reg_set(pVBInfo->P3d4, 0x52, data); XGI_SetCRT1ModeRegs()
1082 struct vb_device_info *pVBInfo) XGI_WriteDAC()
1096 outb((unsigned short) dh, pVBInfo->P3c9); XGI_WriteDAC()
1097 outb((unsigned short) bh, pVBInfo->P3c9); XGI_WriteDAC()
1098 outb((unsigned short) bl, pVBInfo->P3c9); XGI_WriteDAC()
1101 static void XGI_LoadDAC(struct vb_device_info *pVBInfo) XGI_LoadDAC() argument
1106 outb(0xFF, pVBInfo->P3c6); XGI_LoadDAC()
1107 outb(0x00, pVBInfo->P3c8); XGI_LoadDAC()
1121 outb(data2, pVBInfo->P3c9); XGI_LoadDAC()
1130 outb(data, pVBInfo->P3c9); XGI_LoadDAC()
1146 XGI_WriteDAC(dl, ah, al, dh, pVBInfo); XGI_LoadDAC()
1156 XGI_WriteDAC(dl, ah, al, dh, pVBInfo); XGI_LoadDAC()
1167 struct vb_device_info *pVBInfo) XGI_GetLVDSResInfo()
1189 pVBInfo->VGAHDE = xres; XGI_GetLVDSResInfo()
1190 pVBInfo->HDE = xres; XGI_GetLVDSResInfo()
1191 pVBInfo->VGAVDE = yres; XGI_GetLVDSResInfo()
1192 pVBInfo->VDE = yres; XGI_GetLVDSResInfo()
1197 struct vb_device_info *pVBInfo) XGI_GetLcdPtr()
1208 tempdx = pVBInfo->LCDResInfo; XGI_GetLcdPtr()
1211 tempdx = pVBInfo->LCDTypeInfo; XGI_GetLcdPtr()
1214 if (pVBInfo->LCDInfo & EnableScalingLCD) XGI_GetLcdPtr()
1219 tempdx = pVBInfo->LCDInfo; XGI_GetLcdPtr()
1236 struct vb_device_info *pVBInfo) XGI_GetTVPtr()
1243 tempdx = pVBInfo->TVInfo; XGI_GetTVPtr()
1245 if (pVBInfo->VBInfo & SetInSlaveMode) XGI_GetTVPtr()
1264 struct vb_device_info *pVBInfo) XGI_GetLVDSData()
1268 if (!(pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA))) XGI_GetLVDSData()
1271 LCDPtr = XGI_GetLcdPtr(XGI_EPLLCDDataPtr, ModeIdIndex, pVBInfo); XGI_GetLVDSData()
1272 pVBInfo->VGAHT = LCDPtr->VGAHT; XGI_GetLVDSData()
1273 pVBInfo->VGAVT = LCDPtr->VGAVT; XGI_GetLVDSData()
1274 pVBInfo->HT = LCDPtr->LCDHT; XGI_GetLVDSData()
1275 pVBInfo->VT = LCDPtr->LCDVT; XGI_GetLVDSData()
1277 if (pVBInfo->LCDInfo & (SetLCDtoNonExpanding | EnableScalingLCD)) XGI_GetLVDSData()
1280 if ((pVBInfo->LCDResInfo == Panel_1024x768) || XGI_GetLVDSData()
1281 (pVBInfo->LCDResInfo == Panel_1024x768x75)) { XGI_GetLVDSData()
1282 pVBInfo->HDE = 1024; XGI_GetLVDSData()
1283 pVBInfo->VDE = 768; XGI_GetLVDSData()
1284 } else if ((pVBInfo->LCDResInfo == Panel_1280x1024) || XGI_GetLVDSData()
1285 (pVBInfo->LCDResInfo == Panel_1280x1024x75)) { XGI_GetLVDSData()
1286 pVBInfo->HDE = 1280; XGI_GetLVDSData()
1287 pVBInfo->VDE = 1024; XGI_GetLVDSData()
1288 } else if (pVBInfo->LCDResInfo == Panel_1400x1050) { XGI_GetLVDSData()
1289 pVBInfo->HDE = 1400; XGI_GetLVDSData()
1290 pVBInfo->VDE = 1050; XGI_GetLVDSData()
1292 pVBInfo->HDE = 1600; XGI_GetLVDSData()
1293 pVBInfo->VDE = 1200; XGI_GetLVDSData()
1299 struct vb_device_info *pVBInfo) XGI_ModCRT1Regs()
1305 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { XGI_ModCRT1Regs()
1307 pVBInfo); XGI_ModCRT1Regs()
1310 pVBInfo->TimingH.data[i] = LCDPtr[0].Reg[i]; XGI_ModCRT1Regs()
1313 XGI_SetCRT1Timing_H(pVBInfo, HwDeviceExtension); XGI_ModCRT1Regs()
1315 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { XGI_ModCRT1Regs()
1317 pVBInfo); XGI_ModCRT1Regs()
1319 pVBInfo->TimingV.data[i] = LCDPtr1[0].Reg[i]; XGI_ModCRT1Regs()
1322 XGI_SetCRT1Timing_V(ModeIdIndex, pVBInfo); XGI_ModCRT1Regs()
1325 static unsigned short XGI_GetLCDCapPtr(struct vb_device_info *pVBInfo) XGI_GetLCDCapPtr() argument
1329 tempah = xgifb_reg_get(pVBInfo->P3d4, 0x36); XGI_GetLCDCapPtr()
1333 tempbl = pVBInfo->LCDCapList[i].LCD_ID; XGI_GetLCDCapPtr()
1346 tempbl = pVBInfo->LCDCapList[i].LCD_ID; XGI_GetLCDCapPtr()
1352 static unsigned short XGI_GetLCDCapPtr1(struct vb_device_info *pVBInfo) XGI_GetLCDCapPtr1() argument
1356 tempal = pVBInfo->LCDResInfo; XGI_GetLCDCapPtr1()
1357 tempah = pVBInfo->LCDTypeInfo; XGI_GetLCDCapPtr1()
1360 tempbl = pVBInfo->LCDCapList[i].LCD_ID; XGI_GetLCDCapPtr1()
1372 tempbl = pVBInfo->LCDCapList[i].LCD_ID; XGI_GetLCDCapPtr1()
1376 pVBInfo->LCDResInfo = Panel_1024x768; XGI_GetLCDCapPtr1()
1377 pVBInfo->LCDTypeInfo = 0; XGI_GetLCDCapPtr1()
1386 struct vb_device_info *pVBInfo) XGI_GetLCDSync()
1390 Index = XGI_GetLCDCapPtr(pVBInfo); XGI_GetLCDSync()
1391 *HSyncWidth = pVBInfo->LCDCapList[Index].LCD_HSyncWidth; XGI_GetLCDSync()
1392 *VSyncWidth = pVBInfo->LCDCapList[Index].LCD_VSyncWidth; XGI_GetLCDSync()
1396 struct vb_device_info *pVBInfo) XGI_SetLVDSRegs()
1403 LCDPtr1 = XGI_GetLcdPtr(XGI_EPLLCDDesDataPtr, ModeIdIndex, pVBInfo); XGI_SetLVDSRegs()
1405 XGI_GetLCDSync(&tempax, &tempbx, pVBInfo); XGI_SetLVDSRegs()
1410 if ((pVBInfo->LCDResInfo == Panel_1024x768) || XGI_SetLVDSRegs()
1411 (pVBInfo->LCDResInfo == Panel_1024x768x75)) { XGI_SetLVDSRegs()
1414 } else if ((pVBInfo->LCDResInfo == Panel_1280x1024) || XGI_SetLVDSRegs()
1415 (pVBInfo->LCDResInfo == Panel_1280x1024x75)) { XGI_SetLVDSRegs()
1418 } else if (pVBInfo->LCDResInfo == Panel_1400x1050) { XGI_SetLVDSRegs()
1426 if (pVBInfo->LCDInfo & SetLCDtoNonExpanding) { XGI_SetLVDSRegs()
1427 pVBInfo->HDE = tempax; XGI_SetLVDSRegs()
1428 pVBInfo->VDE = tempbx; XGI_SetLVDSRegs()
1429 pVBInfo->VGAHDE = tempax; XGI_SetLVDSRegs()
1430 pVBInfo->VGAVDE = tempbx; XGI_SetLVDSRegs()
1433 tempax = pVBInfo->HT; XGI_SetLVDSRegs()
1437 tempcx = pVBInfo->HDE; XGI_SetLVDSRegs()
1444 xgifb_reg_set(pVBInfo->Part1Port, 0x1A, tempbx & 0x07); XGI_SetLVDSRegs()
1449 xgifb_reg_set(pVBInfo->Part1Port, 0x16, XGI_SetLVDSRegs()
1451 xgifb_reg_set(pVBInfo->Part1Port, 0x17, XGI_SetLVDSRegs()
1454 tempax = pVBInfo->HT; XGI_SetLVDSRegs()
1460 if (pVBInfo->LCDInfo & EnableScalingLCD) XGI_SetLVDSRegs()
1476 xgifb_reg_set(pVBInfo->Part1Port, 0x15, tempax); XGI_SetLVDSRegs()
1477 xgifb_reg_set(pVBInfo->Part1Port, 0x14, XGI_SetLVDSRegs()
1480 tempax = pVBInfo->VT; XGI_SetLVDSRegs()
1482 tempcx = pVBInfo->VDE; XGI_SetLVDSRegs()
1489 xgifb_reg_set(pVBInfo->Part1Port, 0x1b, XGI_SetLVDSRegs()
1491 xgifb_reg_set(pVBInfo->Part1Port, 0x1c, XGI_SetLVDSRegs()
1497 xgifb_reg_set(pVBInfo->Part1Port, 0x1d, XGI_SetLVDSRegs()
1501 tempax = pVBInfo->VT; XGI_SetLVDSRegs()
1506 if (pVBInfo->LCDInfo & EnableScalingLCD) XGI_SetLVDSRegs()
1513 xgifb_reg_set(pVBInfo->Part1Port, 0x18, XGI_SetLVDSRegs()
1515 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, ~0x0f, XGI_SetLVDSRegs()
1520 tempbx = pVBInfo->VGAVDE; XGI_SetLVDSRegs()
1521 if (tempbx != pVBInfo->VDE) XGI_SetLVDSRegs()
1524 if (pVBInfo->LCDInfo & XGI_EnableLVDSDDA) XGI_SetLVDSRegs()
1527 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1a, 0x07, XGI_SetLVDSRegs()
1530 tempbx = pVBInfo->VDE; XGI_SetLVDSRegs()
1531 tempax = pVBInfo->VGAVDE; XGI_SetLVDSRegs()
1544 xgifb_reg_set(pVBInfo->Part1Port, 0x37, XGI_SetLVDSRegs()
1546 xgifb_reg_set(pVBInfo->Part1Port, 0x36, XGI_SetLVDSRegs()
1552 tempbx = pVBInfo->VGAVDE; XGI_SetLVDSRegs()
1553 if (tempbx == pVBInfo->VDE) XGI_SetLVDSRegs()
1556 xgifb_reg_set(pVBInfo->Part1Port, 0x35, tempax); XGI_SetLVDSRegs()
1558 if (pVBInfo->VBType & VB_XGI301C) { XGI_SetLVDSRegs()
1560 xgifb_reg_set(pVBInfo->Part4Port, XGI_SetLVDSRegs()
1563 xgifb_reg_set(pVBInfo->Part4Port, XGI_SetLVDSRegs()
1568 xgifb_reg_and_or(pVBInfo->Part4Port, 0x3a, XGI_SetLVDSRegs()
1573 tempcx = pVBInfo->VGAVDE; XGI_SetLVDSRegs()
1574 if (tempcx == pVBInfo->VDE) XGI_SetLVDSRegs()
1575 xgifb_reg_and_or(pVBInfo->Part4Port, XGI_SetLVDSRegs()
1578 xgifb_reg_and_or(pVBInfo->Part4Port, XGI_SetLVDSRegs()
1582 tempcx = pVBInfo->VGAHDE; XGI_SetLVDSRegs()
1583 tempbx = pVBInfo->HDE; XGI_SetLVDSRegs()
1593 temp1 = pVBInfo->VGAHDE << 16; XGI_SetLVDSRegs()
1602 xgifb_reg_set(pVBInfo->Part1Port, 0x1f, tempax); XGI_SetLVDSRegs()
1604 temp1 = pVBInfo->VGAVDE << 18; XGI_SetLVDSRegs()
1608 if (pVBInfo->LCDResInfo == Panel_1024x768) XGI_SetLVDSRegs()
1613 xgifb_reg_set(pVBInfo->Part1Port, 0x20, XGI_SetLVDSRegs()
1615 xgifb_reg_set(pVBInfo->Part1Port, 0x21, XGI_SetLVDSRegs()
1623 xgifb_reg_set(pVBInfo->Part1Port, 0x22, XGI_SetLVDSRegs()
1625 xgifb_reg_set(pVBInfo->Part1Port, 0x23, XGI_SetLVDSRegs()
1636 struct vb_device_info *pVBInfo) XGI_GetLCDVCLKPtr()
1640 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { XGI_GetLCDVCLKPtr()
1641 index = XGI_GetLCDCapPtr1(pVBInfo); XGI_GetLCDVCLKPtr()
1643 if (pVBInfo->VBInfo & SetCRT2ToLCD) { /* LCDB */ XGI_GetLCDVCLKPtr()
1644 *di_0 = pVBInfo->LCDCapList[index].LCUCHAR_VCLKData1; XGI_GetLCDVCLKPtr()
1645 *di_1 = pVBInfo->LCDCapList[index].LCUCHAR_VCLKData2; XGI_GetLCDVCLKPtr()
1647 *di_0 = pVBInfo->LCDCapList[index].LCDA_VCLKData1; XGI_GetLCDVCLKPtr()
1648 *di_1 = pVBInfo->LCDCapList[index].LCDA_VCLKData2; XGI_GetLCDVCLKPtr()
1654 unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetVCLKPtr()
1663 if ((pVBInfo->SetFlag & ProgrammingCRT2) && XGI_GetVCLKPtr()
1664 (!(pVBInfo->LCDInfo & EnableScalingLCD))) { /* {LCDA/LCDB} */ XGI_GetVCLKPtr()
1665 index = XGI_GetLCDCapPtr(pVBInfo); XGI_GetVCLKPtr()
1666 tempal = pVBInfo->LCDCapList[index].LCD_VCLK; XGI_GetVCLKPtr()
1668 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) XGI_GetVCLKPtr()
1672 if (pVBInfo->VBType & XGI_GetVCLKPtr()
1678 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_GetVCLKPtr()
1680 if (!(pVBInfo->TVInfo & RPLLDIV2XO)) XGI_GetVCLKPtr()
1682 if (pVBInfo->TVInfo & TVSimuMode) { XGI_GetVCLKPtr()
1692 if (pVBInfo->TVInfo & TVSetYPbPr750p) { XGI_GetVCLKPtr()
1697 if (pVBInfo->TVInfo & TVSetYPbPr525p) { XGI_GetVCLKPtr()
1704 if (!(pVBInfo->TVInfo & NTSC1024x768)) { XGI_GetVCLKPtr()
1706 if (!(pVBInfo->TVInfo & RPLLDIV2XO)) XGI_GetVCLKPtr()
1710 if (pVBInfo->VBInfo & SetCRT2ToTV) XGI_GetVCLKPtr()
1715 inb((pVBInfo->P3ca + 0x02)); XGI_GetVCLKPtr()
1721 unsigned char *di_1, struct vb_device_info *pVBInfo) XGI_GetVCLKLen()
1723 if (pVBInfo->VBType & (VB_SIS301 | VB_SIS301B | VB_SIS302B XGI_GetVCLKLen()
1725 if ((!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) && XGI_GetVCLKLen()
1726 (pVBInfo->SetFlag & ProgrammingCRT2)) { XGI_GetVCLKLen()
1738 struct vb_device_info *pVBInfo) XGI_SetCRT2ECLK()
1743 tempal = XGI_GetVCLKPtr(RefreshRateTableIndex, ModeIdIndex, pVBInfo); XGI_SetCRT2ECLK()
1744 XGI_GetVCLKLen(tempal, &di_0, &di_1, pVBInfo); XGI_SetCRT2ECLK()
1745 XGI_GetLCDVCLKPtr(&di_0, &di_1, pVBInfo); XGI_SetCRT2ECLK()
1748 xgifb_reg_and_or(pVBInfo->P3d4, 0x31, ~0x30, XGI_SetCRT2ECLK()
1750 if ((!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) XGI_SetCRT2ECLK()
1751 && (!(pVBInfo->VBInfo & SetInSlaveMode))) { XGI_SetCRT2ECLK()
1752 xgifb_reg_set(pVBInfo->P3c4, 0x2e, di_0); XGI_SetCRT2ECLK()
1753 xgifb_reg_set(pVBInfo->P3c4, 0x2f, di_1); XGI_SetCRT2ECLK()
1755 xgifb_reg_set(pVBInfo->P3c4, 0x2b, di_0); XGI_SetCRT2ECLK()
1756 xgifb_reg_set(pVBInfo->P3c4, 0x2c, di_1); XGI_SetCRT2ECLK()
1761 static void XGI_UpdateModeInfo(struct vb_device_info *pVBInfo) XGI_UpdateModeInfo() argument
1765 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_UpdateModeInfo()
1769 temp = xgifb_reg_get(pVBInfo->P3c4, 0x01); XGI_UpdateModeInfo()
1772 temp = xgifb_reg_get(pVBInfo->P3d4, 0x17); XGI_UpdateModeInfo()
1774 temp = xgifb_reg_get(pVBInfo->P3d4, 0x53); XGI_UpdateModeInfo()
1780 temp = xgifb_reg_get(pVBInfo->Part1Port, 0x2e); XGI_UpdateModeInfo()
1785 tempax = xgifb_reg_get(pVBInfo->Part1Port, 0x13); XGI_UpdateModeInfo()
1799 temp = xgifb_reg_get(pVBInfo->Part2Port, 0x00); XGI_UpdateModeInfo()
1810 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_UpdateModeInfo()
1815 if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { XGI_UpdateModeInfo()
1817 pVBInfo->Part2Port, XGI_UpdateModeInfo()
1829 temp = xgifb_reg_get(pVBInfo->P3d4, 0x3d); XGI_UpdateModeInfo()
1831 if ((pVBInfo->SetFlag & ReserveTVOption)) { XGI_UpdateModeInfo()
1838 xgifb_reg_and_or(pVBInfo->P3d4, 0x3d, tempbl, temp); XGI_UpdateModeInfo()
1840 if (!(pVBInfo->SetFlag & ReserveTVOption)) XGI_UpdateModeInfo()
1841 xgifb_reg_set(pVBInfo->P3d4, 0x3e, tempch); XGI_UpdateModeInfo()
1845 void XGI_GetVBType(struct vb_device_info *pVBInfo) XGI_GetVBType() argument
1850 flag = xgifb_reg_get(pVBInfo->Part4Port, 0x00); XGI_GetVBType()
1855 flag = xgifb_reg_get(pVBInfo->Part4Port, 0x01); XGI_GetVBType()
1872 tempah = xgifb_reg_get(pVBInfo->Part4Port, 0x39); XGI_GetVBType()
1878 flag = xgifb_reg_get(pVBInfo->Part4Port, 0x23); XGI_GetVBType()
1884 pVBInfo->VBType = tempbx; XGI_GetVBType()
1888 struct vb_device_info *pVBInfo) XGI_GetVBInfo()
1893 pVBInfo->SetFlag = 0; XGI_GetVBInfo()
1894 pVBInfo->ModeType = modeflag & ModeTypeMask; XGI_GetVBInfo()
1897 if (!(pVBInfo->VBType & 0xFFFF)) XGI_GetVBInfo()
1901 temp = xgifb_reg_get(pVBInfo->P3d4, 0x30); XGI_GetVBInfo()
1903 temp = xgifb_reg_get(pVBInfo->P3d4, 0x31); XGI_GetVBInfo()
1913 temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); XGI_GetVBInfo()
1915 if (pVBInfo->VBType & (VB_SIS302B | VB_SIS301LV | VB_SIS302LV | XGI_GetVBInfo()
1924 if (pVBInfo->VBType & (VB_SIS301LV|VB_SIS302LV|VB_XGI301C)) { XGI_GetVBInfo()
1927 temp = xgifb_reg_get(pVBInfo->P3d4, 0x35); XGI_GetVBInfo()
1947 if (!(pVBInfo->VBType & VB_NoLCD)) { XGI_GetVBInfo()
1968 if (!(pVBInfo->VBType & VB_NoLCD)) { XGI_GetVBInfo()
2005 pVBInfo->SetFlag |= ReserveTVOption; XGI_GetVBInfo()
2009 pVBInfo->VBInfo = tempbx; XGI_GetVBInfo()
2013 struct vb_device_info *pVBInfo) XGI_GetTVInfo()
2017 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_GetTVInfo()
2021 tempbx = xgifb_reg_get(pVBInfo->P3d4, 0x35); XGI_GetTVInfo()
2035 if (pVBInfo->VBInfo & SetCRT2ToSCART) XGI_GetTVInfo()
2038 if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { XGI_GetTVInfo()
2039 index1 = xgifb_reg_get(pVBInfo->P3d4, 0x35); XGI_GetTVInfo()
2051 if (pVBInfo->VBInfo & SetCRT2ToHiVision) XGI_GetTVInfo()
2054 if ((pVBInfo->VBInfo & SetInSlaveMode) && XGI_GetTVInfo()
2055 (!(pVBInfo->VBInfo & SetNotSimuMode))) XGI_GetTVInfo()
2064 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_GetTVInfo()
2065 if (pVBInfo->VBInfo & SetInSlaveMode) XGI_GetTVInfo()
2069 } else if (!(pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | XGI_GetTVInfo()
2076 pVBInfo->TVInfo = tempbx; XGI_GetTVInfo()
2080 struct vb_device_info *pVBInfo) XGI_GetLCDInfo()
2084 pVBInfo->LCDResInfo = 0; XGI_GetLCDInfo()
2085 pVBInfo->LCDTypeInfo = 0; XGI_GetLCDInfo()
2086 pVBInfo->LCDInfo = 0; XGI_GetLCDInfo()
2090 temp = xgifb_reg_get(pVBInfo->P3d4, 0x36); /* Get LCD Res.Info */ XGI_GetLCDInfo()
2098 if (pVBInfo->VBInfo & DriverMode) { XGI_GetLCDInfo()
2099 tempax = xgifb_reg_get(pVBInfo->P3d4, 0x33); XGI_GetLCDInfo()
2100 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) XGI_GetLCDInfo()
2115 pVBInfo->LCDResInfo = tempbx; XGI_GetLCDInfo()
2119 if (!(pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA))) XGI_GetLCDInfo()
2124 temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); XGI_GetLCDInfo()
2130 LCDIdIndex = XGI_GetLCDCapPtr1(pVBInfo); XGI_GetLCDInfo()
2132 tempax = pVBInfo->LCDCapList[LCDIdIndex].LCD_Capability; XGI_GetLCDInfo()
2134 if (((pVBInfo->VBType & VB_SIS302LV) || XGI_GetLCDInfo()
2135 (pVBInfo->VBType & VB_XGI301C)) && (tempax & XGI_LCDDualLink)) XGI_GetLCDInfo()
2138 if ((pVBInfo->LCDResInfo == Panel_1400x1050) && XGI_GetLCDInfo()
2139 (pVBInfo->VBInfo & SetCRT2ToLCD) && (resinfo == 9) && XGI_GetLCDInfo()
2147 if (pVBInfo->VBInfo & SetInSlaveMode) { XGI_GetLCDInfo()
2148 if (pVBInfo->VBInfo & SetNotSimuMode) XGI_GetLCDInfo()
2154 pVBInfo->LCDInfo = tempbx; XGI_GetLCDInfo()
2191 static unsigned char XGI_XG21GetPSCValue(struct vb_device_info *pVBInfo) XGI_XG21GetPSCValue() argument
2195 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); XGI_XG21GetPSCValue()
2196 xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~0x23); /* enable GPIO write */ XGI_XG21GetPSCValue()
2198 temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); XGI_XG21GetPSCValue()
2202 xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); XGI_XG21GetPSCValue()
2212 static unsigned char XGI_XG27GetPSCValue(struct vb_device_info *pVBInfo) XGI_XG27GetPSCValue() argument
2216 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); XGI_XG27GetPSCValue()
2217 xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~0x0C); /* enable GPIO write */ XGI_XG27GetPSCValue()
2219 temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); XGI_XG27GetPSCValue()
2223 xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); XGI_XG27GetPSCValue()
2224 CRB4 = xgifb_reg_get(pVBInfo->P3d4, 0xB4); XGI_XG27GetPSCValue()
2239 struct vb_device_info *pVBInfo) XGI_XG21BLSignalVDD()
2243 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); XGI_XG21BLSignalVDD()
2246 xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */ XGI_XG21BLSignalVDD()
2252 xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~0x02, temp); XGI_XG21BLSignalVDD()
2256 temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); XGI_XG21BLSignalVDD()
2261 xgifb_reg_set(pVBInfo->P3d4, 0x48, temp); XGI_XG21BLSignalVDD()
2265 struct vb_device_info *pVBInfo) XGI_XG27BLSignalVDD()
2281 xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~0x02, temp); XGI_XG27BLSignalVDD()
2284 xgifb_reg_and_or(pVBInfo->P3d4, 0xB4, ~tempbh0, tempbl0); XGI_XG27BLSignalVDD()
2286 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); XGI_XG27BLSignalVDD()
2291 xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~tempbh); /* enable GPIO write */ XGI_XG27BLSignalVDD()
2292 xgifb_reg_and_or(pVBInfo->P3d4, 0x48, ~tempbh, tempbl); XGI_XG27BLSignalVDD()
2297 struct vb_device_info *pVBInfo) XGI_DisplayOn()
2300 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xDF, 0x00); XGI_DisplayOn()
2302 if (pVBInfo->IF_DEF_LVDS == 1) { XGI_DisplayOn()
2303 if (!(XGI_XG21GetPSCValue(pVBInfo) & 0x1)) { XGI_DisplayOn()
2305 XGI_XG21BLSignalVDD(0x01, 0x01, pVBInfo); XGI_DisplayOn()
2308 if (!(XGI_XG21GetPSCValue(pVBInfo) & 0x20)) XGI_DisplayOn()
2310 XGI_XG21BLSignalVDD(0x20, 0x20, pVBInfo); XGI_DisplayOn()
2313 XGI_XG21BLSignalVDD(0x02, 0x02, pVBInfo); XGI_DisplayOn()
2316 XGI_XG21BLSignalVDD(0x20, 0x20, pVBInfo); XGI_DisplayOn()
2322 if (pVBInfo->IF_DEF_LVDS == 1) { XGI_DisplayOn()
2323 if (!(XGI_XG27GetPSCValue(pVBInfo) & 0x1)) { XGI_DisplayOn()
2325 XGI_XG27BLSignalVDD(0x01, 0x01, pVBInfo); XGI_DisplayOn()
2328 if (!(XGI_XG27GetPSCValue(pVBInfo) & 0x20)) XGI_DisplayOn()
2330 XGI_XG27BLSignalVDD(0x20, 0x20, pVBInfo); XGI_DisplayOn()
2333 XGI_XG27BLSignalVDD(0x02, 0x02, pVBInfo); XGI_DisplayOn()
2336 XGI_XG27BLSignalVDD(0x20, 0x20, pVBInfo); XGI_DisplayOn()
2344 struct vb_device_info *pVBInfo) XGI_DisplayOff()
2348 if (pVBInfo->IF_DEF_LVDS == 1) { XGI_DisplayOff()
2350 XGI_XG21BLSignalVDD(0x02, 0x00, pVBInfo); XGI_DisplayOff()
2354 XGI_XG21BLSignalVDD(0x20, 0x00, pVBInfo); XGI_DisplayOff()
2359 if ((XGI_XG27GetPSCValue(pVBInfo) & 0x2)) { XGI_DisplayOff()
2361 XGI_XG27BLSignalVDD(0x02, 0x00, pVBInfo); XGI_DisplayOff()
2365 if (pVBInfo->IF_DEF_LVDS == 0) XGI_DisplayOff()
2367 XGI_XG27BLSignalVDD(0x20, 0x00, pVBInfo); XGI_DisplayOff()
2370 xgifb_reg_and_or(pVBInfo->P3c4, 0x01, 0xDF, 0x20); XGI_DisplayOff()
2373 static void XGI_WaitDisply(struct vb_device_info *pVBInfo) XGI_WaitDisply() argument
2375 while ((inb(pVBInfo->P3da) & 0x01)) XGI_WaitDisply()
2378 while (!(inb(pVBInfo->P3da) & 0x01)) XGI_WaitDisply()
2382 static void XGI_AutoThreshold(struct vb_device_info *pVBInfo) XGI_AutoThreshold() argument
2384 xgifb_reg_or(pVBInfo->Part1Port, 0x01, 0x40); XGI_AutoThreshold()
2388 struct vb_device_info *pVBInfo) XGI_SaveCRT2Info()
2393 xgifb_reg_set(pVBInfo->P3d4, 0x34, ModeNo); XGI_SaveCRT2Info()
2394 temp1 = (pVBInfo->VBInfo & SetInSlaveMode) >> 8; XGI_SaveCRT2Info()
2396 xgifb_reg_and_or(pVBInfo->P3d4, 0x31, temp2, temp1); XGI_SaveCRT2Info()
2400 struct vb_device_info *pVBInfo) XGI_GetCRT2ResInfo()
2416 if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) XGI_GetCRT2ResInfo()
2419 if (pVBInfo->LCDResInfo == Panel_1600x1200) { XGI_GetCRT2ResInfo()
2420 if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { XGI_GetCRT2ResInfo()
2426 if (pVBInfo->LCDResInfo == Panel_1280x1024) { XGI_GetCRT2ResInfo()
2432 if (pVBInfo->LCDInfo & XGI_LCDVESATiming) { XGI_GetCRT2ResInfo()
2438 if (pVBInfo->LCDResInfo == Panel_1024x768) { XGI_GetCRT2ResInfo()
2439 if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { XGI_GetCRT2ResInfo()
2440 if (!(pVBInfo->LCDInfo & LCDNonExpanding)) { XGI_GetCRT2ResInfo()
2455 pVBInfo->VGAHDE = xres; XGI_GetCRT2ResInfo()
2456 pVBInfo->HDE = xres; XGI_GetCRT2ResInfo()
2457 pVBInfo->VGAVDE = yres; XGI_GetCRT2ResInfo()
2458 pVBInfo->VDE = yres; XGI_GetCRT2ResInfo()
2461 static unsigned char XGI_IsLCDDualLink(struct vb_device_info *pVBInfo) XGI_IsLCDDualLink() argument
2464 if ((pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) && XGI_IsLCDDualLink()
2465 (pVBInfo->LCDInfo & SetLCDDualLink)) /* shampoo0129 */ XGI_IsLCDDualLink()
2473 struct vb_device_info *pVBInfo) XGI_GetRAMDAC2DATA()
2478 pVBInfo->RVBHCMAX = 1; XGI_GetRAMDAC2DATA()
2479 pVBInfo->RVBHCFACT = 1; XGI_GetRAMDAC2DATA()
2506 pVBInfo->VGAHT = tempax; XGI_GetRAMDAC2DATA()
2507 pVBInfo->HT = tempax; XGI_GetRAMDAC2DATA()
2509 pVBInfo->VGAVT = tempbx; XGI_GetRAMDAC2DATA()
2510 pVBInfo->VT = tempbx; XGI_GetRAMDAC2DATA()
2515 struct vb_device_info *pVBInfo) XGI_GetCRT2Data()
2524 pVBInfo->NewFlickerMode = 0; XGI_GetCRT2Data()
2525 pVBInfo->RVBHRS = 50; XGI_GetCRT2Data()
2527 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) { XGI_GetCRT2Data()
2528 XGI_GetRAMDAC2DATA(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_GetCRT2Data()
2532 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { XGI_GetCRT2Data()
2534 pVBInfo); XGI_GetCRT2Data()
2536 pVBInfo->RVBHCMAX = LCDPtr->RVBHCMAX; XGI_GetCRT2Data()
2537 pVBInfo->RVBHCFACT = LCDPtr->RVBHCFACT; XGI_GetCRT2Data()
2538 pVBInfo->VGAHT = LCDPtr->VGAHT; XGI_GetCRT2Data()
2539 pVBInfo->VGAVT = LCDPtr->VGAVT; XGI_GetCRT2Data()
2540 pVBInfo->HT = LCDPtr->LCDHT; XGI_GetCRT2Data()
2541 pVBInfo->VT = LCDPtr->LCDVT; XGI_GetCRT2Data()
2543 if (pVBInfo->LCDResInfo == Panel_1024x768) { XGI_GetCRT2Data()
2547 if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { XGI_GetCRT2Data()
2548 if (pVBInfo->VGAVDE == 357) XGI_GetCRT2Data()
2550 else if (pVBInfo->VGAVDE == 420) XGI_GetCRT2Data()
2552 else if (pVBInfo->VGAVDE == 525) XGI_GetCRT2Data()
2554 else if (pVBInfo->VGAVDE == 600) XGI_GetCRT2Data()
2557 } else if (pVBInfo->LCDResInfo == Panel_1024x768x75) { XGI_GetCRT2Data()
2560 } else if (pVBInfo->LCDResInfo == Panel_1280x1024) { XGI_GetCRT2Data()
2562 if (pVBInfo->VGAVDE == 360) XGI_GetCRT2Data()
2564 else if (pVBInfo->VGAVDE == 375) XGI_GetCRT2Data()
2566 else if (pVBInfo->VGAVDE == 405) XGI_GetCRT2Data()
2570 } else if (pVBInfo->LCDResInfo == Panel_1280x1024x75) { XGI_GetCRT2Data()
2573 } else if (pVBInfo->LCDResInfo == Panel_1280x960) { XGI_GetCRT2Data()
2575 if (pVBInfo->VGAVDE == 350) XGI_GetCRT2Data()
2577 else if (pVBInfo->VGAVDE == 400) XGI_GetCRT2Data()
2579 else if (pVBInfo->VGAVDE == 1024) XGI_GetCRT2Data()
2583 } else if (pVBInfo->LCDResInfo == Panel_1400x1050) { XGI_GetCRT2Data()
2587 if (pVBInfo->VGAVDE == 1024) { XGI_GetCRT2Data()
2591 } else if (pVBInfo->LCDResInfo == Panel_1600x1200) { XGI_GetCRT2Data()
2594 if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { XGI_GetCRT2Data()
2595 if (pVBInfo->VGAVDE == 350) XGI_GetCRT2Data()
2597 else if (pVBInfo->VGAVDE == 400) XGI_GetCRT2Data()
2602 if (pVBInfo->LCDInfo & LCDNonExpanding) { XGI_GetCRT2Data()
2603 tempax = pVBInfo->VGAHDE; XGI_GetCRT2Data()
2604 tempbx = pVBInfo->VGAVDE; XGI_GetCRT2Data()
2607 pVBInfo->HDE = tempax; XGI_GetCRT2Data()
2608 pVBInfo->VDE = tempbx; XGI_GetCRT2Data()
2612 if (pVBInfo->VBInfo & (SetCRT2ToTV)) { XGI_GetCRT2Data()
2616 pVBInfo); XGI_GetCRT2Data()
2618 pVBInfo->RVBHCMAX = TVPtr->RVBHCMAX; XGI_GetCRT2Data()
2619 pVBInfo->RVBHCFACT = TVPtr->RVBHCFACT; XGI_GetCRT2Data()
2620 pVBInfo->VGAHT = TVPtr->VGAHT; XGI_GetCRT2Data()
2621 pVBInfo->VGAVT = TVPtr->VGAVT; XGI_GetCRT2Data()
2622 pVBInfo->HDE = TVPtr->TVHDE; XGI_GetCRT2Data()
2623 pVBInfo->VDE = TVPtr->TVVDE; XGI_GetCRT2Data()
2624 pVBInfo->RVBHRS = TVPtr->RVBHRS; XGI_GetCRT2Data()
2625 pVBInfo->NewFlickerMode = TVPtr->FlickerMode; XGI_GetCRT2Data()
2627 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_GetCRT2Data()
2629 pVBInfo->NewFlickerMode = 0x40; XGI_GetCRT2Data()
2631 pVBInfo->NewFlickerMode = 0x40; XGI_GetCRT2Data()
2633 pVBInfo->NewFlickerMode = 0x40; XGI_GetCRT2Data()
2635 if (pVBInfo->VGAVDE == 350) XGI_GetCRT2Data()
2636 pVBInfo->TVInfo |= TVSimuMode; XGI_GetCRT2Data()
2641 if (pVBInfo->VBInfo & SetInSlaveMode) { XGI_GetCRT2Data()
2642 if (pVBInfo->TVInfo & TVSimuMode) { XGI_GetCRT2Data()
2652 } else if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { XGI_GetCRT2Data()
2653 if (pVBInfo->TVInfo & TVSetYPbPr750p) { XGI_GetCRT2Data()
2658 if (pVBInfo->TVInfo & TVSetYPbPr525p) { XGI_GetCRT2Data()
2661 } else if (pVBInfo->TVInfo & TVSetYPbPr525i) { XGI_GetCRT2Data()
2664 if (pVBInfo->TVInfo & NTSC1024x768) XGI_GetCRT2Data()
2670 if (!(pVBInfo->TVInfo & TVSetPAL)) { XGI_GetCRT2Data()
2673 if (pVBInfo->TVInfo & NTSC1024x768) XGI_GetCRT2Data()
2678 pVBInfo->HT = tempax; XGI_GetCRT2Data()
2679 pVBInfo->VT = tempbx; XGI_GetCRT2Data()
2685 struct vb_device_info *pVBInfo) XGI_SetCRT2VCLK()
2689 tempal = XGI_GetVCLKPtr(RefreshRateTableIndex, ModeIdIndex, pVBInfo); XGI_SetCRT2VCLK()
2690 XGI_GetVCLKLen(tempal, &di_0, &di_1, pVBInfo); XGI_SetCRT2VCLK()
2691 XGI_GetLCDVCLKPtr(&di_0, &di_1, pVBInfo); XGI_SetCRT2VCLK()
2693 if (pVBInfo->VBType & VB_SIS301) { /* shampoo 0129 */ XGI_SetCRT2VCLK()
2695 xgifb_reg_set(pVBInfo->Part4Port, 0x0A, 0x10); XGI_SetCRT2VCLK()
2696 xgifb_reg_set(pVBInfo->Part4Port, 0x0B, di_1); XGI_SetCRT2VCLK()
2697 xgifb_reg_set(pVBInfo->Part4Port, 0x0A, di_0); XGI_SetCRT2VCLK()
2699 xgifb_reg_set(pVBInfo->Part4Port, 0x0A, di_0); XGI_SetCRT2VCLK()
2700 xgifb_reg_set(pVBInfo->Part4Port, 0x0B, di_1); XGI_SetCRT2VCLK()
2703 xgifb_reg_set(pVBInfo->Part4Port, 0x00, 0x12); XGI_SetCRT2VCLK()
2705 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) XGI_SetCRT2VCLK()
2706 xgifb_reg_or(pVBInfo->Part4Port, 0x12, 0x28); XGI_SetCRT2VCLK()
2708 xgifb_reg_or(pVBInfo->Part4Port, 0x12, 0x08); XGI_SetCRT2VCLK()
2758 struct vb_device_info *pVBInfo) XGI_SetCRT2Offset()
2763 if (pVBInfo->VBInfo & SetInSlaveMode) XGI_SetCRT2Offset()
2768 xgifb_reg_set(pVBInfo->Part1Port, 0x07, temp); XGI_SetCRT2Offset()
2770 xgifb_reg_set(pVBInfo->Part1Port, 0x09, temp); XGI_SetCRT2Offset()
2772 xgifb_reg_set(pVBInfo->Part1Port, 0x03, temp); XGI_SetCRT2Offset()
2775 static void XGI_SetCRT2FIFO(struct vb_device_info *pVBInfo) XGI_SetCRT2FIFO() argument
2778 xgifb_reg_set(pVBInfo->Part1Port, 0x01, 0x3B); XGI_SetCRT2FIFO()
2780 xgifb_reg_and_or(pVBInfo->Part1Port, 0x02, ~(0x3F), 0x04); XGI_SetCRT2FIFO()
2785 struct vb_device_info *pVBInfo) XGI_PreSetGroup1()
2789 XGI_SetCRT2Offset(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_PreSetGroup1()
2790 XGI_SetCRT2FIFO(pVBInfo); XGI_PreSetGroup1()
2793 xgifb_reg_set(pVBInfo->Part1Port, tempcx, 0x0); XGI_PreSetGroup1()
2795 xgifb_reg_set(pVBInfo->Part1Port, 0x50, 0x00); XGI_PreSetGroup1()
2796 xgifb_reg_set(pVBInfo->Part1Port, 0x02, 0x44); /* temp 0206 */ XGI_PreSetGroup1()
2801 struct vb_device_info *pVBInfo) XGI_SetGroup1()
2813 temp = (pVBInfo->VGAHT / 2 - 1) & 0x0FF; XGI_SetGroup1()
2814 xgifb_reg_set(pVBInfo->Part1Port, 0x08, temp); XGI_SetGroup1()
2815 temp = (((pVBInfo->VGAHT / 2 - 1) & 0xFF00) >> 8) << 4; XGI_SetGroup1()
2816 xgifb_reg_and_or(pVBInfo->Part1Port, 0x09, ~0x0F0, temp); XGI_SetGroup1()
2818 temp = (pVBInfo->VGAHDE / 2 + 16) & 0x0FF; XGI_SetGroup1()
2819 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp); XGI_SetGroup1()
2820 tempcx = ((pVBInfo->VGAHT - pVBInfo->VGAHDE) / 2) >> 2; XGI_SetGroup1()
2821 pushbx = pVBInfo->VGAHDE / 2 + 16; XGI_SetGroup1()
2826 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) { XGI_SetGroup1()
2841 if (tempcx > (pVBInfo->VGAHT / 2)) XGI_SetGroup1()
2842 tempcx = pVBInfo->VGAHT / 2; XGI_SetGroup1()
2846 xgifb_reg_set(pVBInfo->Part1Port, 0x0B, temp); XGI_SetGroup1()
2848 temp = (pVBInfo->VGAHT - 1) & 0x0FF; /* BTVGA2HT 0x08,0x09 */ XGI_SetGroup1()
2849 xgifb_reg_set(pVBInfo->Part1Port, 0x08, temp); XGI_SetGroup1()
2850 temp = (((pVBInfo->VGAHT - 1) & 0xFF00) >> 8) << 4; XGI_SetGroup1()
2851 xgifb_reg_and_or(pVBInfo->Part1Port, 0x09, ~0x0F0, temp); XGI_SetGroup1()
2853 temp = (pVBInfo->VGAHDE + 16) & 0x0FF; XGI_SetGroup1()
2854 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp); XGI_SetGroup1()
2855 tempcx = (pVBInfo->VGAHT - pVBInfo->VGAHDE) >> 2; /* cx */ XGI_SetGroup1()
2856 pushbx = pVBInfo->VGAHDE + 16; XGI_SetGroup1()
2861 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) { XGI_SetGroup1()
2875 if (tempcx > pVBInfo->VGAHT) XGI_SetGroup1()
2876 tempcx = pVBInfo->VGAHT; XGI_SetGroup1()
2879 xgifb_reg_set(pVBInfo->Part1Port, 0x0B, temp); XGI_SetGroup1()
2887 xgifb_reg_set(pVBInfo->Part1Port, 0x0C, temp); XGI_SetGroup1()
2889 xgifb_reg_set(pVBInfo->Part1Port, 0x0D, temp); XGI_SetGroup1()
2890 tempcx = (pVBInfo->VGAVT - 1); XGI_SetGroup1()
2893 xgifb_reg_set(pVBInfo->Part1Port, 0x0E, temp); XGI_SetGroup1()
2894 tempbx = pVBInfo->VGAVDE - 1; XGI_SetGroup1()
2896 xgifb_reg_set(pVBInfo->Part1Port, 0x0F, temp); XGI_SetGroup1()
2899 xgifb_reg_set(pVBInfo->Part1Port, 0x12, temp); XGI_SetGroup1()
2902 tempbx = (pVBInfo->VGAVT + pVBInfo->VGAVDE) >> 1; XGI_SetGroup1()
2904 tempcx = ((pVBInfo->VGAVT - pVBInfo->VGAVDE) >> 4) + tempbx + 1; XGI_SetGroup1()
2906 if (pVBInfo->VBInfo & SetCRT2ToRAMDAC) { XGI_SetGroup1()
2926 xgifb_reg_set(pVBInfo->Part1Port, 0x10, temp); XGI_SetGroup1()
2929 xgifb_reg_set(pVBInfo->Part1Port, 0x11, temp); XGI_SetGroup1()
2938 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2C, ~0x0C0, tempax); XGI_SetGroup1()
2941 static unsigned short XGI_GetVGAHT2(struct vb_device_info *pVBInfo) XGI_GetVGAHT2() argument
2945 tempbx = ((pVBInfo->VGAVT - pVBInfo->VGAVDE) * pVBInfo->RVBHCMAX) XGI_GetVGAHT2()
2947 tempax = (pVBInfo->VT - pVBInfo->VDE) * pVBInfo->RVBHCFACT; XGI_GetVGAHT2()
2948 tempax = (tempax * pVBInfo->HT) / tempbx; XGI_GetVGAHT2()
2954 struct vb_device_info *pVBInfo) XGI_SetLockRegs()
2963 if (!(pVBInfo->VBInfo & SetInSlaveMode)) XGI_SetLockRegs()
2967 xgifb_reg_set(pVBInfo->Part1Port, 0x03, temp); XGI_SetLockRegs()
2970 if (pVBInfo->VBType & (VB_SIS301LV | VB_SIS302LV | VB_XGI301C)) XGI_SetLockRegs()
2973 tempax = pVBInfo->VGAHDE; /* 0x04 Horizontal Display End */ XGI_SetLockRegs()
2981 xgifb_reg_set(pVBInfo->Part1Port, 0x04, temp); XGI_SetLockRegs()
2985 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetLockRegs()
2986 if (!(pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetLockRegs()
2990 if ((pVBInfo->VBInfo & SetCRT2ToHiVision) && XGI_SetLockRegs()
2991 !(pVBInfo->VBType & VB_SIS301LV) && (resinfo == 7)) XGI_SetLockRegs()
2996 xgifb_reg_set(pVBInfo->Part1Port, 0x05, temp); XGI_SetLockRegs()
2998 xgifb_reg_set(pVBInfo->Part1Port, 0x06, 0x03); XGI_SetLockRegs()
3000 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { /* 030226 bainy */ XGI_SetLockRegs()
3001 if (pVBInfo->VBInfo & SetCRT2ToTV) XGI_SetLockRegs()
3002 tempax = pVBInfo->VGAHT; XGI_SetLockRegs()
3004 tempax = XGI_GetVGAHT2(pVBInfo); XGI_SetLockRegs()
3007 if (tempax >= pVBInfo->VGAHT) XGI_SetLockRegs()
3008 tempax = pVBInfo->VGAHT; XGI_SetLockRegs()
3015 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_SetLockRegs()
3019 if (pVBInfo->TVInfo & TVSimuMode) { XGI_SetLockRegs()
3029 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetLockRegs()
3034 if (pVBInfo->VGAHDE >= 800) XGI_SetLockRegs()
3040 if (pVBInfo->LCDResInfo != Panel_1280x960 && XGI_SetLockRegs()
3041 pVBInfo->VGAHDE >= 800) { XGI_SetLockRegs()
3043 if (pVBInfo->VGAHDE >= 1280 && XGI_SetLockRegs()
3044 pVBInfo->LCDResInfo != Panel_1280x960 && XGI_SetLockRegs()
3045 (pVBInfo->LCDInfo & LCDNonExpanding)) XGI_SetLockRegs()
3052 xgifb_reg_set(pVBInfo->Part1Port, 0x07, temp); XGI_SetLockRegs()
3054 xgifb_reg_set(pVBInfo->Part1Port, 0x08, 0); XGI_SetLockRegs()
3056 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetLockRegs()
3057 if (pVBInfo->TVInfo & TVSimuMode) { XGI_SetLockRegs()
3059 if (pVBInfo->TVInfo == SetNTSCTV) { XGI_SetLockRegs()
3060 xgifb_reg_set(pVBInfo->Part1Port, XGI_SetLockRegs()
3062 xgifb_reg_set(pVBInfo->Part1Port, XGI_SetLockRegs()
3065 xgifb_reg_set(pVBInfo->Part1Port, XGI_SetLockRegs()
3067 xgifb_reg_set(pVBInfo->Part1Port, XGI_SetLockRegs()
3074 xgifb_reg_set(pVBInfo->Part1Port, 0x18, 0x03); /* 0x18 SR0B */ XGI_SetLockRegs()
3075 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0xF0, 0x00); XGI_SetLockRegs()
3076 xgifb_reg_set(pVBInfo->Part1Port, 0x09, 0xFF); /* 0x09 Set Max VT */ XGI_SetLockRegs()
3078 tempbx = pVBInfo->VGAVT; XGI_SetLockRegs()
3081 tempbx = pVBInfo->VGAVDE; /* 0x0E Virtical Display End */ XGI_SetLockRegs()
3096 if (pVBInfo->VBInfo & SetCRT2ToLCD) { XGI_SetLockRegs()
3097 if (pVBInfo->LCDResInfo == Panel_1024x768) { XGI_SetLockRegs()
3098 if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { XGI_SetLockRegs()
3110 xgifb_reg_set(pVBInfo->Part1Port, 0x10, temp); XGI_SetLockRegs()
3114 xgifb_reg_set(pVBInfo->Part1Port, 0x0E, temp); XGI_SetLockRegs()
3128 xgifb_reg_set(pVBInfo->Part1Port, 0x0B, temp); XGI_SetLockRegs()
3134 xgifb_reg_set(pVBInfo->Part1Port, 0x11, 0x00); XGI_SetLockRegs()
3146 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_SetLockRegs()
3147 if ((pVBInfo->VBType & VB_SIS301LV) && XGI_SetLockRegs()
3148 !(pVBInfo->TVInfo & TVSetHiVision)) { XGI_SetLockRegs()
3149 if ((pVBInfo->TVInfo & TVSimuMode) && XGI_SetLockRegs()
3150 (pVBInfo->TVInfo & TVSetPAL)) { XGI_SetLockRegs()
3151 if (!(pVBInfo->VBType & VB_SIS301LV) || XGI_SetLockRegs()
3152 !(pVBInfo->TVInfo & XGI_SetLockRegs()
3161 } else if (pVBInfo->TVInfo & TVSimuMode) { XGI_SetLockRegs()
3162 if (pVBInfo->TVInfo & TVSetPAL) { XGI_SetLockRegs()
3163 if (pVBInfo->VBType & VB_SIS301LV) { XGI_SetLockRegs()
3164 if (!(pVBInfo->TVInfo & XGI_SetLockRegs()
3180 if ((pVBInfo->TVInfo & TVSetPAL)) { XGI_SetLockRegs()
3188 xgifb_reg_set(pVBInfo->Part1Port, 0x0C, temp); XGI_SetLockRegs()
3191 xgifb_reg_set(pVBInfo->Part1Port, 0x10, temp); XGI_SetLockRegs()
3197 xgifb_reg_and_or(pVBInfo->Part1Port, 0x0B, 0x0FF, 0x20); XGI_SetLockRegs()
3214 xgifb_reg_set(pVBInfo->Part1Port, 0x0D, temp); XGI_SetLockRegs()
3220 xgifb_reg_set(pVBInfo->Part1Port, 0x0A, temp); /* 0x0A CR07 */ XGI_SetLockRegs()
3222 xgifb_reg_set(pVBInfo->Part1Port, 0x17, temp); /* 0x17 SR0A */ XGI_SetLockRegs()
3228 if (pVBInfo->VBType & (VB_SIS301LV | VB_SIS302LV | VB_XGI301C)) XGI_SetLockRegs()
3231 xgifb_reg_set(pVBInfo->Part1Port, 0x16, temp); /* 0x16 SR01 */ XGI_SetLockRegs()
3232 xgifb_reg_set(pVBInfo->Part1Port, 0x0F, 0); /* 0x0F CR14 */ XGI_SetLockRegs()
3233 xgifb_reg_set(pVBInfo->Part1Port, 0x12, 0); /* 0x12 CR17 */ XGI_SetLockRegs()
3235 if (pVBInfo->LCDInfo & LCDRGB18Bit) XGI_SetLockRegs()
3240 xgifb_reg_set(pVBInfo->Part1Port, 0x1A, temp); /* 0x1A SR0E */ XGI_SetLockRegs()
3244 struct vb_device_info *pVBInfo) XGI_SetGroup2()
3257 if (!(pVBInfo->VBInfo & SetCRT2ToAVIDEO)) XGI_SetGroup2()
3260 if (!(pVBInfo->VBInfo & SetCRT2ToSVIDEO)) XGI_SetGroup2()
3263 if (pVBInfo->VBInfo & SetCRT2ToSCART) XGI_SetGroup2()
3266 if (!(pVBInfo->TVInfo & TVSetPAL)) XGI_SetGroup2()
3269 if (pVBInfo->VBInfo & SetCRT2ToHiVision) XGI_SetGroup2()
3272 if (pVBInfo->TVInfo & (TVSetYPbPr525p | TVSetYPbPr750p)) XGI_SetGroup2()
3277 xgifb_reg_set(pVBInfo->Part2Port, 0x0, tempax); XGI_SetGroup2()
3280 if (pVBInfo->TVInfo & TVSetPAL) XGI_SetGroup2()
3283 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_SetGroup2()
3286 if (pVBInfo->VBInfo & SetInSlaveMode) XGI_SetGroup2()
3289 if (pVBInfo->SetFlag & TVSimuMode) XGI_SetGroup2()
3296 if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { XGI_SetGroup2()
3297 if (pVBInfo->TVInfo & TVSetYPbPr525i) XGI_SetGroup2()
3300 if (pVBInfo->TVInfo & TVSetYPbPr525p) XGI_SetGroup2()
3303 if (pVBInfo->TVInfo & TVSetYPbPr750p) XGI_SetGroup2()
3308 xgifb_reg_set(pVBInfo->Part2Port, i, TimingPoint[j]); XGI_SetGroup2()
3312 xgifb_reg_set(pVBInfo->Part2Port, i, TimingPoint[j]); XGI_SetGroup2()
3314 if (pVBInfo->VBInfo & SetCRT2ToTV) XGI_SetGroup2()
3315 xgifb_reg_and_or(pVBInfo->Part2Port, 0x3A, 0x1F, 0x00); XGI_SetGroup2()
3317 temp = pVBInfo->NewFlickerMode; XGI_SetGroup2()
3319 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0A, 0xFF, temp); XGI_SetGroup2()
3321 if (pVBInfo->TVInfo & TVSetPAL) XGI_SetGroup2()
3326 if (pVBInfo->VDE <= tempax) { XGI_SetGroup2()
3327 tempax -= pVBInfo->VDE; XGI_SetGroup2()
3334 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetGroup2()
3336 if (pVBInfo->VBInfo & (SetCRT2ToAVIDEO XGI_SetGroup2()
3339 tempcx = pVBInfo->VGAHDE; XGI_SetGroup2()
3342 if (pVBInfo->TVInfo & TVSetPAL) XGI_SetGroup2()
3348 xgifb_reg_set(pVBInfo->Part2Port, 0x01, temp); XGI_SetGroup2()
3353 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetGroup2()
3355 if ((pVBInfo->VBInfo & (SetCRT2ToAVIDEO XGI_SetGroup2()
3358 tempcx = pVBInfo->VGAHDE; XGI_SetGroup2()
3361 if (pVBInfo->TVInfo & TVSetPAL) XGI_SetGroup2()
3366 xgifb_reg_set(pVBInfo->Part2Port, 0x02, temp); XGI_SetGroup2()
3370 tempcx = pVBInfo->HT; XGI_SetGroup2()
3372 if (XGI_IsLCDDualLink(pVBInfo)) XGI_SetGroup2()
3377 xgifb_reg_set(pVBInfo->Part2Port, 0x1B, temp); XGI_SetGroup2()
3380 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1D, ~0x0F, temp); XGI_SetGroup2()
3382 tempcx = pVBInfo->HT >> 1; XGI_SetGroup2()
3386 if (pVBInfo->VBInfo & SetCRT2ToHiVision) XGI_SetGroup2()
3391 xgifb_reg_and_or(pVBInfo->Part2Port, 0x22, 0x0F, temp); XGI_SetGroup2()
3397 xgifb_reg_set(pVBInfo->Part2Port, 0x24, temp); XGI_SetGroup2()
3400 xgifb_reg_and_or(pVBInfo->Part2Port, 0x25, 0x0F, temp); XGI_SetGroup2()
3404 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_SetGroup2()
3410 xgifb_reg_and_or(pVBInfo->Part2Port, 0x29, 0x0F, temp); XGI_SetGroup2()
3415 xgifb_reg_set(pVBInfo->Part2Port, 0x27, temp); XGI_SetGroup2()
3417 xgifb_reg_and_or(pVBInfo->Part2Port, 0x28, 0x0F, temp); XGI_SetGroup2()
3420 if (pVBInfo->VBInfo & SetCRT2ToHiVision) XGI_SetGroup2()
3425 xgifb_reg_and_or(pVBInfo->Part2Port, 0x2A, 0x0F, temp); XGI_SetGroup2()
3433 xgifb_reg_and_or(pVBInfo->Part2Port, 0x2D, 0x0F, temp); XGI_SetGroup2()
3437 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) { XGI_SetGroup2()
3438 tempax = XGI_GetVGAHT2(pVBInfo); XGI_SetGroup2()
3442 xgifb_reg_set(pVBInfo->Part2Port, 0x2E, temp); XGI_SetGroup2()
3444 tempbx = pVBInfo->VDE; XGI_SetGroup2()
3446 if (pVBInfo->VGAVDE == 360) XGI_SetGroup2()
3448 if (pVBInfo->VGAVDE == 375) XGI_SetGroup2()
3450 if (pVBInfo->VGAVDE == 405) XGI_SetGroup2()
3453 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetGroup2()
3454 if (pVBInfo->VBType & XGI_SetGroup2()
3456 if (!(pVBInfo->TVInfo & XGI_SetGroup2()
3466 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_SetGroup2()
3467 if (pVBInfo->VBType & VB_SIS301LV) { XGI_SetGroup2()
3468 if (pVBInfo->TVInfo & TVSetHiVision) { XGI_SetGroup2()
3469 if (pVBInfo->VBInfo & SetInSlaveMode) { XGI_SetGroup2()
3474 } else if (pVBInfo->VBInfo & SetInSlaveMode) { XGI_SetGroup2()
3480 xgifb_reg_set(pVBInfo->Part2Port, 0x2F, temp); XGI_SetGroup2()
3485 if (!(pVBInfo->VBInfo & SetCRT2ToHiVision)) { XGI_SetGroup2()
3486 if (pVBInfo->VBType & VB_SIS301LV) { XGI_SetGroup2()
3487 if (pVBInfo->TVInfo & TVSetHiVision) { XGI_SetGroup2()
3490 if (!(pVBInfo->VBInfo & SetCRT2ToSVIDEO)) XGI_SetGroup2()
3495 if (!(pVBInfo->VBInfo & SetCRT2ToSVIDEO)) XGI_SetGroup2()
3500 xgifb_reg_set(pVBInfo->Part2Port, 0x30, temp); XGI_SetGroup2()
3502 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetGroup2()
3504 tempbx = pVBInfo->VDE; XGI_SetGroup2()
3507 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetGroup2()
3508 if (!(pVBInfo->TVInfo & (TVSetYPbPr525p XGI_SetGroup2()
3513 if (pVBInfo->VBType & (VB_SIS302LV | VB_XGI301C)) { XGI_SetGroup2()
3521 xgifb_reg_set(pVBInfo->Part4Port, 0x10, temp); XGI_SetGroup2()
3525 xgifb_reg_set(pVBInfo->Part2Port, 0x46, temp); XGI_SetGroup2()
3527 xgifb_reg_set(pVBInfo->Part2Port, 0x47, temp); XGI_SetGroup2()
3533 tempcx = pVBInfo->VGAHDE; XGI_SetGroup2()
3534 if (tempcx >= pVBInfo->HDE) { XGI_SetGroup2()
3542 if (pVBInfo->VBInfo & SetCRT2ToTV) { /*301b*/ XGI_SetGroup2()
3543 if (pVBInfo->VGAHDE >= 1024) { XGI_SetGroup2()
3545 if (pVBInfo->VGAHDE >= 1280) { XGI_SetGroup2()
3557 tempeax = pVBInfo->VGAHDE; XGI_SetGroup2()
3566 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetGroup2()
3572 tempecx = pVBInfo->HDE; XGI_SetGroup2()
3581 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetGroup2()
3597 xgifb_reg_set(pVBInfo->Part2Port, 0x44, temp); XGI_SetGroup2()
3599 xgifb_reg_and_or(pVBInfo->Part2Port, 0x45, ~0x03F, temp); XGI_SetGroup2()
3605 if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) XGI_SetGroup2()
3608 xgifb_reg_and_or(pVBInfo->Part2Port, 0x46, ~0x1F, temp); XGI_SetGroup2()
3609 if (pVBInfo->TVInfo & TVSetPAL) { XGI_SetGroup2()
3618 xgifb_reg_set(pVBInfo->Part2Port, 0x4b, temp); XGI_SetGroup2()
3620 xgifb_reg_set(pVBInfo->Part2Port, 0x4c, temp); XGI_SetGroup2()
3626 if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { XGI_SetGroup2()
3629 if (pVBInfo->TVInfo & TVSetYPbPr525p) XGI_SetGroup2()
3632 if (pVBInfo->TVInfo & TVSetYPbPr750p) XGI_SetGroup2()
3636 xgifb_reg_set(pVBInfo->Part2Port, 0x4d, temp); XGI_SetGroup2()
3637 temp = xgifb_reg_get(pVBInfo->Part2Port, 0x43); /* 301b change */ XGI_SetGroup2()
3638 xgifb_reg_set(pVBInfo->Part2Port, 0x43, (unsigned short) (temp - 3)); XGI_SetGroup2()
3640 if (!(pVBInfo->TVInfo & (TVSetYPbPr525p | TVSetYPbPr750p))) { XGI_SetGroup2()
3641 if (pVBInfo->TVInfo & NTSC1024x768) { XGI_SetGroup2()
3644 xgifb_reg_set(pVBInfo->Part2Port, i, XGI_SetGroup2()
3647 xgifb_reg_set(pVBInfo->Part2Port, 0x43, 0x72); XGI_SetGroup2()
3652 if (pVBInfo->VBType & VB_XGI301C) { XGI_SetGroup2()
3653 if (pVBInfo->TVInfo & TVSetPALM) XGI_SetGroup2()
3654 xgifb_reg_and_or(pVBInfo->Part2Port, 0x4E, ~0x08, XGI_SetGroup2()
3658 if (pVBInfo->TVInfo & TVSetPALM) { XGI_SetGroup2()
3659 tempax = xgifb_reg_get(pVBInfo->Part2Port, 0x01); XGI_SetGroup2()
3661 xgifb_reg_and(pVBInfo->Part2Port, 0x01, tempax); XGI_SetGroup2()
3663 xgifb_reg_and(pVBInfo->Part2Port, 0x00, 0xEF); XGI_SetGroup2()
3666 if (pVBInfo->VBInfo & SetCRT2ToHiVision) { XGI_SetGroup2()
3667 if (!(pVBInfo->VBInfo & SetInSlaveMode)) XGI_SetGroup2()
3668 xgifb_reg_set(pVBInfo->Part2Port, 0x0B, 0x00); XGI_SetGroup2()
3673 struct vb_device_info *pVBInfo) XGI_SetLCDRegs()
3681 if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) XGI_SetLCDRegs()
3684 tempbx = pVBInfo->HDE; /* RHACTE=HDE-1 */ XGI_SetLCDRegs()
3686 if (XGI_IsLCDDualLink(pVBInfo)) XGI_SetLCDRegs()
3691 xgifb_reg_set(pVBInfo->Part2Port, 0x2C, temp); XGI_SetLCDRegs()
3694 xgifb_reg_and_or(pVBInfo->Part2Port, 0x2B, 0x0F, temp); XGI_SetLCDRegs()
3697 xgifb_reg_set(pVBInfo->Part2Port, 0x0B, temp); XGI_SetLCDRegs()
3698 tempbx = pVBInfo->VDE; /* RTVACTEO=(VDE-1)&0xFF */ XGI_SetLCDRegs()
3701 xgifb_reg_set(pVBInfo->Part2Port, 0x03, temp); XGI_SetLCDRegs()
3703 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0C, ~0x07, temp); XGI_SetLCDRegs()
3705 tempcx = pVBInfo->VT - 1; XGI_SetLCDRegs()
3707 xgifb_reg_set(pVBInfo->Part2Port, 0x19, temp); XGI_SetLCDRegs()
3710 xgifb_reg_set(pVBInfo->Part2Port, 0x1A, temp); XGI_SetLCDRegs()
3711 xgifb_reg_and_or(pVBInfo->Part2Port, 0x09, 0xF0, 0x00); XGI_SetLCDRegs()
3712 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0A, 0xF0, 0x00); XGI_SetLCDRegs()
3713 xgifb_reg_and_or(pVBInfo->Part2Port, 0x17, 0xFB, 0x00); XGI_SetLCDRegs()
3714 xgifb_reg_and_or(pVBInfo->Part2Port, 0x18, 0xDF, 0x00); XGI_SetLCDRegs()
3717 if ((pVBInfo->VBType & VB_SIS301LV) || (pVBInfo->VBType & VB_SIS302LV)) XGI_SetLCDRegs()
3719 pVBInfo); XGI_SetLCDRegs()
3722 pVBInfo); XGI_SetLCDRegs()
3724 tempah = pVBInfo->LCDResInfo; XGI_SetLCDRegs()
3742 if (pVBInfo->LCDInfo & EnableScalingLCD) { XGI_SetLCDRegs()
3743 tempbx = pVBInfo->HDE; XGI_SetLCDRegs()
3744 tempcx = pVBInfo->VDE; XGI_SetLCDRegs()
3748 tempax = pVBInfo->VT; XGI_SetLCDRegs()
3749 pVBInfo->LCDHDES = LCDBDesPtr->LCDHDES; XGI_SetLCDRegs()
3750 pVBInfo->LCDHRS = LCDBDesPtr->LCDHRS; XGI_SetLCDRegs()
3751 pVBInfo->LCDVDES = LCDBDesPtr->LCDVDES; XGI_SetLCDRegs()
3752 pVBInfo->LCDVRS = LCDBDesPtr->LCDVRS; XGI_SetLCDRegs()
3753 tempbx = pVBInfo->LCDVDES; XGI_SetLCDRegs()
3760 xgifb_reg_set(pVBInfo->Part2Port, 0x05, temp); XGI_SetLCDRegs()
3762 xgifb_reg_set(pVBInfo->Part2Port, 0x06, temp); XGI_SetLCDRegs()
3768 xgifb_reg_set(pVBInfo->Part2Port, 0x02, tempah); XGI_SetLCDRegs()
3771 XGI_GetLCDSync(&tempax, &tempbx, pVBInfo); XGI_SetLCDRegs()
3773 tempax = pVBInfo->VT; XGI_SetLCDRegs()
3774 tempbx = pVBInfo->LCDVRS; XGI_SetLCDRegs()
3781 xgifb_reg_set(pVBInfo->Part2Port, 0x04, temp); XGI_SetLCDRegs()
3785 xgifb_reg_set(pVBInfo->Part2Port, 0x01, temp); XGI_SetLCDRegs()
3787 tempax = pVBInfo->HT; XGI_SetLCDRegs()
3788 tempbx = pVBInfo->LCDHDES; XGI_SetLCDRegs()
3791 if (XGI_IsLCDDualLink(pVBInfo)) { XGI_SetLCDRegs()
3797 if (pVBInfo->VBType & VB_SIS302LV) XGI_SetLCDRegs()
3800 if (pVBInfo->VBType & VB_XGI301C) /* tap4 */ XGI_SetLCDRegs()
3809 xgifb_reg_set(pVBInfo->Part2Port, 0x1F, temp); /* RHBLKE=lcdhdes */ XGI_SetLCDRegs()
3811 xgifb_reg_set(pVBInfo->Part2Port, 0x20, temp); XGI_SetLCDRegs()
3813 xgifb_reg_set(pVBInfo->Part2Port, 0x23, temp); /* RHEQPLE=lcdhdee */ XGI_SetLCDRegs()
3815 xgifb_reg_set(pVBInfo->Part2Port, 0x25, temp); XGI_SetLCDRegs()
3817 XGI_GetLCDSync(&tempax, &tempbx, pVBInfo); XGI_SetLCDRegs()
3819 tempax = pVBInfo->HT; XGI_SetLCDRegs()
3820 tempbx = pVBInfo->LCDHRS; XGI_SetLCDRegs()
3821 if (XGI_IsLCDDualLink(pVBInfo)) { XGI_SetLCDRegs()
3827 if (pVBInfo->VBType & VB_SIS302LV) XGI_SetLCDRegs()
3836 xgifb_reg_set(pVBInfo->Part2Port, 0x1C, temp); XGI_SetLCDRegs()
3840 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1D, ~0x0F0, temp); XGI_SetLCDRegs()
3842 xgifb_reg_set(pVBInfo->Part2Port, 0x21, temp); XGI_SetLCDRegs()
3844 if (!(pVBInfo->LCDInfo & XGI_LCDVESATiming)) { XGI_SetLCDRegs()
3845 if (pVBInfo->VGAVDE == 525) { XGI_SetLCDRegs()
3846 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B XGI_SetLCDRegs()
3853 xgifb_reg_set(pVBInfo->Part2Port, 0x2f, temp); XGI_SetLCDRegs()
3854 xgifb_reg_set(pVBInfo->Part2Port, 0x30, 0xB3); XGI_SetLCDRegs()
3857 if (pVBInfo->VGAVDE == 420) { XGI_SetLCDRegs()
3858 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B XGI_SetLCDRegs()
3864 xgifb_reg_set(pVBInfo->Part2Port, 0x2f, temp); XGI_SetLCDRegs()
3876 *XGI_GetTap4Ptr(unsigned short tempcx, struct vb_device_info *pVBInfo) XGI_GetTap4Ptr() argument
3882 tempax = pVBInfo->VGAHDE; XGI_GetTap4Ptr()
3883 tempbx = pVBInfo->HDE; XGI_GetTap4Ptr()
3885 tempax = pVBInfo->VGAVDE; XGI_GetTap4Ptr()
3886 tempbx = pVBInfo->VDE; XGI_GetTap4Ptr()
3893 if (pVBInfo->TVInfo & TVSetPAL) XGI_GetTap4Ptr()
3896 if (pVBInfo->VBInfo & SetCRT2ToYPbPr525750) { XGI_GetTap4Ptr()
3897 if ((pVBInfo->TVInfo & TVSetYPbPr525i) || XGI_GetTap4Ptr()
3898 (pVBInfo->TVInfo & TVSetYPbPr525p)) XGI_GetTap4Ptr()
3900 if (pVBInfo->TVInfo & TVSetYPbPr750p) XGI_GetTap4Ptr()
3904 if (pVBInfo->VBInfo & SetCRT2ToHiVision) XGI_GetTap4Ptr()
3916 static void XGI_SetTap4Regs(struct vb_device_info *pVBInfo) XGI_SetTap4Regs() argument
3921 if (!(pVBInfo->VBType & VB_XGI301C)) XGI_SetTap4Regs()
3924 Tap4TimingPtr = XGI_GetTap4Ptr(0, pVBInfo); /* Set Horizontal Scaling */ XGI_SetTap4Regs()
3926 xgifb_reg_set(pVBInfo->Part2Port, i, Tap4TimingPtr->Reg[j]); XGI_SetTap4Regs()
3928 if ((pVBInfo->VBInfo & SetCRT2ToTV) && XGI_SetTap4Regs()
3929 (!(pVBInfo->VBInfo & SetCRT2ToHiVision))) { XGI_SetTap4Regs()
3931 Tap4TimingPtr = XGI_GetTap4Ptr(1, pVBInfo); XGI_SetTap4Regs()
3933 xgifb_reg_set(pVBInfo->Part2Port, XGI_SetTap4Regs()
3938 if ((pVBInfo->VBInfo & SetCRT2ToTV) && XGI_SetTap4Regs()
3939 (!(pVBInfo->VBInfo & SetCRT2ToHiVision))) XGI_SetTap4Regs()
3941 xgifb_reg_and_or(pVBInfo->Part2Port, 0x4E, ~0x14, 0x04); XGI_SetTap4Regs()
3944 xgifb_reg_and_or(pVBInfo->Part2Port, 0x4E, ~0x14, 0x10); XGI_SetTap4Regs()
3948 struct vb_device_info *pVBInfo) XGI_SetGroup3()
3957 xgifb_reg_set(pVBInfo->Part3Port, 0x00, 0x00); XGI_SetGroup3()
3958 if (pVBInfo->TVInfo & TVSetPAL) { XGI_SetGroup3()
3959 xgifb_reg_set(pVBInfo->Part3Port, 0x13, 0xFA); XGI_SetGroup3()
3960 xgifb_reg_set(pVBInfo->Part3Port, 0x14, 0xC8); XGI_SetGroup3()
3962 xgifb_reg_set(pVBInfo->Part3Port, 0x13, 0xF5); XGI_SetGroup3()
3963 xgifb_reg_set(pVBInfo->Part3Port, 0x14, 0xB7); XGI_SetGroup3()
3966 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) XGI_SetGroup3()
3969 if (pVBInfo->TVInfo & TVSetPALM) { XGI_SetGroup3()
3970 xgifb_reg_set(pVBInfo->Part3Port, 0x13, 0xFA); XGI_SetGroup3()
3971 xgifb_reg_set(pVBInfo->Part3Port, 0x14, 0xC8); XGI_SetGroup3()
3972 xgifb_reg_set(pVBInfo->Part3Port, 0x3D, 0xA8); XGI_SetGroup3()
3975 if ((pVBInfo->VBInfo & SetCRT2ToHiVision) || (pVBInfo->VBInfo XGI_SetGroup3()
3977 if (pVBInfo->TVInfo & TVSetYPbPr525i) XGI_SetGroup3()
3981 if (pVBInfo->SetFlag & TVSimuMode) { XGI_SetGroup3()
3987 if (pVBInfo->TVInfo & TVSetYPbPr525p) XGI_SetGroup3()
3990 if (pVBInfo->TVInfo & TVSetYPbPr750p) XGI_SetGroup3()
3994 xgifb_reg_set(pVBInfo->Part3Port, i, tempdi[i]); XGI_SetGroup3()
3996 if (pVBInfo->VBType & VB_XGI301C) { /* Marcovision */ XGI_SetGroup3()
3997 if (pVBInfo->TVInfo & TVSetYPbPr525p) XGI_SetGroup3()
3998 xgifb_reg_set(pVBInfo->Part3Port, 0x28, 0x3f); XGI_SetGroup3()
4005 struct vb_device_info *pVBInfo) XGI_SetGroup4()
4013 temp = pVBInfo->RVBHCFACT; XGI_SetGroup4()
4014 xgifb_reg_set(pVBInfo->Part4Port, 0x13, temp); XGI_SetGroup4()
4016 tempbx = pVBInfo->RVBHCMAX; XGI_SetGroup4()
4018 xgifb_reg_set(pVBInfo->Part4Port, 0x14, temp); XGI_SetGroup4()
4020 tempcx = pVBInfo->VGAHT - 1; XGI_SetGroup4()
4022 xgifb_reg_set(pVBInfo->Part4Port, 0x16, temp); XGI_SetGroup4()
4027 tempcx = pVBInfo->VGAVT - 1; XGI_SetGroup4()
4028 if (!(pVBInfo->VBInfo & SetCRT2ToTV)) XGI_SetGroup4()
4032 xgifb_reg_set(pVBInfo->Part4Port, 0x17, temp); XGI_SetGroup4()
4034 xgifb_reg_set(pVBInfo->Part4Port, 0x15, temp); XGI_SetGroup4()
4035 xgifb_reg_or(pVBInfo->Part4Port, 0x0D, 0x08); XGI_SetGroup4()
4036 tempcx = pVBInfo->VBInfo; XGI_SetGroup4()
4037 tempbx = pVBInfo->VGAHDE; XGI_SetGroup4()
4042 if (XGI_IsLCDDualLink(pVBInfo)) XGI_SetGroup4()
4057 if (pVBInfo->VBInfo & SetCRT2ToLCD) { XGI_SetGroup4()
4064 if (pVBInfo->TVInfo & (TVSetYPbPr525p | TVSetYPbPr750p)) { XGI_SetGroup4()
4066 if (pVBInfo->VGAHDE == 1280) XGI_SetGroup4()
4068 if (pVBInfo->VGAHDE == 1024) XGI_SetGroup4()
4071 xgifb_reg_and_or(pVBInfo->Part4Port, 0x0E, ~0xEF, temp); XGI_SetGroup4()
4073 tempebx = pVBInfo->VDE; XGI_SetGroup4()
4075 tempcx = pVBInfo->RVBHRS; XGI_SetGroup4()
4077 xgifb_reg_set(pVBInfo->Part4Port, 0x18, temp); XGI_SetGroup4()
4079 tempeax = pVBInfo->VGAVDE; XGI_SetGroup4()
4084 tempeax = pVBInfo->VGAVDE; XGI_SetGroup4()
4097 xgifb_reg_set(pVBInfo->Part4Port, 0x1B, temp); XGI_SetGroup4()
4100 xgifb_reg_set(pVBInfo->Part4Port, 0x1A, temp); XGI_SetGroup4()
4105 xgifb_reg_set(pVBInfo->Part4Port, 0x19, temp); XGI_SetGroup4()
4108 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetGroup4()
4111 xgifb_reg_set(pVBInfo->Part4Port, 0x1C, temp); XGI_SetGroup4()
4112 tempax = pVBInfo->VGAHDE; XGI_SetGroup4()
4116 if (XGI_IsLCDDualLink(pVBInfo)) XGI_SetGroup4()
4119 if (pVBInfo->VBInfo & SetCRT2ToLCD) { XGI_SetGroup4()
4122 } else if (pVBInfo->VGAHDE > 800) { XGI_SetGroup4()
4123 if (pVBInfo->VGAHDE == 1024) XGI_SetGroup4()
4132 xgifb_reg_set(pVBInfo->Part4Port, 0x1E, temp); XGI_SetGroup4()
4134 xgifb_reg_set(pVBInfo->Part4Port, 0x1D, temp); XGI_SetGroup4()
4136 if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToHiVision)) { XGI_SetGroup4()
4137 if (pVBInfo->VGAHDE > 800) XGI_SetGroup4()
4138 xgifb_reg_or(pVBInfo->Part4Port, 0x1E, 0x08); XGI_SetGroup4()
4143 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetGroup4()
4144 if (!(pVBInfo->TVInfo & (NTSC1024x768 XGI_SetGroup4()
4148 if ((pVBInfo->VBInfo & SetInSlaveMode) XGI_SetGroup4()
4149 && (!(pVBInfo->TVInfo XGI_SetGroup4()
4155 xgifb_reg_and_or(pVBInfo->Part4Port, 0x1F, 0x00C0, temp); XGI_SetGroup4()
4156 tempbx = pVBInfo->HT; XGI_SetGroup4()
4157 if (XGI_IsLCDDualLink(pVBInfo)) XGI_SetGroup4()
4161 xgifb_reg_and_or(pVBInfo->Part4Port, 0x21, 0x00C0, temp); XGI_SetGroup4()
4163 xgifb_reg_set(pVBInfo->Part4Port, 0x22, temp); XGI_SetGroup4()
4167 XGI_SetCRT2VCLK(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetGroup4()
4170 static void XGINew_EnableCRT2(struct vb_device_info *pVBInfo) XGINew_EnableCRT2() argument
4172 xgifb_reg_and_or(pVBInfo->P3c4, 0x1E, 0xFF, 0x20); XGINew_EnableCRT2()
4175 static void XGI_SetGroup5(struct vb_device_info *pVBInfo) XGI_SetGroup5() argument
4177 if (pVBInfo->ModeType == ModeVGA) { XGI_SetGroup5()
4178 if (!(pVBInfo->VBInfo & (SetInSlaveMode | LoadDACFlag XGI_SetGroup5()
4180 XGINew_EnableCRT2(pVBInfo); XGI_SetGroup5()
4185 static void XGI_DisableGatingCRT(struct vb_device_info *pVBInfo) XGI_DisableGatingCRT() argument
4187 xgifb_reg_and_or(pVBInfo->P3d4, 0x63, 0xBF, 0x00); XGI_DisableGatingCRT()
4230 struct vb_device_info *pVBInfo) xgifb_set_lvds()
4241 Miscdata = inb(pVBInfo->P3cc); xgifb_set_lvds()
4243 outb((Miscdata & 0x3F) | temp, pVBInfo->P3c2); xgifb_set_lvds()
4247 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x80, temp & 0x80); xgifb_set_lvds()
4249 xgifb_reg_and_or(pVBInfo->P3c4, 0x30, ~0x20, (temp & 0x40) >> 1); xgifb_set_lvds()
4252 XGI_SetXG27FPBits(pVBInfo); xgifb_set_lvds()
4254 XGI_SetXG21FPBits(pVBInfo); xgifb_set_lvds()
4301 temp = xgifb_reg_get(pVBInfo->P3d4, 0x11); xgifb_set_lvds()
4302 xgifb_reg_set(pVBInfo->P3d4, 0x11, temp & 0x7f); /* Unlock CRTC */ xgifb_set_lvds()
4305 xgifb_reg_or(pVBInfo->P3c4, 0x1, 0x1); xgifb_set_lvds()
4309 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0x03, (value & 0x300) >> 8); xgifb_set_lvds()
4310 xgifb_reg_set(pVBInfo->P3d4, 0x0, (value & 0xFF)); xgifb_set_lvds()
4314 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0x30, (value & 0x300) >> 4); xgifb_set_lvds()
4315 xgifb_reg_set(pVBInfo->P3d4, 0x2, (value & 0xFF)); xgifb_set_lvds()
4319 xgifb_reg_and_or(pVBInfo->P3c4, 0x0C, ~0x03, (value & 0xC0) >> 6); xgifb_set_lvds()
4320 xgifb_reg_and_or(pVBInfo->P3d4, 0x05, ~0x80, (value & 0x20) << 2); xgifb_set_lvds()
4321 xgifb_reg_and_or(pVBInfo->P3d4, 0x03, ~0x1F, value & 0x1F); xgifb_set_lvds()
4325 xgifb_reg_and_or(pVBInfo->P3c4, 0x0B, ~0xC0, (value & 0x300) >> 2); xgifb_set_lvds()
4326 xgifb_reg_set(pVBInfo->P3d4, 0x4, (value & 0xFF)); xgifb_set_lvds()
4330 xgifb_reg_and_or(pVBInfo->P3c4, 0x2F, ~0x03, (value & 0x300) >> 8); xgifb_set_lvds()
4331 xgifb_reg_set(pVBInfo->P3c4, 0x2E, (value & 0xFF)); xgifb_set_lvds()
4335 xgifb_reg_and_or(pVBInfo->P3c4, 0x0C, ~0x04, (value & 0x20) >> 3); xgifb_set_lvds()
4336 xgifb_reg_and_or(pVBInfo->P3d4, 0x05, ~0x1F, value & 0x1F); xgifb_set_lvds()
4340 xgifb_reg_and_or(pVBInfo->P3c4, 0x2F, ~0xFC, value << 2); xgifb_set_lvds()
4344 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x01, (value & 0x400) >> 10); xgifb_set_lvds()
4345 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x20, (value & 0x200) >> 4); xgifb_set_lvds()
4346 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x01, (value & 0x100) >> 8); xgifb_set_lvds()
4347 xgifb_reg_set(pVBInfo->P3d4, 0x06, (value & 0xFF)); xgifb_set_lvds()
4351 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x04, (value & 0x400) >> 8); xgifb_set_lvds()
4352 xgifb_reg_and_or(pVBInfo->P3d4, 0x09, ~0x20, (value & 0x200) >> 4); xgifb_set_lvds()
4353 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x08, (value & 0x100) >> 5); xgifb_set_lvds()
4354 xgifb_reg_set(pVBInfo->P3d4, 0x15, (value & 0xFF)); xgifb_set_lvds()
4358 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x10, (value & 0x100) >> 4); xgifb_set_lvds()
4359 xgifb_reg_set(pVBInfo->P3d4, 0x16, (value & 0xFF)); xgifb_set_lvds()
4363 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x08, (value & 0x400) >> 7); xgifb_set_lvds()
4364 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x80, (value & 0x200) >> 2); xgifb_set_lvds()
4365 xgifb_reg_and_or(pVBInfo->P3d4, 0x07, ~0x04, (value & 0x100) >> 6); xgifb_set_lvds()
4366 xgifb_reg_set(pVBInfo->P3d4, 0x10, (value & 0xFF)); xgifb_set_lvds()
4370 xgifb_reg_and_or(pVBInfo->P3c4, 0x35, ~0x07, xgifb_set_lvds()
4372 xgifb_reg_set(pVBInfo->P3c4, 0x34, value & 0xFF); xgifb_set_lvds()
4375 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0x03, xgifb_set_lvds()
4377 xgifb_reg_set(pVBInfo->P3c4, 0x34, (value >> 1) & 0xFF); xgifb_set_lvds()
4378 xgifb_reg_and_or(pVBInfo->P3d4, 0x33, ~0x01, value & 0x01); xgifb_set_lvds()
4383 xgifb_reg_and_or(pVBInfo->P3c4, 0x0A, ~0x20, (value & 0x10) << 1); xgifb_set_lvds()
4384 xgifb_reg_and_or(pVBInfo->P3d4, 0x11, ~0x0F, value & 0x0F); xgifb_set_lvds()
4388 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, xgifb_set_lvds()
4392 xgifb_reg_and_or(pVBInfo->P3c4, 0x3F, ~0xFC, xgifb_set_lvds()
4397 xgifb_reg_and_or(pVBInfo->P3c4, 0x31, ~0x30, value); xgifb_set_lvds()
4398 xgifb_reg_set(pVBInfo->P3c4, xgifb_set_lvds()
4400 xgifb_reg_set(pVBInfo->P3c4, xgifb_set_lvds()
4406 inb(pVBInfo->P3da); /* reset 3da */ xgifb_set_lvds()
4407 outb(0x13, pVBInfo->P3c0); /* set index */ xgifb_set_lvds()
4409 outb(0x00, pVBInfo->P3c0); xgifb_set_lvds()
4411 inb(pVBInfo->P3da); /* Enable Attribute */ xgifb_set_lvds()
4412 outb(0x20, pVBInfo->P3c0); xgifb_set_lvds()
4414 inb(pVBInfo->P3da); /* reset 3da */ xgifb_set_lvds()
4426 static unsigned char XGI_IsLCDON(struct vb_device_info *pVBInfo) XGI_IsLCDON() argument
4430 tempax = pVBInfo->VBInfo; XGI_IsLCDON()
4441 struct vb_device_info *pVBInfo) XGI_DisableBridge()
4445 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_DisableBridge()
4448 if (!(pVBInfo->VBInfo & XGI_DisableBridge()
4450 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { XGI_DisableBridge()
4451 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) XGI_DisableBridge()
4457 xgifb_reg_and(pVBInfo->Part4Port, 0x1F, tempah); XGI_DisableBridge()
4459 if (pVBInfo->VBType & (VB_SIS302LV | VB_XGI301C)) { XGI_DisableBridge()
4460 if (((pVBInfo->VBInfo & XGI_DisableBridge()
4462 (XGI_IsLCDON(pVBInfo))) XGI_DisableBridge()
4464 xgifb_reg_or(pVBInfo->Part4Port, 0x30, 0x80); XGI_DisableBridge()
4467 if (pVBInfo->VBInfo & (DisableCRT2Display | XGI_SetCRT2ToLCDA | XGI_DisableBridge()
4469 XGI_DisplayOff(xgifb_info, HwDeviceExtension, pVBInfo); XGI_DisableBridge()
4471 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) XGI_DisableBridge()
4473 xgifb_reg_and(pVBInfo->Part1Port, 0x1e, 0xdf); XGI_DisableBridge()
4476 xgifb_reg_and(pVBInfo->P3c4, 0x32, 0xdf); XGI_DisableBridge()
4478 if ((pVBInfo->VBInfo & (SetSimuScanMode | SetCRT2ToDualEdge))) XGI_DisableBridge()
4479 xgifb_reg_and(pVBInfo->Part2Port, 0x00, 0xdf); XGI_DisableBridge()
4481 if ((pVBInfo->VBInfo & XGI_DisableBridge()
4483 ((!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) && XGI_DisableBridge()
4484 (pVBInfo->VBInfo & XGI_DisableBridge()
4486 xgifb_reg_or(pVBInfo->Part1Port, 0x00, 0x80); XGI_DisableBridge()
4488 if ((pVBInfo->VBInfo & XGI_DisableBridge()
4490 (!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) || XGI_DisableBridge()
4491 (pVBInfo->VBInfo & XGI_DisableBridge()
4494 tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x00); XGI_DisableBridge()
4496 xgifb_reg_or(pVBInfo->Part1Port, 0x00, 0x10); XGI_DisableBridge()
4498 xgifb_reg_and(pVBInfo->Part1Port, 0x1E, 0xDF); XGI_DisableBridge()
4500 xgifb_reg_set(pVBInfo->Part1Port, 0x00, tempah); XGI_DisableBridge()
4503 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToTV)) { XGI_DisableBridge()
4504 xgifb_reg_or(pVBInfo->Part1Port, 0x00, 0x80); XGI_DisableBridge()
4506 xgifb_reg_and(pVBInfo->Part1Port, 0x1E, 0xDF); XGI_DisableBridge()
4508 xgifb_reg_and(pVBInfo->P3c4, 0x32, 0xDF); XGI_DisableBridge()
4511 if (pVBInfo->VBInfo & (DisableCRT2Display | XGI_SetCRT2ToLCDA XGI_DisableBridge()
4513 XGI_DisplayOff(xgifb_info, HwDeviceExtension, pVBInfo); XGI_DisableBridge()
4534 static unsigned short XGI_GetTVPtrIndex(struct vb_device_info *pVBInfo) XGI_GetTVPtrIndex() argument
4538 if (pVBInfo->TVInfo & TVSetPAL) XGI_GetTVPtrIndex()
4540 if (pVBInfo->TVInfo & TVSetHiVision) XGI_GetTVPtrIndex()
4542 if (pVBInfo->TVInfo & TVSetYPbPr525i) XGI_GetTVPtrIndex()
4544 if (pVBInfo->TVInfo & TVSetYPbPr525p) XGI_GetTVPtrIndex()
4546 if (pVBInfo->TVInfo & TVSetYPbPr750p) XGI_GetTVPtrIndex()
4548 if (pVBInfo->TVInfo & TVSimuMode) XGI_GetTVPtrIndex()
4571 unsigned char *tempch, struct vb_device_info *pVBInfo) XGI_GetTVPtrIndex2()
4577 if (pVBInfo->TVInfo & TVSetPAL) XGI_GetTVPtrIndex2()
4580 if (pVBInfo->TVInfo & TVSetPALM) XGI_GetTVPtrIndex2()
4583 if (pVBInfo->TVInfo & TVSetPALN) XGI_GetTVPtrIndex2()
4586 if (pVBInfo->TVInfo & NTSC1024x768) { XGI_GetTVPtrIndex2()
4588 if (pVBInfo->TVInfo & TVSetPALM) XGI_GetTVPtrIndex2()
4592 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_GetTVPtrIndex2()
4594 if ((!(pVBInfo->VBInfo & SetInSlaveMode)) || (pVBInfo->TVInfo XGI_GetTVPtrIndex2()
4601 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_GetTVPtrIndex2()
4606 static void XGI_SetDelayComp(struct vb_device_info *pVBInfo) XGI_SetDelayComp() argument
4610 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetDelayComp()
4612 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA XGI_SetDelayComp()
4617 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) XGI_SetDelayComp()
4619 if (pVBInfo->VBInfo & XGI_SetDelayComp()
4623 if (!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) XGI_SetDelayComp()
4629 tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x2D); XGI_SetDelayComp()
4631 if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToLCD XGI_SetDelayComp()
4637 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { XGI_SetDelayComp()
4642 xgifb_reg_set(pVBInfo->Part1Port, 0x2D, tempah); XGI_SetDelayComp()
4648 struct vb_device_info *pVBInfo) XGI_SetLCDCap_A()
4652 temp = xgifb_reg_get(pVBInfo->P3d4, 0x37); XGI_SetLCDCap_A()
4655 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0x0F, XGI_SetLCDCap_A()
4658 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1A, 0x7F, 0x80); XGI_SetLCDCap_A()
4660 xgifb_reg_and_or(pVBInfo->Part1Port, 0x19, 0x0F, XGI_SetLCDCap_A()
4662 xgifb_reg_and_or(pVBInfo->Part1Port, 0x1A, 0x7F, 0x00); XGI_SetLCDCap_A()
4673 struct vb_device_info *pVBInfo) XGI_SetLCDCap_B()
4676 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1A, 0xE0, XGI_SetLCDCap_B()
4680 xgifb_reg_and_or(pVBInfo->Part2Port, 0x1A, 0xE0, XGI_SetLCDCap_B()
4685 static void XGI_LongWait(struct vb_device_info *pVBInfo) XGI_LongWait() argument
4689 i = xgifb_reg_get(pVBInfo->P3c4, 0x1F); XGI_LongWait()
4693 if (!(inb(pVBInfo->P3da) & 0x08)) XGI_LongWait()
4698 if ((inb(pVBInfo->P3da) & 0x08)) XGI_LongWait()
4704 static void SetSpectrum(struct vb_device_info *pVBInfo) SetSpectrum() argument
4708 index = XGI_GetLCDCapPtr(pVBInfo); SetSpectrum()
4711 xgifb_reg_and(pVBInfo->Part4Port, 0x30, 0x8F); SetSpectrum()
4712 XGI_LongWait(pVBInfo); SetSpectrum()
4713 xgifb_reg_or(pVBInfo->Part4Port, 0x30, 0x20); /* reset spectrum */ SetSpectrum()
4714 XGI_LongWait(pVBInfo); SetSpectrum()
4716 xgifb_reg_set(pVBInfo->Part4Port, 0x31, SetSpectrum()
4717 pVBInfo->LCDCapList[index].Spectrum_31); SetSpectrum()
4718 xgifb_reg_set(pVBInfo->Part4Port, 0x32, SetSpectrum()
4719 pVBInfo->LCDCapList[index].Spectrum_32); SetSpectrum()
4720 xgifb_reg_set(pVBInfo->Part4Port, 0x33, SetSpectrum()
4721 pVBInfo->LCDCapList[index].Spectrum_33); SetSpectrum()
4722 xgifb_reg_set(pVBInfo->Part4Port, 0x34, SetSpectrum()
4723 pVBInfo->LCDCapList[index].Spectrum_34); SetSpectrum()
4724 XGI_LongWait(pVBInfo); SetSpectrum()
4725 xgifb_reg_or(pVBInfo->Part4Port, 0x30, 0x40); /* enable spectrum */ SetSpectrum()
4728 static void XGI_SetLCDCap(struct vb_device_info *pVBInfo) XGI_SetLCDCap() argument
4732 tempcx = pVBInfo->LCDCapList[XGI_GetLCDCapPtr(pVBInfo)].LCD_Capability; XGI_SetLCDCap()
4734 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV | XGI_SetLCDCap()
4736 if (pVBInfo->VBType & XGI_SetLCDCap()
4739 xgifb_reg_set(pVBInfo->Part4Port, 0x24, XGI_SetLCDCap()
4743 xgifb_reg_and_or(pVBInfo->Part4Port, 0x0D, XGI_SetLCDCap()
4748 if (pVBInfo->VBInfo & SetCRT2ToLCD) XGI_SetLCDCap()
4749 XGI_SetLCDCap_B(tempcx, pVBInfo); XGI_SetLCDCap()
4750 else if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) XGI_SetLCDCap()
4751 XGI_SetLCDCap_A(tempcx, pVBInfo); XGI_SetLCDCap()
4753 if (pVBInfo->VBType & (VB_SIS302LV | VB_XGI301C)) { XGI_SetLCDCap()
4755 SetSpectrum(pVBInfo); XGI_SetLCDCap()
4759 XGI_SetLCDCap_A(tempcx, pVBInfo); XGI_SetLCDCap()
4769 static void XGI_SetAntiFlicker(struct vb_device_info *pVBInfo) XGI_SetAntiFlicker() argument
4775 if (pVBInfo->TVInfo & (TVSetYPbPr525p | TVSetYPbPr750p)) XGI_SetAntiFlicker()
4778 tempbx = XGI_GetTVPtrIndex(pVBInfo); XGI_SetAntiFlicker()
4783 xgifb_reg_and_or(pVBInfo->Part2Port, 0x0A, 0x8F, tempah); XGI_SetAntiFlicker()
4786 static void XGI_SetEdgeEnhance(struct vb_device_info *pVBInfo) XGI_SetEdgeEnhance() argument
4792 tempbx = XGI_GetTVPtrIndex(pVBInfo); XGI_SetEdgeEnhance()
4797 xgifb_reg_and_or(pVBInfo->Part2Port, 0x3A, 0x1F, tempah); XGI_SetEdgeEnhance()
4800 static void XGI_SetPhaseIncr(struct vb_device_info *pVBInfo) XGI_SetPhaseIncr() argument
4808 XGI_GetTVPtrIndex2(&tempbx, &tempcl, &tempch, pVBInfo); /* bx, cl, ch */ XGI_SetPhaseIncr()
4811 xgifb_reg_set(pVBInfo->Part2Port, 0x31, (unsigned short) (tempData XGI_SetPhaseIncr()
4813 xgifb_reg_set(pVBInfo->Part2Port, 0x32, (unsigned short) ((tempData XGI_SetPhaseIncr()
4815 xgifb_reg_set(pVBInfo->Part2Port, 0x33, (unsigned short) ((tempData XGI_SetPhaseIncr()
4817 xgifb_reg_set(pVBInfo->Part2Port, 0x34, (unsigned short) ((tempData XGI_SetPhaseIncr()
4822 struct vb_device_info *pVBInfo) XGI_SetYFilter()
4828 XGI_GetTVPtrIndex2(&tempbx, &tempcl, &tempch, pVBInfo); /* bx, cl, ch */ XGI_SetYFilter()
4866 xgifb_reg_set(pVBInfo->Part2Port, 0x35, 0); XGI_SetYFilter()
4867 xgifb_reg_set(pVBInfo->Part2Port, 0x36, 0); XGI_SetYFilter()
4868 xgifb_reg_set(pVBInfo->Part2Port, 0x37, 0); XGI_SetYFilter()
4869 xgifb_reg_set(pVBInfo->Part2Port, 0x38, filterPtr[index++]); XGI_SetYFilter()
4871 xgifb_reg_set(pVBInfo->Part2Port, 0x35, filterPtr[index++]); XGI_SetYFilter()
4872 xgifb_reg_set(pVBInfo->Part2Port, 0x36, filterPtr[index++]); XGI_SetYFilter()
4873 xgifb_reg_set(pVBInfo->Part2Port, 0x37, filterPtr[index++]); XGI_SetYFilter()
4874 xgifb_reg_set(pVBInfo->Part2Port, 0x38, filterPtr[index++]); XGI_SetYFilter()
4877 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetYFilter()
4879 xgifb_reg_set(pVBInfo->Part2Port, 0x48, filterPtr[index++]); XGI_SetYFilter()
4880 xgifb_reg_set(pVBInfo->Part2Port, 0x49, filterPtr[index++]); XGI_SetYFilter()
4881 xgifb_reg_set(pVBInfo->Part2Port, 0x4A, filterPtr[index++]); XGI_SetYFilter()
4892 struct vb_device_info *pVBInfo) XGI_OEM310Setting()
4894 XGI_SetDelayComp(pVBInfo); XGI_OEM310Setting()
4896 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) XGI_OEM310Setting()
4897 XGI_SetLCDCap(pVBInfo); XGI_OEM310Setting()
4899 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_OEM310Setting()
4900 XGI_SetPhaseIncr(pVBInfo); XGI_OEM310Setting()
4901 XGI_SetYFilter(ModeIdIndex, pVBInfo); XGI_OEM310Setting()
4902 XGI_SetAntiFlicker(pVBInfo); XGI_OEM310Setting()
4904 if (pVBInfo->VBType & VB_SIS301) XGI_OEM310Setting()
4905 XGI_SetEdgeEnhance(pVBInfo); XGI_OEM310Setting()
4915 static void XGI_SetCRT2ModeRegs(struct vb_device_info *pVBInfo) XGI_SetCRT2ModeRegs() argument
4923 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { XGI_SetCRT2ModeRegs()
4924 tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x00); XGI_SetCRT2ModeRegs()
4928 if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToTV XGI_SetCRT2ModeRegs()
4931 tempcl = pVBInfo->ModeType; XGI_SetCRT2ModeRegs()
4940 if (pVBInfo->VBInfo & SetInSlaveMode) XGI_SetCRT2ModeRegs()
4945 xgifb_reg_set(pVBInfo->Part1Port, 0x00, tempah); XGI_SetCRT2ModeRegs()
4949 if (pVBInfo->VBInfo & DisableCRT2Display) XGI_SetCRT2ModeRegs()
4955 if (!(pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToTV | XGI_SetCRT2ModeRegs()
4959 if ((pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) && XGI_SetCRT2ModeRegs()
4960 (!(pVBInfo->VBInfo & SetSimuScanMode))) { XGI_SetCRT2ModeRegs()
4966 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { XGI_SetCRT2ModeRegs()
4971 if (!(pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD))) XGI_SetCRT2ModeRegs()
4977 if (!(pVBInfo->VBInfo & SetInSlaveMode)) XGI_SetCRT2ModeRegs()
4980 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) { XGI_SetCRT2ModeRegs()
4982 if (!(pVBInfo->VBInfo & SetCRT2ToLCD)) XGI_SetCRT2ModeRegs()
4986 if (!(pVBInfo->VBInfo & SetCRT2ToDualEdge)) XGI_SetCRT2ModeRegs()
4990 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2e, tempbl, tempah); XGI_SetCRT2ModeRegs()
4992 if (pVBInfo->VBInfo & (SetCRT2ToRAMDAC | SetCRT2ToTV | SetCRT2ToLCD XGI_SetCRT2ModeRegs()
4995 if ((pVBInfo->ModeType == ModeVGA) && (!(pVBInfo->VBInfo XGI_SetCRT2ModeRegs()
5001 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetCRT2ModeRegs()
5003 if (pVBInfo->VBInfo & DriverMode) XGI_SetCRT2ModeRegs()
5007 xgifb_reg_and_or(pVBInfo->Part4Port, 0x0D, ~0x0BF, tempah); XGI_SetCRT2ModeRegs()
5010 if (pVBInfo->LCDInfo & SetLCDDualLink) XGI_SetCRT2ModeRegs()
5013 if (pVBInfo->VBInfo & SetCRT2ToTV) { XGI_SetCRT2ModeRegs()
5014 if (pVBInfo->TVInfo & RPLLDIV2XO) XGI_SetCRT2ModeRegs()
5018 if ((pVBInfo->LCDResInfo == Panel_1280x1024) XGI_SetCRT2ModeRegs()
5019 || (pVBInfo->LCDResInfo == Panel_1280x1024x75)) XGI_SetCRT2ModeRegs()
5022 if (pVBInfo->LCDResInfo == Panel_1280x960) XGI_SetCRT2ModeRegs()
5025 xgifb_reg_set(pVBInfo->Part4Port, 0x0C, tempah); XGI_SetCRT2ModeRegs()
5028 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetCRT2ModeRegs()
5033 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) { XGI_SetCRT2ModeRegs()
5035 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) XGI_SetCRT2ModeRegs()
5039 xgifb_reg_and_or(pVBInfo->Part1Port, 0x13, tempbl, tempah); XGI_SetCRT2ModeRegs()
5042 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { XGI_SetCRT2ModeRegs()
5043 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) XGI_SetCRT2ModeRegs()
5047 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2c, tempbl, tempah); XGI_SetCRT2ModeRegs()
5051 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { XGI_SetCRT2ModeRegs()
5052 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) XGI_SetCRT2ModeRegs()
5055 xgifb_reg_and_or(pVBInfo->Part4Port, 0x21, tempbl, tempah); XGI_SetCRT2ModeRegs()
5060 if (!(pVBInfo->VBInfo & XGI_SetCRT2ToLCDA)) { XGI_SetCRT2ModeRegs()
5062 if (!(pVBInfo->VBInfo & SetCRT2ToDualEdge)) XGI_SetCRT2ModeRegs()
5066 xgifb_reg_and_or(pVBInfo->Part4Port, 0x23, tempbl, tempah); XGI_SetCRT2ModeRegs()
5068 if (pVBInfo->VBType & (VB_SIS302LV | VB_XGI301C)) { XGI_SetCRT2ModeRegs()
5069 if (pVBInfo->LCDInfo & SetLCDDualLink) { XGI_SetCRT2ModeRegs()
5070 xgifb_reg_or(pVBInfo->Part4Port, 0x27, 0x20); XGI_SetCRT2ModeRegs()
5071 xgifb_reg_or(pVBInfo->Part4Port, 0x34, 0x10); XGI_SetCRT2ModeRegs()
5077 void XGI_UnLockCRT2(struct vb_device_info *pVBInfo) XGI_UnLockCRT2() argument
5079 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2f, 0xFF, 0x01); XGI_UnLockCRT2()
5082 void XGI_LockCRT2(struct vb_device_info *pVBInfo) XGI_LockCRT2() argument
5084 xgifb_reg_and_or(pVBInfo->Part1Port, 0x2F, 0xFE, 0x00); XGI_LockCRT2()
5089 struct vb_device_info *pVBInfo) XGI_GetRatePtrCRT2()
5096 index = xgifb_reg_get(pVBInfo->P3d4, 0x33); XGI_GetRatePtrCRT2()
5097 index >>= pVBInfo->SelectCRT2Rate; XGI_GetRatePtrCRT2()
5100 if (pVBInfo->LCDInfo & LCDNonExpanding) XGI_GetRatePtrCRT2()
5106 if (pVBInfo->SetFlag & ProgrammingCRT2) { XGI_GetRatePtrCRT2()
5107 if (pVBInfo->VBInfo & (SetCRT2ToLCD | XGI_SetCRT2ToLCDA)) { XGI_GetRatePtrCRT2()
5108 temp = LCDARefreshIndex[pVBInfo->LCDResInfo & 0x07]; XGI_GetRatePtrCRT2()
5140 if (temp < pVBInfo->ModeType) XGI_GetRatePtrCRT2()
5146 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) { XGI_GetRatePtrCRT2()
5147 if (pVBInfo->VBInfo & SetInSlaveMode) { XGI_GetRatePtrCRT2()
5155 if ((pVBInfo->SetFlag & ProgrammingCRT2)) { XGI_GetRatePtrCRT2()
5157 &i, pVBInfo); XGI_GetRatePtrCRT2()
5164 struct vb_device_info *pVBInfo) XGI_SetLCDAGroup()
5168 pVBInfo->SetFlag |= ProgrammingCRT2; XGI_SetLCDAGroup()
5170 ModeIdIndex, pVBInfo); XGI_SetLCDAGroup()
5171 XGI_GetLVDSResInfo(ModeIdIndex, pVBInfo); XGI_SetLCDAGroup()
5172 XGI_GetLVDSData(ModeIdIndex, pVBInfo); XGI_SetLCDAGroup()
5173 XGI_ModCRT1Regs(ModeIdIndex, HwDeviceExtension, pVBInfo); XGI_SetLCDAGroup()
5174 XGI_SetLVDSRegs(ModeIdIndex, pVBInfo); XGI_SetLCDAGroup()
5175 XGI_SetCRT2ECLK(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetLCDAGroup()
5180 struct vb_device_info *pVBInfo) XGI_SetCRT2Group301()
5184 pVBInfo->SetFlag |= ProgrammingCRT2; XGI_SetCRT2Group301()
5186 pVBInfo->SelectCRT2Rate = 4; XGI_SetCRT2Group301()
5188 ModeIdIndex, pVBInfo); XGI_SetCRT2Group301()
5189 XGI_SaveCRT2Info(ModeNo, pVBInfo); XGI_SetCRT2Group301()
5190 XGI_GetCRT2ResInfo(ModeIdIndex, pVBInfo); XGI_SetCRT2Group301()
5191 XGI_GetCRT2Data(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetCRT2Group301()
5192 XGI_PreSetGroup1(ModeNo, ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetCRT2Group301()
5193 XGI_SetGroup1(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetCRT2Group301()
5194 XGI_SetLockRegs(ModeNo, ModeIdIndex, pVBInfo); XGI_SetCRT2Group301()
5195 XGI_SetGroup2(ModeNo, ModeIdIndex, pVBInfo); XGI_SetCRT2Group301()
5196 XGI_SetLCDRegs(ModeIdIndex, pVBInfo); XGI_SetCRT2Group301()
5197 XGI_SetTap4Regs(pVBInfo); XGI_SetCRT2Group301()
5198 XGI_SetGroup3(ModeIdIndex, pVBInfo); XGI_SetCRT2Group301()
5199 XGI_SetGroup4(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetCRT2Group301()
5200 XGI_SetCRT2VCLK(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetCRT2Group301()
5201 XGI_SetGroup5(pVBInfo); XGI_SetCRT2Group301()
5202 XGI_AutoThreshold(pVBInfo); XGI_SetCRT2Group301()
5206 void XGI_SenseCRT1(struct vb_device_info *pVBInfo) XGI_SenseCRT1() argument
5219 xgifb_reg_set(pVBInfo->P3c4, 0x05, 0x86); XGI_SenseCRT1()
5222 xgifb_reg_set(pVBInfo->P3d4, 0x57, 0x4A); XGI_SenseCRT1()
5223 xgifb_reg_set(pVBInfo->P3d4, 0x53, (xgifb_reg_get( XGI_SenseCRT1()
5224 pVBInfo->P3d4, 0x53) | 0x02)); XGI_SenseCRT1()
5226 SR31 = xgifb_reg_get(pVBInfo->P3c4, 0x31); XGI_SenseCRT1()
5227 CR63 = xgifb_reg_get(pVBInfo->P3d4, 0x63); XGI_SenseCRT1()
5228 SR01 = xgifb_reg_get(pVBInfo->P3c4, 0x01); XGI_SenseCRT1()
5230 xgifb_reg_set(pVBInfo->P3c4, 0x01, (unsigned char) (SR01 & 0xDF)); XGI_SenseCRT1()
5231 xgifb_reg_set(pVBInfo->P3d4, 0x63, (unsigned char) (CR63 & 0xBF)); XGI_SenseCRT1()
5233 CR17 = xgifb_reg_get(pVBInfo->P3d4, 0x17); XGI_SenseCRT1()
5234 xgifb_reg_set(pVBInfo->P3d4, 0x17, (unsigned char) (CR17 | 0x80)); XGI_SenseCRT1()
5236 SR1F = xgifb_reg_get(pVBInfo->P3c4, 0x1F); XGI_SenseCRT1()
5237 xgifb_reg_set(pVBInfo->P3c4, 0x1F, (unsigned char) (SR1F | 0x04)); XGI_SenseCRT1()
5239 SR07 = xgifb_reg_get(pVBInfo->P3c4, 0x07); XGI_SenseCRT1()
5240 xgifb_reg_set(pVBInfo->P3c4, 0x07, (unsigned char) (SR07 & 0xFB)); XGI_SenseCRT1()
5241 SR06 = xgifb_reg_get(pVBInfo->P3c4, 0x06); XGI_SenseCRT1()
5242 xgifb_reg_set(pVBInfo->P3c4, 0x06, (unsigned char) (SR06 & 0xC3)); XGI_SenseCRT1()
5244 xgifb_reg_set(pVBInfo->P3d4, 0x11, 0x00); XGI_SenseCRT1()
5247 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) i, CRTCData[i]); XGI_SenseCRT1()
5250 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 8), XGI_SenseCRT1()
5254 xgifb_reg_set(pVBInfo->P3d4, (unsigned short) (i + 4), XGI_SenseCRT1()
5258 xgifb_reg_set(pVBInfo->P3c4, (unsigned short) (i - 3), XGI_SenseCRT1()
5261 xgifb_reg_set(pVBInfo->P3c4, 0x0E, (unsigned char) (CRTCData[16] XGI_SenseCRT1()
5264 xgifb_reg_set(pVBInfo->P3c4, 0x31, 0x00); XGI_SenseCRT1()
5265 xgifb_reg_set(pVBInfo->P3c4, 0x2B, 0x1B); XGI_SenseCRT1()
5266 xgifb_reg_set(pVBInfo->P3c4, 0x2C, 0xE1); XGI_SenseCRT1()
5268 outb(0x00, pVBInfo->P3c8); XGI_SenseCRT1()
5271 outb(0x0F, (pVBInfo->P3c8 + 1)); /* DAC_TEST_PARMS */ XGI_SenseCRT1()
5275 XGI_WaitDisply(pVBInfo); XGI_SenseCRT1()
5276 temp = inb(pVBInfo->P3c2); XGI_SenseCRT1()
5279 xgifb_reg_and_or(pVBInfo->P3d4, 0x32, 0xDF, 0x20); XGI_SenseCRT1()
5281 xgifb_reg_and_or(pVBInfo->P3d4, 0x32, 0xDF, 0x00); XGI_SenseCRT1()
5284 outb(0x00, pVBInfo->P3c8); XGI_SenseCRT1()
5287 outb(0, (pVBInfo->P3c8 + 1)); XGI_SenseCRT1()
5289 xgifb_reg_set(pVBInfo->P3c4, 0x01, SR01); XGI_SenseCRT1()
5290 xgifb_reg_set(pVBInfo->P3d4, 0x63, CR63); XGI_SenseCRT1()
5291 xgifb_reg_set(pVBInfo->P3c4, 0x31, SR31); XGI_SenseCRT1()
5293 xgifb_reg_set(pVBInfo->P3d4, 0x53, (xgifb_reg_get( XGI_SenseCRT1()
5294 pVBInfo->P3d4, 0x53) & 0xFD)); XGI_SenseCRT1()
5295 xgifb_reg_set(pVBInfo->P3c4, 0x1F, (unsigned char) SR1F); XGI_SenseCRT1()
5300 struct vb_device_info *pVBInfo) XGI_EnableBridge()
5304 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_EnableBridge()
5306 if (pVBInfo->VBInfo & SetCRT2ToDualEdge) XGI_EnableBridge()
5308 xgifb_reg_set(pVBInfo->Part1Port, 0x1E, 0x20); XGI_EnableBridge()
5310 if (pVBInfo->VBInfo & (SetCRT2ToLCD | SetCRT2ToTV | XGI_EnableBridge()
5312 tempah = xgifb_reg_get(pVBInfo->P3c4, 0x32); XGI_EnableBridge()
5314 if (pVBInfo->VBInfo & SetInSlaveMode) { XGI_EnableBridge()
5315 if (!(pVBInfo->VBInfo & SetCRT2ToRAMDAC)) XGI_EnableBridge()
5318 xgifb_reg_set(pVBInfo->P3c4, 0x32, tempah); XGI_EnableBridge()
5319 xgifb_reg_or(pVBInfo->P3c4, 0x1E, 0x20); XGI_EnableBridge()
5321 tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x2E); XGI_EnableBridge()
5324 xgifb_reg_or(pVBInfo->Part1Port, 0x2E, 0x80); XGI_EnableBridge()
5325 xgifb_reg_and(pVBInfo->Part1Port, 0x00, 0x7F); XGI_EnableBridge()
5328 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { XGI_EnableBridge()
5329 xgifb_reg_and_or(pVBInfo->Part2Port, 0x00, ~0xE0, XGI_EnableBridge()
5331 if (pVBInfo->VBType & (VB_SIS302LV | VB_XGI301C)) { XGI_EnableBridge()
5332 if (pVBInfo->VBInfo & XGI_EnableBridge()
5335 xgifb_reg_and(pVBInfo->Part4Port, 0x2A, XGI_EnableBridge()
5338 xgifb_reg_and(pVBInfo->Part4Port, 0x30, 0x7F); XGI_EnableBridge()
5344 if (!(pVBInfo->VBInfo & DisableCRT2Display)) { XGI_EnableBridge()
5347 if (!(pVBInfo->VBInfo & SetSimuScanMode) && XGI_EnableBridge()
5348 (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) && XGI_EnableBridge()
5349 (pVBInfo->VBInfo & SetCRT2ToDualEdge)) { XGI_EnableBridge()
5351 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) XGI_EnableBridge()
5357 xgifb_reg_or(pVBInfo->Part4Port, 0x1F, tempah); XGI_EnableBridge()
5359 XGI_DisableGatingCRT(pVBInfo); XGI_EnableBridge()
5360 XGI_DisplayOn(xgifb_info, HwDeviceExtension, pVBInfo); XGI_EnableBridge()
5363 if (pVBInfo->VBInfo & (SetCRT2ToTV | SetCRT2ToLCD XGI_EnableBridge()
5366 xgifb_reg_or(pVBInfo->Part1Port, 0x1E, 0x20); XGI_EnableBridge()
5368 tempah = xgifb_reg_get(pVBInfo->Part1Port, 0x2E); XGI_EnableBridge()
5370 xgifb_reg_or(pVBInfo->Part1Port, 0x2E, 0x80); XGI_EnableBridge()
5372 xgifb_reg_and(pVBInfo->Part1Port, 0x00, 0x7F); XGI_EnableBridge()
5373 XGI_DisplayOn(xgifb_info, HwDeviceExtension, pVBInfo); XGI_EnableBridge()
5380 struct vb_device_info *pVBInfo) XGI_SetCRT1Group()
5384 XGI_SetSeqRegs(pVBInfo); XGI_SetCRT1Group()
5385 outb(XGI330_StandTable.MISC, pVBInfo->P3c2); XGI_SetCRT1Group()
5386 XGI_SetCRTCRegs(pVBInfo); XGI_SetCRT1Group()
5387 XGI_SetATTRegs(ModeIdIndex, pVBInfo); XGI_SetCRT1Group()
5388 XGI_SetGRCRegs(pVBInfo); XGI_SetCRT1Group()
5389 XGI_ClearExt1Regs(pVBInfo); XGI_SetCRT1Group()
5392 if (pVBInfo->IF_DEF_LVDS == 0) XGI_SetCRT1Group()
5393 XGI_SetDefaultVCLK(pVBInfo); XGI_SetCRT1Group()
5397 pVBInfo->SetFlag &= temp; XGI_SetCRT1Group()
5398 pVBInfo->SelectCRT2Rate = 0; XGI_SetCRT1Group()
5400 if (pVBInfo->VBType & (VB_SIS301B | VB_SIS302B | VB_SIS301LV XGI_SetCRT1Group()
5402 if (pVBInfo->VBInfo & (SetSimuScanMode | XGI_SetCRT2ToLCDA XGI_SetCRT1Group()
5404 pVBInfo->SetFlag |= ProgrammingCRT2; XGI_SetCRT1Group()
5409 ModeIdIndex, pVBInfo); XGI_SetCRT1Group()
5411 XGI_SetSync(RefreshRateTableIndex, pVBInfo); XGI_SetCRT1Group()
5413 pVBInfo, HwDeviceExtension); XGI_SetCRT1Group()
5414 XGI_SetCRT1DE(ModeIdIndex, RefreshRateTableIndex, pVBInfo); XGI_SetCRT1Group()
5416 HwDeviceExtension, pVBInfo); XGI_SetCRT1Group()
5418 RefreshRateTableIndex, pVBInfo); XGI_SetCRT1Group()
5422 temp = xgifb_reg_get(pVBInfo->P3d4, 0x38); XGI_SetCRT1Group()
5426 XGI_SetXG27CRTC(RefreshRateTableIndex, pVBInfo); XGI_SetCRT1Group()
5428 XGI_SetXG21CRTC(RefreshRateTableIndex, pVBInfo); XGI_SetCRT1Group()
5430 XGI_UpdateXG21CRTC(ModeNo, pVBInfo, XGI_SetCRT1Group()
5434 pVBInfo, RefreshRateTableIndex); XGI_SetCRT1Group()
5436 if (pVBInfo->IF_DEF_LVDS == 1) XGI_SetCRT1Group()
5439 ModeIdIndex, pVBInfo); XGI_SetCRT1Group()
5443 pVBInfo->SetFlag &= (~ProgrammingCRT2); XGI_SetCRT1Group()
5444 XGI_SetCRT1FIFO(HwDeviceExtension, pVBInfo); XGI_SetCRT1Group()
5446 RefreshRateTableIndex, pVBInfo); XGI_SetCRT1Group()
5447 XGI_LoadDAC(pVBInfo); XGI_SetCRT1Group()
5456 struct vb_device_info *pVBInfo = &VBINF; XGISetModeNew() local
5458 pVBInfo->IF_DEF_LVDS = 0; XGISetModeNew()
5461 pVBInfo->VBType = 0; /*set VBType default 0*/ XGISetModeNew()
5463 XGIRegInit(pVBInfo, xgifb_info->vga_base); XGISetModeNew()
5467 if ((xgifb_reg_get(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) XGISetModeNew()
5468 pVBInfo->IF_DEF_LVDS = 1; XGISetModeNew()
5471 if ((xgifb_reg_get(pVBInfo->P3d4, 0x38) & 0xE0) == 0xC0) { XGISetModeNew()
5472 if (xgifb_reg_get(pVBInfo->P3d4, 0x30) & 0x20) XGISetModeNew()
5473 pVBInfo->IF_DEF_LVDS = 1; XGISetModeNew()
5477 InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo); XGISetModeNew()
5480 xgifb_reg_set(pVBInfo->P3c4, 0x05, 0x86); XGISetModeNew()
5483 XGI_UnLockCRT2(pVBInfo); XGISetModeNew()
5488 XGI_GetVBInfo(ModeIdIndex, pVBInfo); XGISetModeNew()
5489 XGI_GetTVInfo(ModeIdIndex, pVBInfo); XGISetModeNew()
5490 XGI_GetLCDInfo(ModeIdIndex, pVBInfo); XGISetModeNew()
5491 XGI_DisableBridge(xgifb_info, HwDeviceExtension, pVBInfo); XGISetModeNew()
5493 if (pVBInfo->VBInfo & (SetSimuScanMode | XGI_SetCRT2ToLCDA) || XGISetModeNew()
5494 (!(pVBInfo->VBInfo & SwitchCRT2))) { XGISetModeNew()
5496 ModeIdIndex, pVBInfo); XGISetModeNew()
5498 if (pVBInfo->VBInfo & XGI_SetCRT2ToLCDA) { XGISetModeNew()
5500 HwDeviceExtension, pVBInfo); XGISetModeNew()
5504 if (pVBInfo->VBInfo & (SetSimuScanMode | SwitchCRT2)) { XGISetModeNew()
5509 pVBInfo); /*add for CRT2 */ XGISetModeNew()
5517 XGI_SetCRT2ModeRegs(pVBInfo); XGISetModeNew()
5518 XGI_OEM310Setting(ModeIdIndex, pVBInfo); /*0212*/ XGISetModeNew()
5519 XGI_EnableBridge(xgifb_info, HwDeviceExtension, pVBInfo); XGISetModeNew()
5522 if (pVBInfo->IF_DEF_LVDS == 1) XGISetModeNew()
5527 pVBInfo->ModeType = XGI330_EModeIDTable[ModeIdIndex]. XGISetModeNew()
5530 pVBInfo->SetFlag = 0; XGISetModeNew()
5531 pVBInfo->VBInfo = DisableCRT2Display; XGISetModeNew()
5533 XGI_DisplayOff(xgifb_info, HwDeviceExtension, pVBInfo); XGISetModeNew()
5536 ModeIdIndex, pVBInfo); XGISetModeNew()
5538 XGI_DisplayOn(xgifb_info, HwDeviceExtension, pVBInfo); XGISetModeNew()
5541 XGI_UpdateModeInfo(pVBInfo); XGISetModeNew()
5544 XGI_LockCRT2(pVBInfo); XGISetModeNew()
97 XGI_SetATTRegs(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetATTRegs() argument
171 XGI_AjustCRT2Rate(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, unsigned short *i, struct vb_device_info *pVBInfo) XGI_AjustCRT2Rate() argument
248 XGI_SetSync(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetSync() argument
320 XGI_SetCRT1Timing_V(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetCRT1Timing_V() argument
363 XGI_SetCRT1CRTC(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo, struct xgi_hw_device_info *HwDeviceExtension) XGI_SetCRT1CRTC() argument
401 XGI_SetXG21CRTC(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetXG21CRTC() argument
497 XGI_SetXG27CRTC(unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetXG27CRTC() argument
598 xgifb_set_lcd(int chip_id, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex) xgifb_set_lcd() argument
648 XGI_UpdateXG21CRTC(unsigned short ModeNo, struct vb_device_info *pVBInfo, unsigned short RefreshRateTableIndex) XGI_UpdateXG21CRTC() argument
681 XGI_SetCRT1DE(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetCRT1DE() argument
743 XGI_SetCRT1Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_SetCRT1Offset() argument
827 XGI_GetVCLK2Ptr(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_GetVCLK2Ptr() argument
876 XGI_SetCRT1VCLK(unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetCRT1VCLK() argument
936 XGI_SetCRT1FIFO(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_SetCRT1FIFO() argument
957 XGI_SetVCLKState(struct xgi_hw_device_info *HwDeviceExtension, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetVCLKState() argument
996 XGI_SetCRT1ModeRegs(struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetCRT1ModeRegs() argument
1078 XGI_WriteDAC(unsigned short dl, unsigned short ah, unsigned short al, unsigned short dh, struct vb_device_info *pVBInfo) XGI_WriteDAC() argument
1166 XGI_GetLVDSResInfo(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetLVDSResInfo() argument
1195 XGI_GetLcdPtr(struct XGI330_LCDDataTablStruct const *table, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetLcdPtr() argument
1234 XGI_GetTVPtr(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_GetTVPtr() argument
1263 XGI_GetLVDSData(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetLVDSData() argument
1297 XGI_ModCRT1Regs(unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_ModCRT1Regs() argument
1384 XGI_GetLCDSync(unsigned short *HSyncWidth, unsigned short *VSyncWidth, struct vb_device_info *pVBInfo) XGI_GetLCDSync() argument
1395 XGI_SetLVDSRegs(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetLVDSRegs() argument
1635 XGI_GetLCDVCLKPtr(unsigned char *di_0, unsigned char *di_1, struct vb_device_info *pVBInfo) XGI_GetLCDVCLKPtr() argument
1653 XGI_GetVCLKPtr(unsigned short RefreshRateTableIndex, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetVCLKPtr() argument
1720 XGI_GetVCLKLen(unsigned char tempal, unsigned char *di_0, unsigned char *di_1, struct vb_device_info *pVBInfo) XGI_GetVCLKLen() argument
1736 XGI_SetCRT2ECLK(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetCRT2ECLK() argument
1887 XGI_GetVBInfo(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetVBInfo() argument
2012 XGI_GetTVInfo(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetTVInfo() argument
2079 XGI_GetLCDInfo(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetLCDInfo() argument
2238 XGI_XG21BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo) XGI_XG21BLSignalVDD() argument
2264 XGI_XG27BLSignalVDD(unsigned short tempbh, unsigned short tempbl, struct vb_device_info *pVBInfo) XGI_XG27BLSignalVDD() argument
2295 XGI_DisplayOn(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *pXGIHWDE, struct vb_device_info *pVBInfo) XGI_DisplayOn() argument
2342 XGI_DisplayOff(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *pXGIHWDE, struct vb_device_info *pVBInfo) XGI_DisplayOff() argument
2387 XGI_SaveCRT2Info(unsigned short ModeNo, struct vb_device_info *pVBInfo) XGI_SaveCRT2Info() argument
2399 XGI_GetCRT2ResInfo(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetCRT2ResInfo() argument
2471 XGI_GetRAMDAC2DATA(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_GetRAMDAC2DATA() argument
2513 XGI_GetCRT2Data(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_GetCRT2Data() argument
2683 XGI_SetCRT2VCLK(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetCRT2VCLK() argument
2755 XGI_SetCRT2Offset(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetCRT2Offset() argument
2783 XGI_PreSetGroup1(unsigned short ModeNo, unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_PreSetGroup1() argument
2799 XGI_SetGroup1(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetGroup1() argument
2953 XGI_SetLockRegs(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetLockRegs() argument
3243 XGI_SetGroup2(unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetGroup2() argument
3672 XGI_SetLCDRegs(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetLCDRegs() argument
3947 XGI_SetGroup3(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetGroup3() argument
4003 XGI_SetGroup4(unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex, struct vb_device_info *pVBInfo) XGI_SetGroup4() argument
4227 xgifb_set_lvds(struct xgifb_video_info *xgifb_info, int chip_id, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) xgifb_set_lvds() argument
4439 XGI_DisableBridge(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_DisableBridge() argument
4570 XGI_GetTVPtrIndex2(unsigned short *tempbx, unsigned char *tempcl, unsigned char *tempch, struct vb_device_info *pVBInfo) XGI_GetTVPtrIndex2() argument
4647 XGI_SetLCDCap_A(unsigned short tempcx, struct vb_device_info *pVBInfo) XGI_SetLCDCap_A() argument
4672 XGI_SetLCDCap_B(unsigned short tempcx, struct vb_device_info *pVBInfo) XGI_SetLCDCap_B() argument
4821 XGI_SetYFilter(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetYFilter() argument
4891 XGI_OEM310Setting(unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_OEM310Setting() argument
5087 XGI_GetRatePtrCRT2(struct xgi_hw_device_info *pXGIHWDE, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_GetRatePtrCRT2() argument
5162 XGI_SetLCDAGroup(unsigned short ModeNo, unsigned short ModeIdIndex, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_SetLCDAGroup() argument
5178 XGI_SetCRT2Group301(unsigned short ModeNo, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_SetCRT2Group301() argument
5298 XGI_EnableBridge(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGI_EnableBridge() argument
5377 XGI_SetCRT1Group(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *HwDeviceExtension, unsigned short ModeNo, unsigned short ModeIdIndex, struct vb_device_info *pVBInfo) XGI_SetCRT1Group() argument
H A Dvb_init.c33 struct vb_device_info *pVBInfo) XGINew_GetXG20DRAMType()
38 data = xgifb_reg_get(pVBInfo->P3c4, 0x39) & 0x02; XGINew_GetXG20DRAMType()
40 data = (xgifb_reg_get(pVBInfo->P3c4, 0x3A) & XGINew_GetXG20DRAMType()
44 temp = xgifb_reg_get(pVBInfo->P3c4, 0x3B); XGINew_GetXG20DRAMType()
53 xgifb_reg_and(pVBInfo->P3d4, 0xB4, ~0x02); XGINew_GetXG20DRAMType()
55 xgifb_reg_or(pVBInfo->P3d4, 0x4A, 0x80); /* Enable GPIOH read */ XGINew_GetXG20DRAMType()
57 data = xgifb_reg_get(pVBInfo->P3d4, 0x48); XGINew_GetXG20DRAMType()
64 xgifb_reg_or(pVBInfo->P3d4, 0xB4, 0x02); XGINew_GetXG20DRAMType()
67 data = xgifb_reg_get(pVBInfo->P3d4, 0x97) & 0x01; XGINew_GetXG20DRAMType()
76 struct vb_device_info *pVBInfo) XGINew_DDR1x_MRS_340()
90 xgifb_reg_set(P3c4, 0x18, pVBInfo->SR18[pVBInfo->ram_type]); /* SR18 */ XGINew_DDR1x_MRS_340()
97 xgifb_reg_set(P3c4, 0x18, pVBInfo->SR18[pVBInfo->ram_type]); /* SR18 */ XGINew_DDR1x_MRS_340()
104 static void XGINew_SetMemoryClock(struct vb_device_info *pVBInfo) XGINew_SetMemoryClock() argument
106 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetMemoryClock()
108 pVBInfo->MCLKData[pVBInfo->ram_type].SR28); XGINew_SetMemoryClock()
109 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetMemoryClock()
111 pVBInfo->MCLKData[pVBInfo->ram_type].SR29); XGINew_SetMemoryClock()
112 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetMemoryClock()
114 pVBInfo->MCLKData[pVBInfo->ram_type].SR2A); XGINew_SetMemoryClock()
116 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetMemoryClock()
118 XGI340_ECLKData[pVBInfo->ram_type].SR2E); XGINew_SetMemoryClock()
119 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetMemoryClock()
121 XGI340_ECLKData[pVBInfo->ram_type].SR2F); XGINew_SetMemoryClock()
122 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetMemoryClock()
124 XGI340_ECLKData[pVBInfo->ram_type].SR30); XGINew_SetMemoryClock()
129 unsigned long P3c4, struct vb_device_info *pVBInfo) XGINew_DDRII_Bootup_XG27()
133 pVBInfo->ram_type = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo); XGINew_DDRII_Bootup_XG27()
134 XGINew_SetMemoryClock(pVBInfo); XGINew_DDRII_Bootup_XG27()
137 xgifb_reg_set(P3d4, 0x97, pVBInfo->XGINew_CR97); /* CR97 */ XGINew_DDRII_Bootup_XG27()
201 unsigned long P3c4, struct vb_device_info *pVBInfo) XGINew_DDR2_MRS_XG20()
205 pVBInfo->ram_type = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo); XGINew_DDR2_MRS_XG20()
206 XGINew_SetMemoryClock(pVBInfo); XGINew_DDR2_MRS_XG20()
246 struct vb_device_info *pVBInfo) XGINew_DDR1x_MRS_XG20()
259 xgifb_reg_set(P3c4, 0x18, pVBInfo->SR18[pVBInfo->ram_type]); /* SR18 */ XGINew_DDR1x_MRS_XG20()
266 xgifb_reg_set(P3c4, 0x18, pVBInfo->SR18[pVBInfo->ram_type]); /* SR18 */ XGINew_DDR1x_MRS_XG20()
275 unsigned long Port, struct vb_device_info *pVBInfo) XGINew_DDR1x_DefaultRegister()
280 XGINew_SetMemoryClock(pVBInfo); XGINew_DDR1x_DefaultRegister()
283 pVBInfo->CR40[11][pVBInfo->ram_type]); /* CR82 */ XGINew_DDR1x_DefaultRegister()
286 pVBInfo->CR40[12][pVBInfo->ram_type]); /* CR85 */ XGINew_DDR1x_DefaultRegister()
289 pVBInfo->CR40[13][pVBInfo->ram_type]); /* CR86 */ XGINew_DDR1x_DefaultRegister()
294 XGINew_DDR1x_MRS_XG20(P3c4, pVBInfo); XGINew_DDR1x_DefaultRegister()
296 XGINew_SetMemoryClock(pVBInfo); XGINew_DDR1x_DefaultRegister()
303 pVBInfo->CR40[11][pVBInfo->ram_type]); XGINew_DDR1x_DefaultRegister()
307 pVBInfo->CR40[12][pVBInfo->ram_type]); XGINew_DDR1x_DefaultRegister()
311 pVBInfo->CR40[13][pVBInfo->ram_type]); XGINew_DDR1x_DefaultRegister()
322 pVBInfo->CR40[13][pVBInfo->ram_type]); XGINew_DDR1x_DefaultRegister()
335 pVBInfo->CR40[12][pVBInfo->ram_type]); XGINew_DDR1x_DefaultRegister()
339 pVBInfo->CR40[11][pVBInfo->ram_type]); XGINew_DDR1x_DefaultRegister()
346 XGINew_DDR1x_MRS_340(P3c4, pVBInfo); XGINew_DDR1x_DefaultRegister()
352 unsigned long Port, struct vb_device_info *pVBInfo) XGINew_DDR2_DefaultRegister()
364 xgifb_reg_set(P3d4, 0x86, pVBInfo->CR40[13][pVBInfo->ram_type]); XGINew_DDR2_DefaultRegister()
372 pVBInfo->CR40[12][pVBInfo->ram_type]); /* CR85 */ XGINew_DDR2_DefaultRegister()
375 xgifb_reg_set(P3d4, 0x82, pVBInfo->CR40[11][pVBInfo->ram_type]); XGINew_DDR2_DefaultRegister()
382 XGINew_DDRII_Bootup_XG27(HwDeviceExtension, P3c4, pVBInfo); XGINew_DDR2_DefaultRegister()
384 XGINew_DDR2_MRS_XG20(HwDeviceExtension, P3c4, pVBInfo); XGINew_DDR2_DefaultRegister()
403 unsigned long Port, struct vb_device_info *pVBInfo) XGINew_SetDRAMDefaultRegister340()
409 xgifb_reg_set(P3d4, 0x6D, pVBInfo->CR40[8][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
410 xgifb_reg_set(P3d4, 0x68, pVBInfo->CR40[5][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
411 xgifb_reg_set(P3d4, 0x69, pVBInfo->CR40[6][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
412 xgifb_reg_set(P3d4, 0x6A, pVBInfo->CR40[7][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
431 pVBInfo->CR40[9][pVBInfo->ram_type]); /* CR80 */ XGINew_SetDRAMDefaultRegister340()
434 pVBInfo->CR40[10][pVBInfo->ram_type]); /* CR81 */ XGINew_SetDRAMDefaultRegister340()
445 temp = pVBInfo->CR40[3][pVBInfo->ram_type]; XGINew_SetDRAMDefaultRegister340()
454 pVBInfo->CR40[0][pVBInfo->ram_type]); /* CR41 */ XGINew_SetDRAMDefaultRegister340()
461 pVBInfo->CR40[14 + j][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
465 pVBInfo->CR40[21 + j][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
469 pVBInfo->CR40[1 + j][pVBInfo->ram_type]); XGINew_SetDRAMDefaultRegister340()
476 pVBInfo->CR40[4][pVBInfo->ram_type]); /* CR59 */ XGINew_SetDRAMDefaultRegister340()
481 if (pVBInfo->ram_type) { XGINew_SetDRAMDefaultRegister340()
491 temp = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo); XGINew_SetDRAMDefaultRegister340()
493 XGINew_DDR1x_DefaultRegister(HwDeviceExtension, P3d4, pVBInfo); XGINew_SetDRAMDefaultRegister340()
496 XGINew_DDR2_DefaultRegister(HwDeviceExtension, P3d4, pVBInfo); XGINew_SetDRAMDefaultRegister340()
503 struct vb_device_info *pVBInfo) XGINew_SetDRAMSize20Reg()
509 RankSize = dram_size * pVBInfo->ram_bus / 8; XGINew_SetDRAMSize20Reg()
510 data = xgifb_reg_get(pVBInfo->P3c4, 0x13); XGINew_SetDRAMSize20Reg()
518 if (pVBInfo->ram_channel == 3) XGINew_SetDRAMSize20Reg()
521 ChannelNo = pVBInfo->ram_channel; XGINew_SetDRAMSize20Reg()
530 xgifb_reg_set(pVBInfo->P3c4, XGINew_SetDRAMSize20Reg()
532 (xgifb_reg_get(pVBInfo->P3c4, 0x14) & 0x0F) | XGINew_SetDRAMSize20Reg()
540 unsigned short StartAddr, struct vb_device_info *pVBInfo) XGINew_ReadWriteRest()
544 void __iomem *fbaddr = pVBInfo->FBAddr; XGINew_ReadWriteRest()
568 static unsigned char XGINew_CheckFrequence(struct vb_device_info *pVBInfo) XGINew_CheckFrequence() argument
572 data = xgifb_reg_get(pVBInfo->P3d4, 0x97); XGINew_CheckFrequence()
575 data = xgifb_reg_get(pVBInfo->P3c4, 0x39); XGINew_CheckFrequence()
583 struct vb_device_info *pVBInfo) XGINew_CheckChannel()
590 data = xgifb_reg_get(pVBInfo->P3d4, 0x97); XGINew_CheckChannel()
592 pVBInfo->ram_channel = 1; /* XG20 "JUST" one channel */ XGINew_CheckChannel()
598 pVBInfo->ram_bus = 32; /* 32 bits */ XGINew_CheckChannel()
600 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1); XGINew_CheckChannel()
601 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x52); XGINew_CheckChannel()
604 if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1) XGINew_CheckChannel()
610 xgifb_reg_set(pVBInfo->P3c4, XGINew_CheckChannel()
613 xgifb_reg_set(pVBInfo->P3c4, XGINew_CheckChannel()
620 pVBInfo) == 1) XGINew_CheckChannel()
627 pVBInfo->ram_bus = 16; /* 16 bits */ XGINew_CheckChannel()
629 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1); XGINew_CheckChannel()
630 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x41); XGINew_CheckChannel()
633 if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1) XGINew_CheckChannel()
635 xgifb_reg_set(pVBInfo->P3c4, XGINew_CheckChannel()
644 pVBInfo->ram_bus = 16; /* 16 bits */ XGINew_CheckChannel()
646 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1); XGINew_CheckChannel()
648 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x41); XGINew_CheckChannel()
651 if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1) XGINew_CheckChannel()
657 xgifb_reg_set(pVBInfo->P3c4, XGINew_CheckChannel()
661 xgifb_reg_set(pVBInfo->P3c4, XGINew_CheckChannel()
668 pVBInfo) == 1) XGINew_CheckChannel()
675 pVBInfo->ram_bus = 8; /* 8 bits */ XGINew_CheckChannel()
677 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xB1); XGINew_CheckChannel()
679 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30); XGINew_CheckChannel()
682 if (XGINew_ReadWriteRest(22, 21, pVBInfo) == 1) XGINew_CheckChannel()
686 xgifb_reg_set(pVBInfo->P3c4, XGINew_CheckChannel()
695 pVBInfo->ram_bus = 16; /* 16 bits */ XGINew_CheckChannel()
696 pVBInfo->ram_channel = 1; /* Single channel */ XGINew_CheckChannel()
697 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x51); /* 32Mx16 bit*/ XGINew_CheckChannel()
707 if (XGINew_CheckFrequence(pVBInfo) == 1) { /* DDRII, DDR2x */ XGINew_CheckChannel()
708 pVBInfo->ram_bus = 32; /* 32 bits */ XGINew_CheckChannel()
709 pVBInfo->ram_channel = 2; /* 2 Channel */ XGINew_CheckChannel()
710 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1); XGINew_CheckChannel()
711 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x44); XGINew_CheckChannel()
713 if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1) XGINew_CheckChannel()
716 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21); XGINew_CheckChannel()
717 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x34); XGINew_CheckChannel()
718 if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1) XGINew_CheckChannel()
721 pVBInfo->ram_channel = 1; /* Single Channel */ XGINew_CheckChannel()
722 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1); XGINew_CheckChannel()
723 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x40); XGINew_CheckChannel()
725 if (XGINew_ReadWriteRest(23, 22, pVBInfo) == 1) XGINew_CheckChannel()
727 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21); XGINew_CheckChannel()
728 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x30); XGINew_CheckChannel()
730 pVBInfo->ram_bus = 64; /* 64 bits */ XGINew_CheckChannel()
731 pVBInfo->ram_channel = 1; /* 1 channels */ XGINew_CheckChannel()
732 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1); XGINew_CheckChannel()
733 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x52); XGINew_CheckChannel()
735 if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1) XGINew_CheckChannel()
737 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21); XGINew_CheckChannel()
738 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x42); XGINew_CheckChannel()
745 if (XGINew_CheckFrequence(pVBInfo) == 1) { /* DDRII */ XGINew_CheckChannel()
746 pVBInfo->ram_bus = 32; /* 32 bits */ XGINew_CheckChannel()
747 pVBInfo->ram_channel = 3; XGINew_CheckChannel()
748 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1); XGINew_CheckChannel()
749 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x4C); XGINew_CheckChannel()
751 if (XGINew_ReadWriteRest(25, 23, pVBInfo) == 1) XGINew_CheckChannel()
754 pVBInfo->ram_channel = 2; /* 2 channels */ XGINew_CheckChannel()
755 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x48); XGINew_CheckChannel()
757 if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1) XGINew_CheckChannel()
760 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21); XGINew_CheckChannel()
761 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x3C); XGINew_CheckChannel()
763 if (XGINew_ReadWriteRest(24, 23, pVBInfo) == 1) { XGINew_CheckChannel()
764 pVBInfo->ram_channel = 3; /* 4 channels */ XGINew_CheckChannel()
766 pVBInfo->ram_channel = 2; /* 2 channels */ XGINew_CheckChannel()
767 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x38); XGINew_CheckChannel()
770 pVBInfo->ram_bus = 64; /* 64 bits */ XGINew_CheckChannel()
771 pVBInfo->ram_channel = 2; /* 2 channels */ XGINew_CheckChannel()
772 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0xA1); XGINew_CheckChannel()
773 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x5A); XGINew_CheckChannel()
775 if (XGINew_ReadWriteRest(25, 24, pVBInfo) == 1) XGINew_CheckChannel()
777 xgifb_reg_set(pVBInfo->P3c4, 0x13, 0x21); XGINew_CheckChannel()
778 xgifb_reg_set(pVBInfo->P3c4, 0x14, 0x4A); XGINew_CheckChannel()
785 struct vb_device_info *pVBInfo) XGINew_DDRSizing340()
791 xgifb_reg_set(pVBInfo->P3c4, 0x15, 0x00); /* noninterleaving */ XGINew_DDRSizing340()
792 xgifb_reg_set(pVBInfo->P3c4, 0x1C, 0x00); /* nontiling */ XGINew_DDRSizing340()
793 XGINew_CheckChannel(HwDeviceExtension, pVBInfo); XGINew_DDRSizing340()
807 xgifb_reg_and_or(pVBInfo->P3c4, 0x13, 0x80, dram_table[i][1]); XGINew_DDRSizing340()
810 memsize = XGINew_SetDRAMSize20Reg(dram_table[i][0], pVBInfo); XGINew_DDRSizing340()
815 memsize += (pVBInfo->ram_channel - 2) + 20; XGINew_DDRSizing340()
820 if (XGINew_ReadWriteRest(memsize, start_addr, pVBInfo) == 1) XGINew_DDRSizing340()
828 struct vb_device_info *pVBInfo) XGINew_SetDRAMSize_340()
832 pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress; XGINew_SetDRAMSize_340()
836 data = xgifb_reg_get(pVBInfo->P3c4, 0x21); XGINew_SetDRAMSize_340()
838 xgifb_reg_set(pVBInfo->P3c4, 0x21, (unsigned short)(data & 0xDF)); XGINew_SetDRAMSize_340()
839 XGI_DisplayOff(xgifb_info, HwDeviceExtension, pVBInfo); XGINew_SetDRAMSize_340()
841 XGINew_DDRSizing340(HwDeviceExtension, pVBInfo); XGINew_SetDRAMSize_340()
842 data = xgifb_reg_get(pVBInfo->P3c4, 0x21); XGINew_SetDRAMSize_340()
844 xgifb_reg_set(pVBInfo->P3c4, 0x21, (unsigned short)(data | 0x20)); XGINew_SetDRAMSize_340()
939 static void XGINew_ChkSenseStatus(struct vb_device_info *pVBInfo) XGINew_ChkSenseStatus() argument
943 temp = xgifb_reg_get(pVBInfo->P3d4, 0x32); XGINew_ChkSenseStatus()
965 tempcx = xgifb_reg_get(pVBInfo->P3d4, 0x3d); XGINew_ChkSenseStatus()
966 tempcx |= (xgifb_reg_get(pVBInfo->P3d4, 0x3e) << 8); XGINew_ChkSenseStatus()
969 CR3CData = xgifb_reg_get(pVBInfo->P3d4, 0x3c); XGINew_ChkSenseStatus()
977 xgifb_reg_set(pVBInfo->P3d4, 0x3d, (tempbx & 0x00FF)); XGINew_ChkSenseStatus()
978 xgifb_reg_set(pVBInfo->P3d4, 0x3e, ((tempbx & 0xFF00) >> 8)); XGINew_ChkSenseStatus()
981 static void XGINew_SetModeScratch(struct vb_device_info *pVBInfo) XGINew_SetModeScratch() argument
985 temp = xgifb_reg_get(pVBInfo->P3d4, 0x3d); XGINew_SetModeScratch()
986 temp |= xgifb_reg_get(pVBInfo->P3d4, 0x3e) << 8; XGINew_SetModeScratch()
987 temp |= (xgifb_reg_get(pVBInfo->P3d4, 0x31) & (DriverMode >> 8)) << 8; XGINew_SetModeScratch()
989 if (pVBInfo->IF_DEF_CRT2Monitor == 1) { XGINew_SetModeScratch()
1008 if (pVBInfo->IF_DEF_HiVision == 1) { XGINew_SetModeScratch()
1013 if (pVBInfo->IF_DEF_YPbPr == 1) { XGINew_SetModeScratch()
1027 if (pVBInfo->IF_DEF_HiVision == 1) { XGINew_SetModeScratch()
1032 if (pVBInfo->IF_DEF_YPbPr == 1) { XGINew_SetModeScratch()
1044 xgifb_reg_set(pVBInfo->P3d4, 0x30, tempcl); XGINew_SetModeScratch()
1046 CR31Data = xgifb_reg_get(pVBInfo->P3d4, 0x31); XGINew_SetModeScratch()
1053 xgifb_reg_set(pVBInfo->P3d4, 0x31, CR31Data); XGINew_SetModeScratch()
1055 CR38Data = xgifb_reg_get(pVBInfo->P3d4, 0x38); XGINew_SetModeScratch()
1058 xgifb_reg_set(pVBInfo->P3d4, 0x38, CR38Data); XGINew_SetModeScratch()
1063 struct vb_device_info *pVBInfo) XGINew_SenseLCD()
1080 xgifb_reg_and_or(pVBInfo->P3d4, 0x36, 0xF0, temp); XGINew_SenseLCD()
1085 struct vb_device_info *pVBInfo) XGINew_GetXG21Sense()
1091 xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense); XGINew_GetXG21Sense()
1093 xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); XGINew_GetXG21Sense()
1096 xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); XGINew_GetXG21Sense()
1097 Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0xC0; XGINew_GetXG21Sense()
1099 XGINew_SenseLCD(&xgifb_info->hw_info, pVBInfo); XGINew_GetXG21Sense()
1100 xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense); XGINew_GetXG21Sense()
1102 xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x20, 0x20); XGINew_GetXG21Sense()
1103 if (xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x04) XGINew_GetXG21Sense()
1107 xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, Temp); XGINew_GetXG21Sense()
1109 xgifb_reg_and(pVBInfo->P3d4, 0x4A, ~0x20); XGINew_GetXG21Sense()
1114 static void XGINew_GetXG27Sense(struct vb_device_info *pVBInfo) XGINew_GetXG27Sense() argument
1118 bCR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); XGINew_GetXG27Sense()
1120 xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x07, 0x07); XGINew_GetXG27Sense()
1121 Temp = xgifb_reg_get(pVBInfo->P3d4, 0x48) & 0x07; XGINew_GetXG27Sense()
1122 xgifb_reg_set(pVBInfo->P3d4, 0x4A, bCR4A); XGINew_GetXG27Sense()
1126 xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xC0); XGINew_GetXG27Sense()
1127 xgifb_reg_set(pVBInfo->P3d4, 0x30, 0x21); XGINew_GetXG27Sense()
1130 xgifb_reg_and_or(pVBInfo->P3d4, 0x38, ~0xE0, 0xA0); XGINew_GetXG27Sense()
1132 xgifb_reg_or(pVBInfo->P3d4, 0x32, LCDSense); XGINew_GetXG27Sense()
1135 static unsigned char GetXG21FPBits(struct vb_device_info *pVBInfo) GetXG21FPBits() argument
1139 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); GetXG21FPBits()
1141 xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x10, 0x10); GetXG21FPBits()
1142 CR38 = xgifb_reg_get(pVBInfo->P3d4, 0x38); GetXG21FPBits()
1145 temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); GetXG21FPBits()
1150 xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); GetXG21FPBits()
1155 static unsigned char GetXG27FPBits(struct vb_device_info *pVBInfo) GetXG27FPBits() argument
1159 CR4A = xgifb_reg_get(pVBInfo->P3d4, 0x4A); GetXG27FPBits()
1161 xgifb_reg_and_or(pVBInfo->P3d4, 0x4A, ~0x03, 0x03); GetXG27FPBits()
1162 temp = xgifb_reg_get(pVBInfo->P3d4, 0x48); GetXG27FPBits()
1166 xgifb_reg_set(pVBInfo->P3d4, 0x4A, CR4A); GetXG27FPBits()
1184 struct vb_device_info *pVBInfo = &VBINF; XGIInitNew() local
1187 pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress; XGIInitNew()
1189 if (!pVBInfo->FBAddr) { XGIInitNew()
1190 dev_dbg(&pdev->dev, "pVBInfo->FBAddr == 0\n"); XGIInitNew()
1194 XGIRegInit(pVBInfo, xgifb_info->vga_base); XGIInitNew()
1196 outb(0x67, pVBInfo->P3c2); XGIInitNew()
1198 InitTo330Pointer(HwDeviceExtension->jChipType, pVBInfo); XGIInitNew()
1201 xgifb_reg_set(pVBInfo->P3c4, 0x05, 0x86); XGIInitNew()
1205 XGINew_GetXG21Sense(pdev, pVBInfo); XGIInitNew()
1208 XGINew_GetXG27Sense(pVBInfo); XGIInitNew()
1213 xgifb_reg_set(pVBInfo->P3c4, i, 0); XGIInitNew()
1216 xgifb_reg_set(pVBInfo->P3c4, i, 0); XGIInitNew()
1219 xgifb_reg_set(pVBInfo->P3c4, i, 0); XGIInitNew()
1223 xgifb_reg_set(pVBInfo->P3c4, 0x3B, 0xC0); XGIInitNew()
1226 xgifb_reg_set(pVBInfo->P3d4, i, 0); XGIInitNew()
1229 xgifb_reg_set(pVBInfo->P3d4, 0x97, pVBInfo->XGINew_CR97); XGIInitNew()
1232 xgifb_reg_set(pVBInfo->P3c4, 0x07, XGI330_SR07); XGIInitNew()
1234 xgifb_reg_set(pVBInfo->P3c4, 0x40, XG27_SR40); XGIInitNew()
1235 xgifb_reg_set(pVBInfo->P3c4, 0x41, XG27_SR41); XGIInitNew()
1237 xgifb_reg_set(pVBInfo->P3c4, 0x11, 0x0F); XGIInitNew()
1238 xgifb_reg_set(pVBInfo->P3c4, 0x1F, XGI330_SR1F); XGIInitNew()
1240 xgifb_reg_set(pVBInfo->P3c4, 0x20, 0xA0); XGIInitNew()
1242 xgifb_reg_set(pVBInfo->P3c4, 0x36, 0x70); XGIInitNew()
1244 xgifb_reg_set(pVBInfo->P3c4, 0x36, XG27_SR36); XGIInitNew()
1251 xgifb_reg_set(pVBInfo->P3d4, XGIInitNew()
1256 xgifb_reg_set(pVBInfo->P3d4, XGIInitNew()
1261 xgifb_reg_set(pVBInfo->P3d4, XGIInitNew()
1270 xgifb_reg_set(pVBInfo->P3d4, 0x48, 0x20); /* CR48 */ XGIInitNew()
1274 xgifb_reg_set(pVBInfo->P3c4, 0x23, XGI330_SR23); XGIInitNew()
1275 xgifb_reg_set(pVBInfo->P3c4, 0x24, XGI330_SR24); XGIInitNew()
1276 xgifb_reg_set(pVBInfo->P3c4, 0x25, 0); XGIInitNew()
1280 XGI_UnLockCRT2(pVBInfo); XGIInitNew()
1282 xgifb_reg_and_or(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00); XGIInitNew()
1283 xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00); XGIInitNew()
1285 temp1 = xgifb_reg_get(pVBInfo->P3d4, 0x7B); XGIInitNew()
1287 xgifb_reg_set(pVBInfo->Part1Port, XGIInitNew()
1290 xgifb_reg_set(pVBInfo->Part1Port, 0x2E, 0x08); /* use VB */ XGIInitNew()
1293 xgifb_reg_set(pVBInfo->P3c4, 0x27, 0x1F); XGIInitNew()
1296 XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo) != 0) { XGIInitNew()
1298 xgifb_reg_set(pVBInfo->P3c4, XGIInitNew()
1301 xgifb_reg_set(pVBInfo->P3c4, XGIInitNew()
1305 xgifb_reg_set(pVBInfo->P3c4, 0x31, XGI330_SR31); XGIInitNew()
1306 xgifb_reg_set(pVBInfo->P3c4, 0x32, XGI330_SR32); XGIInitNew()
1308 xgifb_reg_set(pVBInfo->P3c4, 0x33, XGI330_SR33); XGIInitNew()
1311 if (xgifb_bridge_is_on(pVBInfo)) { XGIInitNew()
1312 xgifb_reg_set(pVBInfo->Part2Port, 0x00, 0x1C); XGIInitNew()
1313 xgifb_reg_set(pVBInfo->Part4Port, XGIInitNew()
1315 xgifb_reg_set(pVBInfo->Part4Port, XGIInitNew()
1317 xgifb_reg_set(pVBInfo->Part4Port, XGIInitNew()
1319 xgifb_reg_set(pVBInfo->Part4Port, 0x0F, 0x3F); XGIInitNew()
1320 XGI_LockCRT2(pVBInfo); XGIInitNew()
1324 XGI_SenseCRT1(pVBInfo); XGIInitNew()
1327 xgifb_reg_and_or(pVBInfo->P3d4, XGIInitNew()
1331 temp = GetXG21FPBits(pVBInfo); XGIInitNew()
1332 xgifb_reg_and_or(pVBInfo->P3d4, 0x37, ~0x01, temp); XGIInitNew()
1335 xgifb_reg_and_or(pVBInfo->P3d4, XGIInitNew()
1339 temp = GetXG27FPBits(pVBInfo); XGIInitNew()
1340 xgifb_reg_and_or(pVBInfo->P3d4, 0x37, ~0x03, temp); XGIInitNew()
1343 pVBInfo->ram_type = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo); XGIInitNew()
1346 pVBInfo->P3d4, XGIInitNew()
1347 pVBInfo); XGIInitNew()
1349 XGINew_SetDRAMSize_340(xgifb_info, HwDeviceExtension, pVBInfo); XGIInitNew()
1351 xgifb_reg_set(pVBInfo->P3c4, 0x22, 0xfa); XGIInitNew()
1352 xgifb_reg_set(pVBInfo->P3c4, 0x21, 0xa3); XGIInitNew()
1354 XGINew_ChkSenseStatus(pVBInfo); XGIInitNew()
1355 XGINew_SetModeScratch(pVBInfo); XGIInitNew()
1357 xgifb_reg_set(pVBInfo->P3d4, 0x8c, 0x87); XGIInitNew()
32 XGINew_GetXG20DRAMType(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGINew_GetXG20DRAMType() argument
75 XGINew_DDR1x_MRS_340(unsigned long P3c4, struct vb_device_info *pVBInfo) XGINew_DDR1x_MRS_340() argument
127 XGINew_DDRII_Bootup_XG27( struct xgi_hw_device_info *HwDeviceExtension, unsigned long P3c4, struct vb_device_info *pVBInfo) XGINew_DDRII_Bootup_XG27() argument
200 XGINew_DDR2_MRS_XG20(struct xgi_hw_device_info *HwDeviceExtension, unsigned long P3c4, struct vb_device_info *pVBInfo) XGINew_DDR2_MRS_XG20() argument
245 XGINew_DDR1x_MRS_XG20(unsigned long P3c4, struct vb_device_info *pVBInfo) XGINew_DDR1x_MRS_XG20() argument
273 XGINew_DDR1x_DefaultRegister( struct xgi_hw_device_info *HwDeviceExtension, unsigned long Port, struct vb_device_info *pVBInfo) XGINew_DDR1x_DefaultRegister() argument
350 XGINew_DDR2_DefaultRegister( struct xgi_hw_device_info *HwDeviceExtension, unsigned long Port, struct vb_device_info *pVBInfo) XGINew_DDR2_DefaultRegister() argument
401 XGINew_SetDRAMDefaultRegister340( struct xgi_hw_device_info *HwDeviceExtension, unsigned long Port, struct vb_device_info *pVBInfo) XGINew_SetDRAMDefaultRegister340() argument
501 XGINew_SetDRAMSize20Reg( unsigned short dram_size, struct vb_device_info *pVBInfo) XGINew_SetDRAMSize20Reg() argument
539 XGINew_ReadWriteRest(unsigned short StopAddr, unsigned short StartAddr, struct vb_device_info *pVBInfo) XGINew_ReadWriteRest() argument
582 XGINew_CheckChannel(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGINew_CheckChannel() argument
784 XGINew_DDRSizing340(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGINew_DDRSizing340() argument
826 XGINew_SetDRAMSize_340(struct xgifb_video_info *xgifb_info, struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGINew_SetDRAMSize_340() argument
1061 XGINew_SenseLCD(struct xgi_hw_device_info *HwDeviceExtension, struct vb_device_info *pVBInfo) XGINew_SenseLCD() argument
1084 XGINew_GetXG21Sense(struct pci_dev *pdev, struct vb_device_info *pVBInfo) XGINew_GetXG21Sense() argument

Completed in 129 milliseconds