📄 init.c
字号:
SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_650; /* 550, 650, 740 */ } else { SiS_Pr->SiS_MCLKData_0 = SiS310_MCLKData_0_315; /* 315 */ } if(HwInfo->jChipType >= SIS_340) { SiS_Pr->SiS_MCLKData_1 = SiS310_MCLKData_1_340; } else { SiS_Pr->SiS_MCLKData_1 = SiS310_MCLKData_1; } SiS_Pr->SiS_VCLKData = SiS310_VCLKData; SiS_Pr->SiS_VBVCLKData = SiS310_VBVCLKData; SiS_Pr->SiS_SR15 = SiS310_SR15;#ifdef LINUX_KERNEL SiS_Pr->pSiS_SR07 = &SiS310_SR07; SiS_Pr->SiS_CR40 = SiS310_CR40; SiS_Pr->SiS_CR49 = SiS310_CR49; SiS_Pr->pSiS_SR1F = &SiS310_SR1F; SiS_Pr->pSiS_SR21 = &SiS310_SR21; SiS_Pr->pSiS_SR22 = &SiS310_SR22; SiS_Pr->pSiS_SR23 = &SiS310_SR23; SiS_Pr->pSiS_SR24 = &SiS310_SR24; SiS_Pr->SiS_SR25 = SiS310_SR25; SiS_Pr->pSiS_SR31 = &SiS310_SR31; SiS_Pr->pSiS_SR32 = &SiS310_SR32; SiS_Pr->pSiS_SR33 = &SiS310_SR33; SiS_Pr->pSiS_CRT2Data_1_2 = &SiS310_CRT2Data_1_2; SiS_Pr->pSiS_CRT2Data_4_D = &SiS310_CRT2Data_4_D; SiS_Pr->pSiS_CRT2Data_4_E = &SiS310_CRT2Data_4_E; SiS_Pr->pSiS_CRT2Data_4_10 = &SiS310_CRT2Data_4_10; SiS_Pr->pSiS_RGBSenseData = &SiS310_RGBSenseData; SiS_Pr->pSiS_VideoSenseData = &SiS310_VideoSenseData; SiS_Pr->pSiS_YCSenseData = &SiS310_YCSenseData; SiS_Pr->pSiS_RGBSenseData2 = &SiS310_RGBSenseData2; SiS_Pr->pSiS_VideoSenseData2 = &SiS310_VideoSenseData2; SiS_Pr->pSiS_YCSenseData2 = &SiS310_YCSenseData2;#endif SiS_Pr->SiS_PanelDelayTbl = SiS310_PanelDelayTbl; SiS_Pr->SiS_PanelDelayTblLVDS = SiS310_PanelDelayTblLVDS; SiS_Pr->SiS_St2LCD1024x768Data = SiS310_St2LCD1024x768Data; SiS_Pr->SiS_ExtLCD1024x768Data = SiS310_ExtLCD1024x768Data; SiS_Pr->SiS_St2LCD1280x1024Data = SiS310_St2LCD1280x1024Data; SiS_Pr->SiS_ExtLCD1280x1024Data = SiS310_ExtLCD1280x1024Data; SiS_Pr->SiS_CRT2Part2_1024x768_1 = SiS310_CRT2Part2_1024x768_1; SiS_Pr->SiS_PanelType00_1 = SiS310_PanelType00_1; SiS_Pr->SiS_PanelType01_1 = SiS310_PanelType01_1; SiS_Pr->SiS_PanelType02_1 = SiS310_PanelType02_1; SiS_Pr->SiS_PanelType03_1 = SiS310_PanelType03_1; SiS_Pr->SiS_PanelType04_1 = SiS310_PanelType04_1; SiS_Pr->SiS_PanelType05_1 = SiS310_PanelType05_1; SiS_Pr->SiS_PanelType06_1 = SiS310_PanelType06_1; SiS_Pr->SiS_PanelType07_1 = SiS310_PanelType07_1; SiS_Pr->SiS_PanelType08_1 = SiS310_PanelType08_1; SiS_Pr->SiS_PanelType09_1 = SiS310_PanelType09_1; SiS_Pr->SiS_PanelType0a_1 = SiS310_PanelType0a_1; SiS_Pr->SiS_PanelType0b_1 = SiS310_PanelType0b_1; SiS_Pr->SiS_PanelType0c_1 = SiS310_PanelType0c_1; SiS_Pr->SiS_PanelType0d_1 = SiS310_PanelType0d_1; SiS_Pr->SiS_PanelType0e_1 = SiS310_PanelType0e_1; SiS_Pr->SiS_PanelType0f_1 = SiS310_PanelType0f_1; SiS_Pr->SiS_PanelType00_2 = SiS310_PanelType00_2; SiS_Pr->SiS_PanelType01_2 = SiS310_PanelType01_2; SiS_Pr->SiS_PanelType02_2 = SiS310_PanelType02_2; SiS_Pr->SiS_PanelType03_2 = SiS310_PanelType03_2; SiS_Pr->SiS_PanelType04_2 = SiS310_PanelType04_2; SiS_Pr->SiS_PanelType05_2 = SiS310_PanelType05_2; SiS_Pr->SiS_PanelType06_2 = SiS310_PanelType06_2; SiS_Pr->SiS_PanelType07_2 = SiS310_PanelType07_2; SiS_Pr->SiS_PanelType08_2 = SiS310_PanelType08_2; SiS_Pr->SiS_PanelType09_2 = SiS310_PanelType09_2; SiS_Pr->SiS_PanelType0a_2 = SiS310_PanelType0a_2; SiS_Pr->SiS_PanelType0b_2 = SiS310_PanelType0b_2; SiS_Pr->SiS_PanelType0c_2 = SiS310_PanelType0c_2; SiS_Pr->SiS_PanelType0d_2 = SiS310_PanelType0d_2; SiS_Pr->SiS_PanelType0e_2 = SiS310_PanelType0e_2; SiS_Pr->SiS_PanelType0f_2 = SiS310_PanelType0f_2; SiS_Pr->SiS_PanelTypeNS_1 = SiS310_PanelTypeNS_1; SiS_Pr->SiS_PanelTypeNS_2 = SiS310_PanelTypeNS_2; SiS_Pr->SiS_CHTVUPALData = SiS310_CHTVUPALData; SiS_Pr->SiS_CHTVOPALData = SiS310_CHTVOPALData; SiS_Pr->SiS_CHTVUPALMData = SiS310_CHTVUPALMData; SiS_Pr->SiS_CHTVOPALMData = SiS310_CHTVOPALMData; SiS_Pr->SiS_CHTVUPALNData = SiS310_CHTVUPALNData; SiS_Pr->SiS_CHTVOPALNData = SiS310_CHTVOPALNData; SiS_Pr->SiS_CHTVSOPALData = SiS310_CHTVSOPALData; SiS_Pr->SiS_LVDSCRT1800x600_1 = SiS310_LVDSCRT1800x600_1; SiS_Pr->SiS_LVDSCRT11024x768_1 = SiS310_LVDSCRT11024x768_1; SiS_Pr->SiS_LVDSCRT11280x1024_1 = SiS310_LVDSCRT11280x1024_1; SiS_Pr->SiS_LVDSCRT11400x1050_1 = SiS310_LVDSCRT11400x1050_1; SiS_Pr->SiS_LVDSCRT11600x1200_1 = SiS310_LVDSCRT11600x1200_1; SiS_Pr->SiS_LVDSCRT1800x600_1_H = SiS310_LVDSCRT1800x600_1_H; SiS_Pr->SiS_LVDSCRT11024x768_1_H = SiS310_LVDSCRT11024x768_1_H; SiS_Pr->SiS_LVDSCRT11280x1024_1_H = SiS310_LVDSCRT11280x1024_1_H; SiS_Pr->SiS_LVDSCRT11400x1050_1_H = SiS310_LVDSCRT11400x1050_1_H; SiS_Pr->SiS_LVDSCRT11600x1200_1_H = SiS310_LVDSCRT11600x1200_1_H; SiS_Pr->SiS_LVDSCRT1800x600_2 = SiS310_LVDSCRT1800x600_2; SiS_Pr->SiS_LVDSCRT11024x768_2 = SiS310_LVDSCRT11024x768_2; SiS_Pr->SiS_LVDSCRT11280x1024_2 = SiS310_LVDSCRT11280x1024_2; SiS_Pr->SiS_LVDSCRT11400x1050_2 = SiS310_LVDSCRT11400x1050_2; SiS_Pr->SiS_LVDSCRT11600x1200_2 = SiS310_LVDSCRT11600x1200_2; SiS_Pr->SiS_LVDSCRT1800x600_2_H = SiS310_LVDSCRT1800x600_2_H; SiS_Pr->SiS_LVDSCRT11024x768_2_H = SiS310_LVDSCRT11024x768_2_H; SiS_Pr->SiS_LVDSCRT11280x1024_2_H = SiS310_LVDSCRT11280x1024_2_H; SiS_Pr->SiS_LVDSCRT11400x1050_2_H = SiS310_LVDSCRT11400x1050_2_H; SiS_Pr->SiS_LVDSCRT11600x1200_2_H = SiS310_LVDSCRT11600x1200_2_H; SiS_Pr->SiS_LVDSCRT1XXXxXXX_1 = SiS310_LVDSCRT1XXXxXXX_1; SiS_Pr->SiS_LVDSCRT1XXXxXXX_1_H = SiS310_LVDSCRT1XXXxXXX_1_H; SiS_Pr->SiS_CHTVCRT1UNTSC = SiS310_CHTVCRT1UNTSC; SiS_Pr->SiS_CHTVCRT1ONTSC = SiS310_CHTVCRT1ONTSC; SiS_Pr->SiS_CHTVCRT1UPAL = SiS310_CHTVCRT1UPAL; SiS_Pr->SiS_CHTVCRT1OPAL = SiS310_CHTVCRT1OPAL; SiS_Pr->SiS_CHTVCRT1SOPAL = SiS310_CHTVCRT1OPAL; SiS_Pr->SiS_CHTVReg_UNTSC = SiS310_CHTVReg_UNTSC; SiS_Pr->SiS_CHTVReg_ONTSC = SiS310_CHTVReg_ONTSC; SiS_Pr->SiS_CHTVReg_UPAL = SiS310_CHTVReg_UPAL; SiS_Pr->SiS_CHTVReg_OPAL = SiS310_CHTVReg_OPAL; SiS_Pr->SiS_CHTVReg_UPALM = SiS310_CHTVReg_UPALM; SiS_Pr->SiS_CHTVReg_OPALM = SiS310_CHTVReg_OPALM; SiS_Pr->SiS_CHTVReg_UPALN = SiS310_CHTVReg_UPALN; SiS_Pr->SiS_CHTVReg_OPALN = SiS310_CHTVReg_OPALN; SiS_Pr->SiS_CHTVReg_SOPAL = SiS310_CHTVReg_OPAL; SiS_Pr->SiS_CHTVVCLKUNTSC = SiS310_CHTVVCLKUNTSC; SiS_Pr->SiS_CHTVVCLKONTSC = SiS310_CHTVVCLKONTSC; SiS_Pr->SiS_CHTVVCLKUPAL = SiS310_CHTVVCLKUPAL; SiS_Pr->SiS_CHTVVCLKOPAL = SiS310_CHTVVCLKOPAL; SiS_Pr->SiS_CHTVVCLKUPALM = SiS310_CHTVVCLKUPALM; SiS_Pr->SiS_CHTVVCLKOPALM = SiS310_CHTVVCLKOPALM; SiS_Pr->SiS_CHTVVCLKUPALN = SiS310_CHTVVCLKUPALN; SiS_Pr->SiS_CHTVVCLKOPALN = SiS310_CHTVVCLKOPALN; SiS_Pr->SiS_CHTVVCLKSOPAL = SiS310_CHTVVCLKOPAL;}#endifstatic voidSiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo){ switch(HwInfo->jChipType) {#ifdef SIS315H case SIS_315H: case SIS_315: case SIS_315PRO: case SIS_550: case SIS_650: case SIS_740: case SIS_330: case SIS_661: case SIS_741: case SIS_660: case SIS_760: case SIS_761: case SIS_340: InitTo310Pointer(SiS_Pr, HwInfo); break;#endif#ifdef SIS300 case SIS_300: case SIS_540: case SIS_630: case SIS_730: InitTo300Pointer(SiS_Pr, HwInfo); break;#endif default: break; }}/*********************************************//* HELPER: Get ModeID *//*********************************************/#ifdef LINUX_XF86USHORTSiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN, int LCDwidth, int LCDheight){ USHORT ModeIndex = 0; switch(HDisplay) { case 320: if(VDisplay == 200) ModeIndex = ModeIndex_320x200[Depth]; else if(VDisplay == 240) { if(FSTN) ModeIndex = ModeIndex_320x240_FSTN[Depth]; else ModeIndex = ModeIndex_320x240[Depth]; } break; case 400: if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) { if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; } break; case 512: if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDwidth >= 768))) { if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; } break; case 640: if(VDisplay == 480) ModeIndex = ModeIndex_640x480[Depth]; else if(VDisplay == 400) ModeIndex = ModeIndex_640x400[Depth]; break; case 720: if(VDisplay == 480) ModeIndex = ModeIndex_720x480[Depth]; else if(VDisplay == 576) ModeIndex = ModeIndex_720x576[Depth]; break; case 768: if(VDisplay == 576) ModeIndex = ModeIndex_768x576[Depth]; break; case 800: if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth]; else if(VDisplay == 480) ModeIndex = ModeIndex_800x480[Depth]; break; case 848: if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth]; break; case 856: if(VDisplay == 480) ModeIndex = ModeIndex_856x480[Depth]; break; case 960: if(VGAEngine == SIS_315_VGA) { if(VDisplay == 540) ModeIndex = ModeIndex_960x540[Depth]; else if(VDisplay == 600) ModeIndex = ModeIndex_960x600[Depth]; } break; case 1024: if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth]; else if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth]; else if(VGAEngine == SIS_300_VGA) { if(VDisplay == 600) ModeIndex = ModeIndex_1024x600[Depth]; } break; case 1152: if(VDisplay == 864) ModeIndex = ModeIndex_1152x864[Depth]; if(VGAEngine == SIS_300_VGA) { if(VDisplay == 768) ModeIndex = ModeIndex_1152x768[Depth]; } break; case 1280: switch(VDisplay) { case 720: ModeIndex = ModeIndex_1280x720[Depth]; break; case 768: if(VGAEngine == SIS_300_VGA) { ModeIndex = ModeIndex_300_1280x768[Depth]; } else { ModeIndex = ModeIndex_310_1280x768[Depth]; } break; case 800: if(VGAEngine == SIS_315_VGA) { ModeIndex = ModeIndex_1280x800[Depth]; } break; case 960: ModeIndex = ModeIndex_1280x960[Depth]; break; case 1024: ModeIndex = ModeIndex_1280x1024[Depth]; break; } break; case 1360: if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth]; if(VGAEngine == SIS_300_VGA) { if(VDisplay == 1024) ModeIndex = ModeIndex_300_1360x1024[Depth]; } break; case 1400: if(VGAEngine == SIS_315_VGA) { if(VDisplay == 1050) { ModeIndex = ModeIndex_1400x1050[Depth]; } } break; case 1600: if(VDisplay == 1200) ModeIndex = ModeIndex_1600x1200[Depth]; break; case 1680: if(VGAEngine == SIS_315_VGA) { if(VDisplay == 1050) ModeIndex = ModeIndex_1680x1050[Depth]; } break; case 1920: if(VDisplay == 1440) ModeIndex = ModeIndex_1920x1440[Depth]; else if(VGAEngine == SIS_315_VGA) { if(VDisplay == 1080) ModeIndex = ModeIndex_1920x1080[Depth]; } break; case 2048: if(VDisplay == 1536) { if(VGAEngine == SIS_300_VGA) { ModeIndex = ModeIndex_300_2048x1536[Depth]; } else { ModeIndex = ModeIndex_310_2048x1536[Depth]; } } break; } return(ModeIndex);}#endifUSHORTSiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int Depth, BOOLEAN FSTN, USHORT CustomT, int LCDwidth, int LCDheight){ USHORT ModeIndex = 0; if(VBFlags & (VB_LVDS | VB_30xBDH)) { switch(HDisplay) { case 320: if(CustomT != CUT_PANEL848) { if(VDisplay == 200) ModeIndex = ModeIndex_320x200[Depth]; else if(VDisplay == 240) { if(!FSTN) ModeIndex = ModeIndex_320x240[Depth]; else if(VGAEngine == SIS_315_VGA) { ModeIndex = ModeIndex_320x240_FSTN[Depth]; } } } break; case 400: if(CustomT != CUT_PANEL848) { if(!((VGAEngine == SIS_300_VGA) && (VBFlags & VB_TRUMPION))) { if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; } } break; case 512: if(CustomT != CUT_PANEL848) { if(!((VGAEngine == SIS_300_VGA) && (VBFlags & VB_TRUMPION))) { if(LCDwidth >= 1024 && LCDwidth != 1152 && LCDheight >= 768) { if(VDisplay == 384) { ModeIndex = ModeIndex_512x384[Depth]; } } } } break; case 640: if(VDisplay == 480) ModeIndex = ModeIndex_640x480[Depth]; else if(VDisplay == 400) { if(CustomT != CUT_PANEL848) ModeIndex = ModeIndex_640x400[Depth]; } break; case 800: if(VDisplay == 600) ModeIndex = ModeIndex_800x600[Depth]; break; case 848: if(CustomT == CUT_PANEL848) { if(VDisplay == 480) ModeIndex = ModeIndex_848x480[Depth]; } break; case 1024: if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth]; else if(VGAEngine == SIS_300_VGA) { if((VDisplay == 600) && (LCDheight == 600)) { ModeIndex = ModeIndex_1024x600[Depth]; } } break; case 1152: if(VGAEngine == SIS_300_VGA) { if((VDisplay == 768) && (LCDheight == 768)) { ModeIndex = ModeIndex_1152x768[Depth]; } } break; case 1280: if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth]; else if(VGAEngine == SIS_315_VGA) { if((VDisplay == 768) && (LCDheight == 768)) { ModeIndex = ModeIndex_310_1280x768[Depth]; } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -