⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 init301.c

📁 一个2.4.21版本的嵌入式linux内核
💻 C
📖 第 1 页 / 共 5 页
字号:
    	          SiS_SetGroup1_LVDS(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,	                              HwDeviceExtension,RefreshRateTableIndex);              }	   } else {	      SiS_SetGroup1_LVDS(SiS_Pr,BaseAddr,ROMAddr,ModeNo,ModeIdIndex,	                         HwDeviceExtension,RefreshRateTableIndex);	   }		}     }   } /* LCDA */}voidSiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,                  PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex){  USHORT  push1,push2;  USHORT  tempax,tempbx,tempcx,temp;  USHORT  resinfo,modeflag;  if(ModeNo <= 0x13) {    	modeflag = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ModeFlag;    	resinfo = SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo;  } else {    	modeflag = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_ModeFlag;    	resinfo = SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO;  }  /* TW: The following is only done if bridge is in slave mode: */  tempax = 0xFFFF;  if(!(SiS_Pr->SiS_VBInfo & SetCRT2ToTV))  tempax = SiS_GetVGAHT2(SiS_Pr);  if(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV) {  	modeflag |= Charx8Dot;  }  if(modeflag & Charx8Dot) tempcx = 0x08;  else                     tempcx = 0x09;  if(tempax >= SiS_Pr->SiS_VGAHT) tempax = SiS_Pr->SiS_VGAHT;  if(modeflag & HalfDCLK) tempax >>= 1;  tempax = (tempax / tempcx) - 5;  tempbx = tempax & 0x00FF;  temp = 0xFF;                                                  /* set MAX HT */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x03,temp);  tempax = SiS_Pr->SiS_VGAHDE;                                 	/* 0x04 Horizontal Display End */  if(modeflag & HalfDCLK) tempax >>= 1;  tempax = (tempax / tempcx) - 1;  tempbx |= ((tempax & 0x00FF) << 8);  temp = tempax & 0x00FF;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x04,temp);  temp = (tempbx & 0xFF00) >> 8;  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {        if(!(SiS_Pr->SiS_VBType & VB_SIS301BLV302BLV)) {            	    temp += 2;        }  }	  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {     if(SiS_Pr->SiS_HiVision == 3) {              if(resinfo == 7) temp -= 2;     }  }  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x05,temp);                 /* 0x05 Horizontal Display Start */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x06,0x03);                 /* 0x06 Horizontal Blank end     */  if((SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&     (SiS_Pr->SiS_HiVision == 3)) {    temp = (tempbx & 0x00FF) - 1;    if(!(modeflag & HalfDCLK)) {      temp -= 6;      if(SiS_Pr->SiS_SetFlag & TVSimuMode) {        temp -= 2;        if(ModeNo > 0x13) temp -= 10;      }    }  } else {    tempcx = tempbx & 0x00FF;    tempbx = (tempbx & 0xFF00) >> 8;    tempcx = (tempcx + tempbx) >> 1;    temp = (tempcx & 0x00FF) + 2;    if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV){       temp--;       if(!(modeflag & HalfDCLK)){          if((modeflag & Charx8Dot)){             temp += 4;             if(SiS_Pr->SiS_VGAHDE >= 800) temp -= 6;             if(HwDeviceExtension->jChipType >= SIS_315H) {	        if(SiS_Pr->SiS_VGAHDE == 800) temp += 2;             }          }       }    } else {       if(!(modeflag & HalfDCLK)) {          temp -= 4;          if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) {             if(SiS_Pr->SiS_VGAHDE >= 800) {                temp -= 7;	        if(HwDeviceExtension->jChipType < SIS_315H) {	           /* 650/301LV(x) does not do this, 630/301B, 300/301LV do */                   if(SiS_Pr->SiS_ModeType == ModeEGA) {                      if(SiS_Pr->SiS_VGAVDE == 1024) {                         temp += 15;                         if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x1024) 			    temp += 7;                      }                   }	        }                if(SiS_Pr->SiS_VGAHDE >= 1280) {                   if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x960) {                      if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) temp += 28;                   }                }             }          }       }    }  }  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,temp);               	/* 0x07 Horizontal Retrace Start */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x00);                 /* 0x08 Horizontal Retrace End   */  if(SiS_Pr->SiS_VBInfo & SetCRT2ToTV) {     if(SiS_Pr->SiS_SetFlag & TVSimuMode) {            if(ModeNo <= 0x01) {	        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x2a);		if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x61);		} else {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x41);		}	    } else if(SiS_Pr->SiS_ModeType == ModeText) {	        if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x54);		} else {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x55);		}		SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x00);	    } else if(ModeNo <= 0x13) {	        if(modeflag & HalfDCLK) {		    if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {		        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x30);			SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);		    } else {		        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x2f);			SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x02);		    }		} else {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x5b);		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);		}	    } else if( ((HwDeviceExtension->jChipType >= SIS_315H) && (ModeNo == 0x50)) ||	               ((HwDeviceExtension->jChipType < SIS_315H) && (resinfo == 0 || resinfo == 1)) ) {	        if(!(SiS_Pr->SiS_VBInfo & SetPALTV)) {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x30);		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);		} else {		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0x2f);		    SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x08,0x03);		}	    }     }  }  if(SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) {     if(SiS_Pr->SiS_HiVision & 0x03) {        SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0xb2);	if(SiS_Pr->SiS_HiVision & 0x02) {	   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x07,0xab);	}     }  }  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,0x03);                	/* 0x18 SR08 (FIFO Threshold?)   */  SiS_SetRegAND(SiS_Pr->SiS_Part1Port,0x19,0xF0);  tempbx = SiS_Pr->SiS_VGAVT;  push1 = tempbx;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x09,0xFF);                	/* 0x09 Set Max VT    */  tempcx = 0x121;  tempbx = SiS_Pr->SiS_VGAVDE;                               	/* 0x0E Vertical Display End */  if(tempbx == 357) tempbx = 350;  if(tempbx == 360) tempbx = 350;  if(tempbx == 375) tempbx = 350;  if(tempbx == 405) tempbx = 400;  if(tempbx == 420) tempbx = 400;  if(tempbx == 525) tempbx = 480;  push2 = tempbx;  if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {    	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) {      		if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) {        		if(tempbx == 350) tempbx += 5;        		if(tempbx == 480) tempbx += 5;      		}    	}  }  tempbx--;  temp = tempbx & 0x00FF;  tempbx--;  temp = tempbx & 0x00FF;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x10,temp);        		/* 0x10 vertical Blank Start */  tempbx = push2;  tempbx--;  temp = tempbx & 0x00FF;#if 0  /* TW: Missing code from 630/301B 2.04.5a and 650/302LV 1.10.6s (calles int 2f) */  if(xxx()) {      if(temp == 0xdf) temp = 0xda;  }#endif  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0E,temp);  if(tempbx & 0x0100) {  	tempcx |= 0x0002;	if(SiS_Pr->SiS_VBType & VB_SIS301) tempcx |= 0x000a;  }  tempax = 0x000B;  if(modeflag & DoubleScanMode) tempax |= 0x8000;  if(tempbx & 0x0200) {  	tempcx |= 0x0040;	if(SiS_Pr->SiS_VBType & VB_SIS301) tempax |= 0x2000;  }  if(SiS_Pr->SiS_VBType & VB_SIS301) {        if(SiS_Pr->SiS_VBInfo & SetPALTV) {	      if(SiS_Pr->SiS_VGAVDE == 480) {	             tempax = (tempax & 0x00ff) | 0x2000;		     if(modeflag & DoubleScanMode)  tempax |= 0x8000;	      }	}  }  temp = (tempax & 0xFF00) >> 8;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0B,temp);  if(tempbx & 0x0400) tempcx |= 0x0600;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x11,0x00);                	/* 0x11 Vertical Blank End */  tempax = push1;  tempax -= tempbx;  tempax >>= 2;  push1 = tempax;  if(HwDeviceExtension->jChipType >= SIS_315H) {        /* TW: 650/30xLV 1.10.6s */        if(ModeNo > 0x13) {	    if(resinfo != 0x09) {  /* 1280x1024 */	        tempax <<= 1;		tempbx += tempax;	    }	} else {	    if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1400x1050) {	        tempax <<= 1;		tempbx += tempax;	    }	}  } else if((resinfo != 0x09) || (SiS_Pr->SiS_VBType & VB_SIS301)) {    	tempax <<= 1;    	tempbx += tempax;  }  if( (SiS_Pr->SiS_VBInfo & SetCRT2ToHiVisionTV) &&      (SiS_Pr->SiS_HiVision == 3) ) {    	tempbx -= 10;  } else {    	if(SiS_Pr->SiS_SetFlag & TVSimuMode) {      	   if(SiS_Pr->SiS_VBInfo & SetPALTV) {	       if(!(SiS_Pr->SiS_HiVision & 0x03)) {                    tempbx += 40;		    if(HwDeviceExtension->jChipType >= SIS_315H) {		       if(SiS_Pr->SiS_VGAHDE == 800) tempbx += 10;		    }      	       }	   }    	}  }  tempax = push1;  tempax >>= 2;  tempax++;  tempax += tempbx;  push1 = tempax;  if(SiS_Pr->SiS_VBInfo & SetPALTV) {    	if(tempbx <= 513)  {      		if(tempax >= 513) tempbx = 513;    	}  }  temp = tempbx & 0x00FF;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0C,temp);			/* 0x0C Vertical Retrace Start */  if(!(SiS_Pr->SiS_VBType & VB_SIS301)) {  	tempbx--;  	temp = tempbx & 0x00FF;  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x10,temp);	if(tempbx & 0x0100) tempcx |= 0x0008;  	if(tempbx & 0x0200) {    	   SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x0B,0x20);	}  	tempbx++;  }  if(tempbx & 0x0100) tempcx |= 0x0004;  if(tempbx & 0x0200) tempcx |= 0x0080;  if(tempbx & 0x0400) {        if(SiS_Pr->SiS_VBType & VB_SIS301) tempcx |= 0x0800;  	else                               tempcx |= 0x0C00;  }  tempbx = push1;  temp = tempbx & 0x00FF;  temp &= 0x0F;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0D,temp);        		/* 0x0D vertical Retrace End */  if(tempbx & 0x0010) tempcx |= 0x2000;  temp = tempcx & 0x00FF;  if(SiS_Pr->SiS_VBType & VB_SIS301) {	if(SiS_Pr->SiS_VBInfo & SetPALTV) {	      if(SiS_Pr->SiS_VGAVDE == 480)  temp = 0xa3;	}  }  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0A,temp);              	/* 0x0A CR07 */  temp = (tempcx & 0xFF00) >> 8;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,temp);              	/* 0x17 SR0A */  tempax = modeflag;  temp = (tempax & 0xFF00) >> 8;  temp = (temp >> 1) & 0x09;  if(!(SiS_Pr->SiS_VBType & VB_SIS301)) {       /* Only use 8 dot clock */       temp |= 0x01;  }  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,temp);              	/* 0x16 SR01 */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x0F,0x00);              	/* 0x0F CR14 */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x12,0x00);              	/* 0x12 CR17 */  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {       if(IS_SIS650) {           /* TW: 650/30xLV 1.10.6s */           if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {	       temp = 0x80;	   }       } else temp = 0x80;  } else  temp = 0x00;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1A,temp);                	/* 0x1A SR0E */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -