SiS_Pr->SiS_VDE       = SiS_Pr->SiS_VGAVDE; 
SiS_Pr->SiS_VDE       = SiS_Pr->SiS_VGAVDE;  tempax = SiS_Pr->CHTotal; if(modeflag & HalfDCLK) tempax <<= 1; SiS_Pr->SiS_VGAHT = SiS_Pr->SiS_HT = tempax; SiS_Pr->SiS_VGAVT = SiS_Pr->SiS_VT = SiS_Pr->CVTotal; 
SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,                   USHORT RefreshRateTableIndex,		   PSIS_HW_INFO HwInfo){  UCHAR  *ROMAddr = NULL;  USHORT tempax,tempbx,modeflag,romptr=0;  USHORT resinfo,CRT2Index,ResIndex;  const SiS_LCDDataStruct *LCDPtr = NULL;  const SiS_TVDataStruct  *TVPtr  = NULL;#ifdef SIS315H  SHORT  resinfo661;#endif  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;#ifdef SIS315H     resinfo661 = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].ROMMODEIDX661;     if( (SiS_Pr->SiS_VBInfo & SetCRT2ToLCD)   &&         (SiS_Pr->SiS_SetFlag & LCDVESATiming) &&         (resinfo661 >= 0)                     &&	 (SiS_Pr->SiS_NeedRomModeData) ) {        if((ROMAddr = GetLCDStructPtr661(SiS_Pr, HwInfo))) {	   if((romptr = (SISGETROMW(21)))) {              romptr += (resinfo661 * 10);	      ROMAddr = HwInfo->pjVirtualRomBase;	   }	}     }#endif  }    SiS_Pr->SiS_NewFlickerMode = 0;  SiS_Pr->SiS_RVBHRS = 50;  SiS_Pr->SiS_RY1COE = 0;  SiS_Pr->SiS_RY2COE = 0;  SiS_Pr->SiS_RY3COE = 0;  SiS_Pr->SiS_RY4COE = 0;  SiS_GetCRT2ResInfo(SiS_Pr,ModeNo,ModeIdIndex,HwInfo);  if(SiS_Pr->SiS_VBInfo & SetCRT2ToRAMDAC){     if(SiS_Pr->UseCustomMode) {        SiS_Pr->SiS_RVBHCMAX  = 1;        SiS_Pr->SiS_RVBHCFACT = 1;        SiS_Pr->SiS_VGAHT     = SiS_Pr->CHTotal;        SiS_Pr->SiS_VGAVT     = SiS_Pr->CVTotal;        SiS_Pr->SiS_HT        = SiS_Pr->CHTotal;        SiS_Pr->SiS_VT        = SiS_Pr->CVTotal;	SiS_Pr->SiS_HDE       = SiS_Pr->SiS_VGAHDE;        SiS_Pr->SiS_VDE       = SiS_Pr->SiS_VGAVDE;     } else {        SiS_GetRAMDAC2DATA(SiS_Pr, ModeNo, ModeIdIndex, RefreshRateTableIndex, HwInfo);     }  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {     SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,                    &CRT2Index,&ResIndex,HwInfo);     switch(CRT2Index) {        case  2: TVPtr = SiS_Pr->SiS_ExtHiTVData;   break;        case  3: TVPtr = SiS_Pr->SiS_ExtPALData;    break;        case  4: TVPtr = SiS_Pr->SiS_ExtNTSCData;   break;        case  5: TVPtr = SiS_Pr->SiS_Ext525iData;   break;        case  6: TVPtr = SiS_Pr->SiS_Ext525pData;   break;        case  7: TVPtr = SiS_Pr->SiS_Ext750pData;   break;        case  8: TVPtr = SiS_Pr->SiS_StPALData;     break;        case  9: TVPtr = SiS_Pr->SiS_StNTSCData;    break;        case 10: TVPtr = SiS_Pr->SiS_St525iData;    break;        case 11: TVPtr = SiS_Pr->SiS_St525pData;    break;        case 12: TVPtr = SiS_Pr->SiS_St750pData;    break;        case 13: TVPtr = SiS_Pr->SiS_St1HiTVData;   break;        case 14: TVPtr = SiS_Pr->SiS_St2HiTVData;   break;        default: TVPtr = SiS_Pr->SiS_StPALData;     break;     }     SiS_Pr->SiS_RVBHCMAX  = (TVPtr+ResIndex)->RVBHCMAX;     SiS_Pr->SiS_RVBHCFACT = (TVPtr+ResIndex)->RVBHCFACT;     SiS_Pr->SiS_VGAHT     = (TVPtr+ResIndex)->VGAHT;     SiS_Pr->SiS_VGAVT     = (TVPtr+ResIndex)->VGAVT;     SiS_Pr->SiS_HDE       = (TVPtr+ResIndex)->TVHDE;     SiS_Pr->SiS_VDE       = (TVPtr+ResIndex)->TVVDE;     SiS_Pr->SiS_RVBHRS    = (TVPtr+ResIndex)->RVBHRS;     SiS_Pr->SiS_NewFlickerMode = (TVPtr+ResIndex)->FlickerMode;     if(modeflag & HalfDCLK) {        SiS_Pr->SiS_RVBHRS = (TVPtr+ResIndex)->HALFRVBHRS;     }     if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVision) {        if((resinfo == SIS_RI_1024x768)  ||           (resinfo == SIS_RI_1280x1024) ||           (resinfo == SIS_RI_1280x720)) {	   SiS_Pr->SiS_NewFlickerMode = 0x40;	}        if(SiS_Pr->SiS_VGAVDE == 350) SiS_Pr->SiS_TVMode |= TVSetTVSimuMode;        SiS_Pr->SiS_HT = ExtHiTVHT;        SiS_Pr->SiS_VT = ExtHiTVVT;        if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) {           if(SiS_Pr->SiS_TVMode & TVSetTVSimuMode) {              SiS_Pr->SiS_HT = StHiTVHT;              SiS_Pr->SiS_VT = StHiTVVT;#if 0              if(!(modeflag & Charx8Dot)) {                 SiS_Pr->SiS_HT = StHiTextTVHT;                 SiS_Pr->SiS_VT = StHiTextTVVT;              }#endif           }        }     } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToYPbPr525750) {        if(SiS_Pr->SiS_TVMode & TVSetYPbPr750p) {           SiS_Pr->SiS_HT = 1650;           SiS_Pr->SiS_VT = 750;	} else if(SiS_Pr->SiS_TVMode & TVSetYPbPr525p) {	   SiS_Pr->SiS_HT = NTSCHT;	   SiS_Pr->SiS_VT = NTSCVT;        } else {           SiS_Pr->SiS_HT = NTSCHT;	   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT;           SiS_Pr->SiS_VT = NTSCVT;        }     } else {        SiS_Pr->SiS_RY1COE = (TVPtr+ResIndex)->RY1COE;        SiS_Pr->SiS_RY2COE = (TVPtr+ResIndex)->RY2COE;        SiS_Pr->SiS_RY3COE = (TVPtr+ResIndex)->RY3COE;        SiS_Pr->SiS_RY4COE = (TVPtr+ResIndex)->RY4COE;        if(modeflag & HalfDCLK) {           SiS_Pr->SiS_RY1COE = 0x00;           SiS_Pr->SiS_RY2COE = 0xf4;           SiS_Pr->SiS_RY3COE = 0x10;           SiS_Pr->SiS_RY4COE = 0x38;        }        if(!(SiS_Pr->SiS_TVMode & TVSetPAL)) {           SiS_Pr->SiS_HT = NTSCHT;	   if(SiS_Pr->SiS_TVMode & TVSetNTSC1024) SiS_Pr->SiS_HT = NTSC2HT;           SiS_Pr->SiS_VT = NTSCVT;        } else {           SiS_Pr->SiS_HT = PALHT;           SiS_Pr->SiS_VT = PALVT;        }     }  } else if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {     SiS_Pr->SiS_RVBHCMAX  = 1;     SiS_Pr->SiS_RVBHCFACT = 1;     if(SiS_Pr->UseCustomMode) {        SiS_Pr->SiS_VGAHT = SiS_Pr->CHTotal;        SiS_Pr->SiS_VGAVT = SiS_Pr->CVTotal;        SiS_Pr->SiS_HT    = SiS_Pr->CHTotal;        SiS_Pr->SiS_VT    = SiS_Pr->CVTotal;	SiS_Pr->SiS_HDE   = SiS_Pr->SiS_VGAHDE;        SiS_Pr->SiS_VDE   = SiS_Pr->SiS_VGAVDE;     } else {        BOOLEAN gotit = FALSE;        if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) {           SiS_Pr->SiS_VGAHT = SiS_Pr->PanelHT;           SiS_Pr->SiS_VGAVT = SiS_Pr->PanelVT;           SiS_Pr->SiS_HT    = SiS_Pr->PanelHT;           SiS_Pr->SiS_VT    = SiS_Pr->PanelVT;	   gotit = TRUE;	} else if( (!(SiS_Pr->SiS_LCDInfo & DontExpandLCD)) && (romptr) && (ROMAddr) ) {#ifdef SIS315H	   SiS_Pr->SiS_RVBHCMAX  = ROMAddr[romptr];           SiS_Pr->SiS_RVBHCFACT = ROMAddr[romptr+1];           SiS_Pr->SiS_VGAHT     = ROMAddr[romptr+2] | ((ROMAddr[romptr+3] & 0x0f) << 8);           SiS_Pr->SiS_VGAVT     = ROMAddr[romptr+4] | ((ROMAddr[romptr+3] & 0xf0) << 4);           SiS_Pr->SiS_HT        = ROMAddr[romptr+5] | ((ROMAddr[romptr+6] & 0x0f) << 8);           SiS_Pr->SiS_VT        = ROMAddr[romptr+7] | ((ROMAddr[romptr+6] & 0xf0) << 4);	   if(SiS_Pr->SiS_VGAHT) gotit = TRUE;	   else {	      SiS_Pr->SiS_LCDInfo |= DontExpandLCD;	      SiS_Pr->SiS_LCDInfo &= ~LCDPass11;	      SiS_Pr->SiS_VGAHT   = SiS_Pr->PanelHT;              SiS_Pr->SiS_VGAVT   = SiS_Pr->PanelVT;              SiS_Pr->SiS_HT      = SiS_Pr->PanelHT;              SiS_Pr->SiS_VT      = SiS_Pr->PanelVT;	      gotit = TRUE;	   }#endif	}	if(!gotit) {           SiS_GetCRT2Ptr(SiS_Pr,ModeNo,ModeIdIndex,RefreshRateTableIndex,                          &CRT2Index,&ResIndex,HwInfo);           switch(CRT2Index) {	      case Panel_1024x768      : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;   break;	      case Panel_1024x768  + 32: LCDPtr = SiS_Pr->SiS_St2LCD1024x768Data;   break;	      case Panel_1280x720      :	      case Panel_1280x720  + 32: LCDPtr = SiS_Pr->SiS_LCD1280x720Data;      break;	      case Panel_1280x768_2    : LCDPtr = SiS_Pr->SiS_ExtLCD1280x768_2Data; break;              case Panel_1280x768_2+ 32: LCDPtr = SiS_Pr->SiS_StLCD1280x768_2Data;  break;	      case Panel_1280x800      :	      case Panel_1280x800  + 32: LCDPtr = SiS_Pr->SiS_LCD1280x800Data;      break;	      case Panel_1280x800_2    :	      case Panel_1280x800_2+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x800_2Data;    break;	      case Panel_1280x960      :	      case Panel_1280x960  + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data;      break;              case Panel_1280x1024     : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data;  break;              case Panel_1280x1024 + 32: LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;  break;              case Panel_1400x1050     : LCDPtr = SiS_Pr->SiS_ExtLCD1400x1050Data;  break;              case Panel_1400x1050 + 32: LCDPtr = SiS_Pr->SiS_StLCD1400x1050Data;   break;              case Panel_1600x1200     : LCDPtr = SiS_Pr->SiS_ExtLCD1600x1200Data;  break;              case Panel_1600x1200 + 32: LCDPtr = SiS_Pr->SiS_StLCD1600x1200Data;   break;	      case Panel_1680x1050     :	      case Panel_1680x1050 + 32: LCDPtr = SiS_Pr->SiS_LCD1680x1050Data;     break;	      case 100		       : LCDPtr = SiS_Pr->SiS_NoScaleData;	    break;#ifdef SIS315H	      case 200                 : LCDPtr = SiS310_ExtCompaq1280x1024Data;    break;	      case 201                 : LCDPtr = SiS_Pr->SiS_St2LCD1280x1024Data;  break;#endif              default                  : LCDPtr = SiS_Pr->SiS_ExtLCD1024x768Data;   break;           }#ifdef TWDEBUG           xf86DrvMsg(0, X_INFO, "GetCRT2Data: Index %d ResIndex %d\n", CRT2Index, ResIndex);#endif           SiS_Pr->SiS_RVBHCMAX  = (LCDPtr+ResIndex)->RVBHCMAX;           SiS_Pr->SiS_RVBHCFACT = (LCDPtr+ResIndex)->RVBHCFACT;           SiS_Pr->SiS_VGAHT     = (LCDPtr+ResIndex)->VGAHT;           SiS_Pr->SiS_VGAVT     = (LCDPtr+ResIndex)->VGAVT;           SiS_Pr->SiS_HT        = (LCDPtr+ResIndex)->LCDHT;           SiS_Pr->SiS_VT        = (LCDPtr+ResIndex)->LCDVT;        }	tempax = SiS_Pr->PanelXRes;        tempbx = SiS_Pr->PanelYRes;	if(SiS_Pr->SiS_LCDResInfo == Panel_1024x768) {           if(SiS_Pr->SiS_SetFlag & LCDVESATiming) {              if(HwInfo->jChipType < SIS_315H) {                 if     (SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;                 else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;              }           } else {              if     (SiS_Pr->SiS_VGAVDE == 357) tempbx = 527;              else if(SiS_Pr->SiS_VGAVDE == 420) tempbx = 620;              else if(SiS_Pr->SiS_VGAVDE == 525) tempbx = 775;              else if(SiS_Pr->SiS_VGAVDE == 600) tempbx = 775;              else if(SiS_Pr->SiS_VGAVDE == 350) tempbx = 560;              else if(SiS_Pr->SiS_VGAVDE == 400) tempbx = 640;           }	} else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) {           if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 700;           else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 800;           else if(SiS_Pr->SiS_VGAVDE == 1024) tempbx = 960;	} else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) {           if     (SiS_Pr->SiS_VGAVDE == 360) tempbx = 768;           else if(SiS_Pr->SiS_VGAVDE == 375) tempbx = 800;           else if(SiS_Pr->SiS_VGAVDE == 405) tempbx = 864;        } else if(SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) {	   if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {              if     (SiS_Pr->SiS_VGAVDE == 350)  tempbx = 875;              else if(SiS_Pr->SiS_VGAVDE == 400)  tempbx = 1000;           }        }        if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {           tempax = SiS_Pr->SiS_VGAHDE;           tempbx = SiS_Pr->SiS_VGAVDE;        }        SiS_Pr->SiS_HDE = tempax;        SiS_Pr->SiS_VDE = tempbx;     }  }}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/544393fe584d333480659a4bed30f5295355df11/init301.c/clean/drivers/video/sis/init301.c