if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { if(SiS_IsDualLink(SiS_Pr, HwInfo)) { SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c); } else { SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20); }  if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00); #ifdef SET_EMI SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c); #endif SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10); } } return; 
SiS_SetDualLinkEtc(SiS_Pr); return; 
SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,  	      USHORT RefreshRateTableIndex, PSIS_HW_INFO HwInfo){  USHORT tempax,tempcx,tempbx,modeflag,temp,resinfo;  ULONG tempebx,tempeax,templong;  if(ModeNo <= 0x13) {     modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;     resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;  } else if(SiS_Pr->UseCustomMode) {     modeflag = SiS_Pr->CModeFlag;     resinfo = 0;  } else {     modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;     resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;  }  if(HwInfo->jChipType >= SIS_315H) {     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {           SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e);        }     }  }  if(SiS_Pr->SiS_VBType & (VB_SIS301C | VB_SIS302LV)) {     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {        SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x10,0x9f);     }  }  if(HwInfo->jChipType >= SIS_315H) {     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCDA) {        if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	   if(SiS_IsDualLink(SiS_Pr, HwInfo)) {	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);	   } else {	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20);	   }	   if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {	      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);#ifdef SET_EMI	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);#endif	      SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);	   }	}   	return;     }  }  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x13,SiS_Pr->SiS_RVBHCFACT);  tempbx = SiS_Pr->SiS_RVBHCMAX;  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x14,tempbx);  temp = (tempbx >> 1) & 0x80;  tempcx = SiS_Pr->SiS_VGAHT - 1;  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x16,tempcx);  temp |= ((tempcx >> 5) & 0x78);  tempcx = SiS_Pr->SiS_VGAVT - 1;  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) tempcx -= 5;  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x17,tempcx);  temp |= ((tempcx >> 8) & 0x07);  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x15,temp);  tempbx = SiS_Pr->SiS_VGAHDE;  if(modeflag & HalfDCLK)            tempbx >>= 1;  if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {     temp = 0;     if(tempbx > 800)        temp = 0x60;  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {     temp = 0;     if(tempbx == 1024)      temp = 0xA0;     else if(tempbx > 1024)  temp = 0xC0;  } else if(SiS_Pr->SiS_TVMode & (TVSetYPbPr525p | TVSetYPbPr750p)) {     temp = 0;     if(tempbx >= 1280)      temp = 0x40;     else if(tempbx >= 1024) temp = 0x20;  } else {     temp = 0x80;     if(tempbx >= 1024)      temp = 0xA0;  }  if(SiS_Pr->SiS_VBType & VB_SIS301) {     if(SiS_Pr->SiS_LCDResInfo != Panel_1280x1024) temp |= 0x0A;  }  SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x0E,0x10,temp);  tempeax = SiS_Pr->SiS_VGAVDE;  tempebx = SiS_Pr->SiS_VDE;  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {     if(!(temp & 0xE0)) tempebx >>=1;  }  tempcx = SiS_Pr->SiS_RVBHRS;  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x18,tempcx);  tempcx >>= 8;  tempcx |= 0x40;  if(tempeax <= tempebx) {     tempcx ^= 0x40;  } else {     tempeax -= tempebx;  }  tempeax *= (256 * 1024);  templong = tempeax % tempebx;  tempeax /= tempebx;  if(templong) tempeax++;  temp = (USHORT)(tempeax & 0x000000FF);  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1B,temp);  temp = (USHORT)((tempeax & 0x0000FF00) >> 8);  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1A,temp);  temp = (USHORT)((tempeax >> 12) & 0x70); /* sic! */  temp |= (tempcx & 0x4F);  SiS_SetReg(SiS_Pr->SiS_Part4Port,0x19,temp);  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1C,0x28);     /* Calc Linebuffer max address and set/clear decimode */     tempbx = 0;     if(SiS_Pr->SiS_TVMode & (TVSetHiVision | TVSetYPbPr750p)) tempbx = 0x08;     tempax = SiS_Pr->SiS_VGAHDE;     if(modeflag & HalfDCLK)            tempax >>= 1;     if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempax >>= 1;     if(tempax > 800) {        if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {	   tempax -= 800;	} else {  /* 651+301C: Only if TVNoHiviNoYPbPr */	   tempbx = 0x08;           if(tempax == 1024) tempax *= 25;           else	              tempax *= 20;	   temp = tempax % 32;	   tempax /= 32;	   if(temp) tempax++;	   tempax++;	   if((SiS_Pr->SiS_VBInfo & SetCRT2ToTVNoYPbPrHiVision) ||	      (SiS_Pr->SiS_TVMode & TVSetYPbPr525i)) {	      if(resinfo == SIS_RI_1024x768) {	         /* Otherwise white line at right edge */	         tempax = (tempax & 0xff00) | 0x20;	      }	   }	}     }     tempax--;     temp = ((tempax >> 4) & 0x30) | tempbx;     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1D,tempax);     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x1E,temp);     temp = 0x0036; tempbx = 0xD0;     if((HwInfo->jChipType >= SIS_315H) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {	temp = 0x0026; tempbx = 0xC0; /* See En/DisableBridge() */     }     if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {        if(!(SiS_Pr->SiS_TVMode & (TVSetNTSC1024 | TVSetHiVision | TVSetYPbPr750p | TVSetYPbPr525p))) {	   temp |= 0x01;	   if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {	      if(!(SiS_Pr->SiS_TVMode & TVSetTVSimuMode)) {  	         temp &= ~0x01;	      }	   }	}     }     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x1F,tempbx,temp);     tempbx = SiS_Pr->SiS_HT >> 1;     if(SiS_IsDualLink(SiS_Pr, HwInfo)) tempbx >>= 1;     tempbx -= 2;     SiS_SetReg(SiS_Pr->SiS_Part4Port,0x22,tempbx);     temp = (tempbx >> 5) & 0x38;     SiS_SetRegANDOR(SiS_Pr->SiS_Part4Port,0x21,0xC0,temp);     if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) {	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {           SiS_SetReg(SiS_Pr->SiS_Part4Port,0x24,0x0e);	   /* LCD-too-dark-error-source, see FinalizeLCD() */	}	if(HwInfo->jChipType >= SIS_315H) {	   if(SiS_IsDualLink(SiS_Pr, HwInfo)) {	      SiS_SetRegOR(SiS_Pr->SiS_Part4Port,0x27,0x2c);	   } else {	      SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x27,~0x20);	   }	}	if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) {	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x2a,0x00);#ifdef SET_EMI	   SiS_SetRegAND(SiS_Pr->SiS_Part4Port,0x30,0x0c);#endif	   SiS_SetReg(SiS_Pr->SiS_Part4Port,0x34,0x10);	}     }  }  /* 301B */  SiS_SetCRT2VCLK(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/544393fe584d333480659a4bed30f5295355df11/init301.c/clean/drivers/video/sis/init301.c