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

📄 init301.c

📁 一个2.4.21版本的嵌入式linux内核
💻 C
📖 第 1 页 / 共 5 页
字号:
  return;}voidSiS_SetGroup1_LVDS(SiS_Private *SiS_Pr,USHORT  BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,		   USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension,		   USHORT RefreshRateTableIndex){  USHORT modeflag, resinfo;  USHORT push1, push2, tempax, tempbx, tempcx, temp;#ifdef SIS315H  USHORT pushcx;#endif  ULONG  tempeax=0, tempebx, tempecx, tempvcfact=0;  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: Set up Panel Link */  /* 1. Horizontal setup */  tempax = SiS_Pr->SiS_LCDHDES;  if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) &&      (!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) ) {  	tempax -= 8;  }  tempcx = SiS_Pr->SiS_HT;    				  /* Horiz. Total */  tempbx = SiS_Pr->SiS_HDE;                               /* Horiz. Display End */  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {        if((!SiS_Pr->SiS_IF_DEF_DSTN) && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) { 	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempbx =  800;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempbx = 1024;  /* TW */    	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempbx = 1024;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)  tempbx = 1152;  /* TW */	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempbx = 1280;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx = 1280; 	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempbx = 1400; 	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempbx = 1600;         }     }  }  tempcx = (tempcx - tempbx) >> 2;		 /* HT-HDE / 4 */  push1 = tempax;  tempax += tempbx;  if(tempax >= SiS_Pr->SiS_HT) tempax -= SiS_Pr->SiS_HT;  push2 = tempax;    if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {      if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {        if((!SiS_Pr->SiS_IF_DEF_DSTN) && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) {     	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0028;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0018;     	   else if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||	            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) ) {	  	   if(HwDeviceExtension->jChipType < SIS_315H) {		      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {		         tempcx = 0x0017;#ifdef TWNEWPANEL			 tempcx = 0x0018;#endif		      } else {		         tempcx = 0x0017;  /* A901; sometimes 0x0018; */		      }		   } else {		      tempcx = 0x0018;		   }	   }	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0028;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0030;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0030;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0040;        }     }  }  tempcx += tempax;                              /* lcdhrs  */  if(tempcx >= SiS_Pr->SiS_HT) tempcx -= SiS_Pr->SiS_HT;  tempax = tempcx >> 3;                          /* BPLHRS */  temp = tempax & 0x00FF;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x14,temp);		 /* Part1_14h; TW: Panel Link Horizontal Retrace Start  */  if(SiS_Pr->SiS_LCDInfo & LCDPass11) {     temp = (tempax & 0x00FF) + 2;  } else {     temp = (tempax & 0x00FF) + 10;     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {        if(!SiS_Pr->SiS_IF_DEF_DSTN) {           if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {	      temp += 6;              if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {	         temp++;	         if(HwDeviceExtension->jChipType >= SIS_315H) {	            if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) {	               temp += 7;		       if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1600x1200) {		          temp -= 0x14;			  if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1280x768) {			     temp -= 10;			  }		       }	            }	         }	      }           }        }     }  }  temp &= 0x1F;  temp |= ((tempcx & 0x0007) << 5);  if(SiS_Pr->SiS_IF_DEF_FSTN) temp = 0x20;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x15,temp);    	 /* Part1_15h; TW: Panel Link Horizontal Retrace End/Skew */  tempbx = push2;  tempcx = push1;                                /* lcdhdes  */  temp = (tempcx & 0x0007);                      /* BPLHDESKEW  */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1A,temp);   	 /* Part1_1Ah; TW: Panel Link Vertical Retrace Start (2:0) */  tempcx >>= 3;                                  /* BPLHDES */  temp = (tempcx & 0x00FF);  if(ModeNo == 0x5b) temp--;                       SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,temp);    	 /* Part1_16h; TW: Panel Link Horizontal Display Enable Start  */  if(HwDeviceExtension->jChipType < SIS_315H) {       if(tempbx & 0x07) tempbx += 8;                }  tempbx >>= 3;                                  /* BPLHDEE  */  temp = tempbx & 0x00FF;  if(ModeNo == 0x5b) temp--;			   SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x17,temp);   	 /* Part1_17h; TW: Panel Link Horizontal Display Enable End  */  /* 2. Vertical setup */  if(HwDeviceExtension->jChipType < SIS_315H) {     tempcx = SiS_Pr->SiS_VGAVT;     tempbx = SiS_Pr->SiS_VGAVDE;     if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {        if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)       tempbx =  600;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) tempbx =  600;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) tempbx =  768;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768) tempbx =  768;	   else								tempbx = 1024;        }     }     tempcx -= tempbx;  } else {     tempcx = SiS_Pr->SiS_VGAVT - SiS_Pr->SiS_VGAVDE;          /* VGAVT-VGAVDE  */  }  tempbx = SiS_Pr->SiS_LCDVDES;	   		 	 	/* VGAVDES  */  push1 = tempbx;  tempax = SiS_Pr->SiS_VGAVDE;  if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (!SiS_Pr->SiS_IF_DEF_DSTN)) {     if( (SiS_Pr->SiS_IF_DEF_TRUMPION == 0)   &&          (!(SiS_Pr->SiS_LCDInfo & LCDPass11)) &&         (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) ) {        if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempax =  600;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempax =  600;          else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempax =  768;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)  tempax =  768;          else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempax =  768;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempax = 1024;         else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempax = 1050;         else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempax = 1200;      }  }  tempbx += tempax;  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;  push2 = tempbx;  tempcx >>= 1;  if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) {     if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {        if(!SiS_Pr->SiS_IF_DEF_DSTN) {     	   if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0001;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0001;     	   else if((SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768) ||	           (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)) {		   if(HwDeviceExtension->jChipType < SIS_315H) {		      if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {			    tempcx = 0x0002;#ifdef TWNEWPANEL			    tempcx = 0x0003;#endif		      } else {		            tempcx = 0x0002;   /* TW: A901; sometimes 0x0003; */		      }		   } else tempcx = 0x0003;           }     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)  tempcx = 0x0003;     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempcx = 0x0001;     	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0001;	   else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200) tempcx = 0x0001;     	   else 							 tempcx = 0x0057;	}     }  }  tempbx += tempcx;			 	/* BPLVRS  */  if(HwDeviceExtension->jChipType < SIS_315H) {      tempbx++;  }  if(tempbx >= SiS_Pr->SiS_VT) tempbx -= SiS_Pr->SiS_VT;  temp = tempbx & 0x00FF;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x18,temp);       	 /* Part1_18h; TW: Panel Link Vertical Retrace Start  */  tempcx >>= 3;  if(!(SiS_Pr->SiS_LCDInfo & LCDPass11)) {     if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {        if( (HwDeviceExtension->jChipType < SIS_315H) &&            (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) )     tempcx = 0x0001;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)    tempcx = 0x0003;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)   tempcx = 0x0005;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)   tempcx = 0x0005;	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x768)   tempcx = 0x0011;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024)  tempcx = 0x0005;	         else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050)  tempcx = 0x0002;        else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1600x1200)  tempcx = 0x0011;        else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)  {     		if(HwDeviceExtension->jChipType < SIS_315H) {		        if(SiS_Pr->SiS_IF_DEF_LVDS == 1) {				tempcx = 0x0004;#ifdef TWNEWPANEL				tempcx = 0x0005;#endif		        } else {				tempcx = 0x0004;   /* A901; Other BIOS sets 0x0005; */			}		} else {			tempcx = 0x0005;		}        }     }  }  tempcx = tempcx + tempbx + 1;                  /* BPLVRE  */  temp = tempcx & 0x000F;  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x19,0xf0,temp); /* Part1_19h; TW: Panel Link Vertical Retrace End (3:0); Misc.  */  temp = ((tempbx & 0x0700) >> 8) << 3;          /* BPLDESKEW =0 */  if(SiS_Pr->SiS_VGAVDE != SiS_Pr->SiS_VDE)  temp |= 0x40;  if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA)    temp |= 0x40;  if(SiS_Pr->SiS_LCDInfo & LCDRGB18Bit) {      if(HwDeviceExtension->jChipType >= SIS_315H) {         if(SiS_GetReg1(SiS_Pr->SiS_Part1Port,0x00) & 0x01) {            temp |= 0x80;         }      } else {	 if( (HwDeviceExtension->jChipType == SIS_630) ||	     (HwDeviceExtension->jChipType == SIS_730) ) {	    if(HwDeviceExtension->jChipRevision >= 0x30) {	       temp |= 0x80;	    }	 }      }  }  SiS_SetRegANDOR(SiS_Pr->SiS_Part1Port,0x1A,0x87,temp);  /* Part1_1Ah; TW: Panel Link Control Signal (7:3); Vertical Retrace Start (2:0) */  if (HwDeviceExtension->jChipType < SIS_315H) {#ifdef SIS300      /* 300 series */        tempeax = SiS_Pr->SiS_VGAVDE << 6;        temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);        tempeax = tempeax / (ULONG)SiS_Pr->SiS_VDE;        if(temp != 0) tempeax++;        tempebx = tempeax;                         /* BPLVCFACT  */  	if(SiS_Pr->SiS_SetFlag & EnableLVDSDDA) {	   tempebx = 0x003F;	}  	temp = (USHORT)(tempebx & 0x00FF);  	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1E,temp);      /* Part1_1Eh; TW: Panel Link Vertical Scaling Factor */#endif /* SIS300 */  } else {#ifdef SIS315H  /* 310/325 series */#ifdef NEWCH701x        SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x1E,0x03);#else	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1E,0x23);#endif		tempeax = SiS_Pr->SiS_VGAVDE << 18;    	temp = (USHORT)(tempeax % (ULONG)SiS_Pr->SiS_VDE);    	tempeax = tempeax / SiS_Pr->SiS_VDE;    	if(temp != 0) tempeax++;    	tempebx = tempeax;                         /* BPLVCFACT  */        tempvcfact = tempeax;    	temp = (USHORT)(tempebx & 0x00FF);    	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x37,temp);      /* Part1_37h; TW: Panel Link Vertical Scaling Factor */    	temp = (USHORT)((tempebx & 0x00FF00) >> 8);    	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x36,temp);      /* Part1_36h; TW: Panel Link Vertical Scaling Factor */    	temp = (USHORT)((tempebx & 0x00030000) >> 16);    	if(SiS_Pr->SiS_VDE == SiS_Pr->SiS_VGAVDE) temp |= 0x04;    	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x35,temp);      /* Part1_35h; TW: Panel Link Vertical Scaling Factor */#endif /* SIS315H */  }  tempbx = push2;                                  /* BPLVDEE  */  tempcx = push1;  push1 = temp;					     if(!(SiS_Pr->SiS_VBInfo & SetInSlaveMode)) {   	if(!SiS_Pr->SiS_IF_DEF_DSTN){		if(HwDeviceExtension->jChipType < SIS_315H) {			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) {      				if(resinfo == 15) tempcx++;				if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {					if(resinfo == 7) tempcx++;		    		}			} else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {      				if(resinfo == 7) tempcx++;				if(resinfo == 8) tempcx++; /* TW: Doesnt make sense anyway... */			} else  if(resinfo == 8) tempcx++;		} else {			if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) {      				if(resinfo == 7) tempcx++;			}		}	}  }  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel640x480) {     tempcx = SiS_Pr->SiS_VGAVDE;     tempbx = SiS_Pr->SiS_VGAVDE - 1;  }

⌨️ 快捷键说明

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