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

📄 init301.c

📁 该文件是rt_linux
💻 C
📖 第 1 页 / 共 5 页
字号:
  } else  temp = 0x00;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1A,temp);                         	/* 0x1A SR0E */  return;}/* TW: Checked against 650/LVDS 1.10.07, 630/301B (I,II) and 630/LVDS BIOS */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, pushcx;  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;  }#ifdef LINUX_XF86#ifdef TWDEBUG  xf86DrvMsg(0, X_INFO, "(init301: LCDHDES 0x%03x LCDVDES 0x%03x)\n", SiS_Pr->SiS_LCDHDES, SiS_Pr->SiS_LCDVDES);  xf86DrvMsg(0, X_INFO, "(init301: HDE     0x%03x VDE     0x%03x)\n", SiS_Pr->SiS_HDE, SiS_Pr->SiS_VDE);  xf86DrvMsg(0, X_INFO, "(init301: VGAHDE  0x%03x VGAVDE  0x%03x)\n", SiS_Pr->SiS_VGAHDE, SiS_Pr->SiS_VGAVDE);  xf86DrvMsg(0, X_INFO, "(init301: HT      0x%03x VT      0x%03x)\n", SiS_Pr->SiS_HT, SiS_Pr->SiS_VT);  xf86DrvMsg(0, X_INFO, "(init301: VGAHT   0x%03x VGAVT   0x%03x)\n", SiS_Pr->SiS_VGAHT, SiS_Pr->SiS_VGAVT);#endif#endif  /* 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 & LCDNonExpanding) {    if(!SiS_Pr->SiS_IF_DEF_DSTN) { 	if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempbx = 800;    	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempbx = 1024;	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempbx = 1024;  /* TW: not done in BIOS */	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)  tempbx = 1152;  /* TW: not done in BIOS */	else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempbx = 1280;  /* TW */        else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)   tempbx = 1400;  /* TW */    }  }  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_VBInfo & SetCRT2ToLCD) {       if(!SiS_Pr->SiS_IF_DEF_DSTN){     	  if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempcx = 0x0028;     	  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempcx = 0x0030;     	  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; other 301B BIOS 0x0018; */		     }		} else {		     tempcx = 0x0018;		}	  }	  else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempcx = 0x0018;     	  else if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)   tempcx = 0x0030;       }  }  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  */  temp = (tempax & 0x00FF) + 10;  /* TW: Inserted this entire "if"-section from 650/LVDS BIOS */  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 -= 3;	       }	    }	  }        }      }  }  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--;                     /* fix fstn mode=5b */  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x16,temp);    	 /* Part1_16h; TW: Panel Link Horizontal Display Enable Start  */  if(HwDeviceExtension->jChipType < SIS_315H) {  /* TW: Not done in LVDS BIOS 1.10.07 */     if(tempbx & 0x07) tempbx += 8;              /* TW: Done in 630/301B and 630/LVDS BIOSes */  }  tempbx >>= 3;                                  /* BPLHDEE  */  temp = tempbx & 0x00FF;  if(ModeNo == 0x5b) temp--;			 /* fix fstn mode=5b */  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) {      /* TW: This entire section from 630/301B and 630/LVDS/LVDS+CH BIOS */      tempcx = SiS_Pr->SiS_VGAVT;      tempbx = SiS_Pr->SiS_VGAVDE;      if(SiS_Pr->SiS_LCDInfo & LCDNonExpanding) {         if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480) {	    tempbx = 600;	    if(SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel800x600) {	       tempbx = 768;	       if( (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1024x768) &&	           (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel1152x768) ) {	 	    tempbx = 600;	       }	    }         }      }      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_IF_DEF_TRUMPION == 0) && (!(SiS_Pr->SiS_LCDInfo & LCDPass11))                                && (SiS_Pr->SiS_LCDResInfo != SiS_Pr->SiS_Panel640x480)) {    	if(SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) {	    if(!SiS_Pr->SiS_IF_DEF_DSTN){      		if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600)        tempax = 600;      		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x768)  tempax = 768;		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600)  tempax = 600;   /* TW */      		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1152x768)  tempax = 768;   /* TW */		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1280x1024) tempax = 1024;  /* TW */		else if(SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1400x1050) tempax = 1050;  /* TW */		else                                                          tempax = 600;            }    	}  }  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_IF_DEF_DSTN){     	if( (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel800x600) ||	    (SiS_Pr->SiS_LCDResInfo == SiS_Pr->SiS_Panel1024x600) ) {   /* TW: @@@ TEST - not in BIOS! */	     	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; other 301B BIOS sets 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 				                              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_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_Panel1400x1050)  tempcx = 0x0002;     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_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) {	/* TW: Inserted from 650/LVDS 1.10.07 */            temp |= 0x80;         }      } else {	 if( (HwDeviceExtension->jChipType == SIS_630) ||	     (HwDeviceExtension->jChipType == SIS_730) ) {	    if(HwDeviceExtension->jChipRevision >= 0x30) {	       temp |= 0x80;	    }	 }      }  }         /* TW: in follwing line, 0x87 was 0x07 (modified according to 650/LVDS BIOS) */  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) {        /* 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 */  } else {        /* 310/325 series */	SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1E,0x23);	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 */  }  tempbx = push2;                                  /* p bx temppush1 BPLVDEE  */  tempcx = push1;  push1 = temp;					   /* TW: For 630/301B and 630/LVDS */  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 & LCDNonExpanding) {					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;  }  temp = ((tempbx & 0x0700) >> 8) << 3;  temp |= ((tempcx & 0x0700) >> 8);  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1D,temp);     	/* Part1_1Dh; TW: Vertical Display Overflow; Control Signal */  temp = tempbx & 0x00FF;  if(SiS_Pr->SiS_IF_DEF_FSTN) temp++;  SiS_SetReg1(SiS_Pr->SiS_Part1Port,0x1C,temp);      	/* Part1_1Ch; TW: Panel Link Vertical Display Enable End  */

⌨️ 快捷键说明

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