summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2004-08-20 18:57:06 +0000
committerKevin E Martin <kem@kem.org>2004-08-20 18:57:06 +0000
commit1b6d87873247f252c1e656ad3bba44d460c25497 (patch)
treeee05cd70b0a0310a21067be2345f21c6fd634c61
parentb94ee52295375ff43d5e12469e2aad86c678328b (diff)
-rw-r--r--src/310vtbl.h10
-rw-r--r--src/init.c4
-rw-r--r--src/init.h26
-rw-r--r--src/init301.c140
-rw-r--r--src/init301.h7
-rw-r--r--src/initdef.h10
-rw-r--r--src/sis.h4
-rw-r--r--src/sis_driver.c6
-rw-r--r--src/sis_vb.c3
-rw-r--r--src/vstruct.h4
10 files changed, 142 insertions, 72 deletions
diff --git a/src/310vtbl.h b/src/310vtbl.h
index 7068e1b..cc1e32b 100644
--- a/src/310vtbl.h
+++ b/src/310vtbl.h
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/310vtbl.h,v 1.10 2004/08/12 12:59:25 twini Exp $ */
/*
* Register settings for SiS 315/330 series
*
@@ -817,7 +817,8 @@ static SiS_VCLKDataStruct SiS310_VCLKData[]=
{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
{ 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced */
{ 0x7c,0x6b, 38}, /* 0x6a 960x540@60 */
- { 0xe3,0x56, 41} /* 0x6b 960x600@60 */
+ { 0xe3,0x56, 41}, /* 0x6b 960x600@60 */
+ { 0x45,0x25, 83} /* 0x6c 1280x800 */
};
static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
@@ -920,7 +921,7 @@ static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
{ 0x52,0x07,149}, /* 0x59 1280x960-85 */
{ 0x56,0x07,156}, /* 0x5a 1400x1050-75 */
{ 0x70,0x29, 81}, /* 0x5b 1280x768 LCD (TMDS) */
- { 0xce,0x1e, 73}, /* 0x5c 1280x800 LCD - (CRT1: 45 25 83) */
+ { 0xce,0x1e, 73}, /* 0x5c 1280x800_2 LCD (SiS LVDS) - (CRT1: 45 25 83) */
{ 0xbe,0x44,121}, /* 0x5d 1680x1050 LCD */
{ 0x70,0x24,162}, /* 0x5e 1600x1200 LCD */
{ 0x52,0x27, 75}, /* 0x5f 1280x720 (TMDS + HDTV) (correct) */
@@ -935,7 +936,8 @@ static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
{ 0x5f,0xc6, 33}, /* 0x68 720/768x576@60 */
{ 0x52,0x27, 75}, /* 0x69 1920x1080i 60Hz interlaced (UNUSED) */
{ 0x7c,0x6b, 38}, /* 0x6a 960x540@60 */
- { 0xe3,0x56, 41} /* 0x6b 960x600@60 */
+ { 0xe3,0x56, 41}, /* 0x6b 960x600@60 */
+ { 0x9c,0x62, 69} /* 0x6c 1280x800 (SiS TMDS) (special) */
};
static const DRAM4Type SiS310_SR15[8] = {
diff --git a/src/init.c b/src/init.c
index 2fdab67..671ad68 100644
--- a/src/init.c
+++ b/src/init.c
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/init.c,v 1.14 2004/08/12 12:59:25 twini Exp $ */
/*
* Mode initializing code (CRT1 section) for
* for SiS 300/305/540/630/730 and
@@ -135,8 +135,8 @@ InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
SiS_Pr->SiS_LCD1280x720Data = SiS_LCD1280x720Data;
SiS_Pr->SiS_StLCD1280x768_2Data = SiS_StLCD1280x768_2Data;
SiS_Pr->SiS_ExtLCD1280x768_2Data = SiS_ExtLCD1280x768_2Data;
- SiS_Pr->SiS_LCD1280x768_3Data = SiS_LCD1280x768_3Data;
SiS_Pr->SiS_LCD1280x800Data = SiS_LCD1280x800Data;
+ SiS_Pr->SiS_LCD1280x800_2Data = SiS_LCD1280x800_2Data;
SiS_Pr->SiS_LCD1280x960Data = SiS_LCD1280x960Data;
SiS_Pr->SiS_StLCD1400x1050Data = SiS_StLCD1400x1050Data;
SiS_Pr->SiS_ExtLCD1400x1050Data = SiS_ExtLCD1400x1050Data;
diff --git a/src/init.h b/src/init.h
index a7fabb9..5643065 100644
--- a/src/init.h
+++ b/src/init.h
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/init.h,v 1.11 2004/08/12 12:59:25 twini Exp $ */
/*
* Data and prototypes for init.c
*
@@ -996,6 +996,7 @@ static const SiS_LCDDataStruct SiS_ExtLCD1280x768_2Data[] = /* 2.03.00 */
{ 16, 15, 1600, 750, 1600, 806 } /* 1280x720 */
};
+#if 0
static const SiS_LCDDataStruct SiS_LCD1280x768_3Data[] =
{
{ 64, 25, 1056, 422, 1664, 798 }, /* 640x400 */
@@ -1010,8 +1011,24 @@ static const SiS_LCDDataStruct SiS_LCD1280x768_3Data[] =
{ 0, 0, 0, 0, 0, 0 },
{ 16, 15, 1600, 750, 1600, 806 } /* 1280x720 from above */
};
+#endif
+
+static const SiS_LCDDataStruct SiS_LCD1280x800Data[] = /* 0.93.12a (TMDS) */
+{
+ { 128, 51, 1122, 412, 1408, 816 }, /* 640x400 */
+ { 128, 49, 1232, 361, 1408, 816 },
+ { 128, 51, 1122, 412, 1408, 816 },
+ { 128, 49, 1232, 361, 1408, 816 },
+ { 8, 3, 880, 491, 1408, 816 }, /* 640x480 */
+ { 11, 6, 1024, 612, 1408, 816 }, /* 800x600 */
+ { 22, 21, 1400, 784, 1408, 816 }, /* 1024x768 */
+ { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
+ { 1, 1, 1408, 816, 1408, 816 }, /* 1280x800 */
+ { 0, 0, 0, 0, 0, 0 }, /* 1280x768 (patch index) */
+ { 0, 0, 0, 0, 0, 0 } /* 1280x720 */
+};
-static const SiS_LCDDataStruct SiS_LCD1280x800Data[] = /* 2.03.00 */
+static const SiS_LCDDataStruct SiS_LCD1280x800_2Data[] = /* 2.03.00 (LVDS) */
{
{ 97, 42, 1344, 409, 1552, 812 }, /* 640x400 */
{ 97, 35, 1280, 358, 1552, 812 },
@@ -1132,7 +1149,7 @@ static const SiS_LCDDataStruct SiS_NoScaleData[] =
{ 1, 1,1800,1000,1800,1000 }, /* 0x0a: 1280x960 */
{ 1, 1,1688,1066,1688,1066 }, /* 0x0b: 1400x1050 */
{ 1, 1,1650, 750,1650, 750 }, /* 0x0c: 1280x720 (TMDS, projector) */
- { 1, 1,1552, 812,1552, 812 }, /* 0x0d: 1280x800 (was: 1408,816/ 1656,841) */
+ { 1, 1,1552, 812,1552, 812 }, /* 0x0d: 1280x800_2 (LVDS) (was: 1408,816/ 1656,841) */
{ 1, 1,1900,1066,1900,1066 }, /* 0x0e: 1680x1050 (LVDS) */
{ 1, 1,1660, 806,1660, 806 }, /* 0x0f: 1280x768_2 (LVDS) */
{ 1, 1,1664, 798,1664, 798 }, /* 0x10: 1280x768_3 (LVDS) - temp */
@@ -1148,7 +1165,8 @@ static const SiS_LCDDataStruct SiS_NoScaleData[] =
{ 1, 1,1680, 892,1680, 892 }, /* 0x1a: 1152x864 */
{ 1, 1,1808, 808,1808, 808 }, /* 0x1b: 1360x768 */
{ 1, 1,1104, 563,1104, 563 }, /* 0x1c: 960x540 */
- { 1, 1,1120, 618,1120, 618 } /* 0x1d: 960x600 */
+ { 1, 1,1120, 618,1120, 618 }, /* 0x1d: 960x600 */
+ { 1, 1,1408, 816,1408, 816 } /* 0x1f: 1280x800 (TMDS special) */
};
/**************************************************************/
diff --git a/src/init301.c b/src/init301.c
index 80d1b5d..2e12fe7 100644
--- a/src/init301.c
+++ b/src/init301.c
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.c,v 1.12 2004/08/11 18:54:36 twini Exp $ */
/*
* Mode initializing code (CRT2 section)
* for SiS 300/305/540/630/730 and
@@ -137,16 +137,22 @@ GetLCDStructPtr661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
/* Use the BIOS tables only for LVDS panels; TMDS is unreliable
* due to the variaty of panels the BIOS doesn't know about.
+ * Exception: If the BIOS has better knowledge (such as in case
+ * of machines with a 301C and a panel that does not support DDC)
+ * use the BIOS data as well.
*/
- if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+ if((SiS_Pr->SiS_ROMNew) &&
+ ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) || (!SiS_Pr->PanelSelfDetected))) {
if(HwInfo->jChipType < SIS_661) reg = 0x3c;
else reg = 0x7d;
idx = (SiS_GetReg(SiS_Pr->SiS_P3d4,reg) & 0x1f) * 26;
- myptr = (UCHAR *)&SiS_LCDStruct661[idx];
+ if(idx < (8*26)) {
+ myptr = (UCHAR *)&SiS_LCDStruct661[idx];
+ }
romindex = SISGETROMW(0x100);
if(romindex) {
romindex += idx;
@@ -164,9 +170,13 @@ GetLCDStructPtr661_2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
/* Use the BIOS tables only for LVDS panels; TMDS is unreliable
* due to the variaty of panels the BIOS doesn't know about.
+ * Exception: If the BIOS has better knowledge (such as in case
+ * of machines with a 301C and a panel that does not support DDC)
+ * use the BIOS data as well.
*/
- if((SiS_Pr->SiS_ROMNew) && (SiS_Pr->SiS_VBType & VB_SIS301LV302LV)) {
+ if((SiS_Pr->SiS_ROMNew) &&
+ ((SiS_Pr->SiS_VBType & VB_SIS301LV302LV) || (!SiS_Pr->PanelSelfDetected))) {
romptr = SISGETROMW(0x102);
romptr += ((SiS_GetReg(SiS_Pr->SiS_P3d4,0x36) >> 4) * SiS_Pr->SiS661LCD2TableSize);
}
@@ -1449,7 +1459,7 @@ SiS_GetBIOSLCDResInfo(SiS_Private *SiS_Pr)
USHORT temp = SiS_Pr->SiS_LCDResInfo;
/* Translate my LCDResInfo to BIOS value */
if(temp == Panel_1280x768_2) temp = Panel_1280x768;
- if(temp == Panel_1280x768_3) temp = Panel_1280x768;
+ if(temp == Panel_1280x800_2) temp = Panel_1280x800;
return temp;
}
@@ -1531,6 +1541,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
UCHAR *myptr = NULL;
#endif
USHORT temp,modeflag,resinfo=0,modexres=0,modeyres=0;
+ BOOLEAN panelcanscale = FALSE;
const unsigned char SiS300SeriesLCDRes[] =
{ 0, 1, 2, 3, 7, 4, 5, 8,
0, 0, 10, 0, 0, 0, 0, 15 };
@@ -1575,19 +1586,20 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
temp = SiS300SeriesLCDRes[temp];
}
+ /* Translate to our internal types */
if(HwInfo->jChipType == SIS_550) {
if(temp == Panel310_640x480_2) temp = Panel_640x480_2;
if(temp == Panel310_640x480_3) temp = Panel_640x480_3;
}
- if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { /* SiS LVDS */
+ if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* SiS LVDS */
if(temp == Panel310_1280x768) {
temp = Panel_1280x768_2;
-#ifdef SIS315H
- if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) {
- if((myptr[8] | (myptr[9] << 8)) == 798) temp = Panel_1280x768_3;
+ }
+ if(SiS_Pr->SiS_ROMNew) {
+ if(temp == Panel661_1280x800) {
+ temp = Panel_1280x800_2;
}
-#endif
}
}
@@ -1614,6 +1626,8 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
/* Need temp below! */
if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
+
+ panelcanscale = (SiS_Pr->SiS_LCDInfo & DontExpandLCD) ? TRUE : FALSE;
if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD;
else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
@@ -1668,8 +1682,8 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
/* Always center screen on SiS LVDS (if scaling is disabled) */
SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
} else {
- /* By default, pass 1:1 on SiS TMDS (if scaling is disabled) */
- SiS_Pr->SiS_LCDInfo |= LCDPass11;
+ /* By default, pass 1:1 on SiS TMDS (if scaling is supported) */
+ if(panelcanscale) SiS_Pr->SiS_LCDInfo |= LCDPass11;
if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
}
}
@@ -1761,18 +1775,18 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2;
SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
break;
- case Panel_1280x768_3: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768;
- SiS_Pr->PanelHT = 1664; SiS_Pr->PanelVT = 798;
- SiS_Pr->PanelHRS = 64; SiS_Pr->PanelHRE = 128;
- SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 7;
- SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_3;
- SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
- break;
case Panel_1280x800: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800;
+ SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 816;
+ SiS_Pr->PanelHRS = 21; SiS_Pr->PanelHRE = 24;
+ SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3;
+ SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315;
+ SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
+ break;
+ case Panel_1280x800_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800;
SiS_Pr->PanelHT = 1552; SiS_Pr->PanelVT = 812;
SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112;
SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3;
- SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315;
+ SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315_2;
SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
break;
case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960;
@@ -1916,8 +1930,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
}
break;
}
- case Panel_1280x768_2: /* LVDS only */
- case Panel_1280x768_3: {
+ case Panel_1280x768_2: { /* LVDS only */
static const UCHAR nonscalingmodes[] = {
SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480,
SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768,
@@ -1932,7 +1945,16 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
}
break;
}
- case Panel_1280x800: {
+ case Panel_1280x800: { /* SiS TMDS special (Averatec 6200 series) */
+ static const UCHAR nonscalingmodes[] = {
+ SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480,
+ SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768,
+ SIS_RI_1280x720, SIS_RI_1280x768, 0xff
+ };
+ SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
+ break;
+ }
+ case Panel_1280x800_2: { /* SiS LVDS */
static const UCHAR nonscalingmodes[] = {
SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480,
SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768,
@@ -2044,6 +2066,10 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
case Panel_640x480:
SiS_Pr->SiS_LCDInfo |= LCDPass11;
break;
+ case Panel_1280x800:
+ /* Don't pass 1:1 by default (TMDS special) */
+ if(SiS_Pr->CenterScreen == -1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
+ break;
case Panel_1280x960:
SiS_Pr->SiS_LCDInfo &= ~LCDPass11;
break;
@@ -2936,11 +2962,15 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) {
if (resinfo == SIS_RI_1280x800) tempal = 9;
else if(resinfo == SIS_RI_1400x1050) tempal = 11;
- } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x800) {
+ } else if((SiS_Pr->SiS_LCDResInfo == Panel_1280x800) ||
+ (SiS_Pr->SiS_LCDResInfo == Panel_1280x800_2)) {
if (resinfo == SIS_RI_1280x768) tempal = 9;
}
- if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { /* Pass 1:1 only (center-screen handled outside) */
+ if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) {
+ /* Pass 1:1 only (center-screen handled outside) */
+ /* This is never called for the panel's native resolution */
+ /* since Pass1:1 will not be set in this case */
tempbx = 100;
if(ModeNo >= 0x13) {
tempal = SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].Ext_CRT2CRTC_NS;
@@ -3446,12 +3476,12 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
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;
+ 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 {
@@ -3459,10 +3489,10 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
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;
+ 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) ) {
@@ -3475,6 +3505,15 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
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
}
@@ -3491,10 +3530,10 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
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_1280x768_3 :
- case Panel_1280x768_3+ 32: LCDPtr = SiS_Pr->SiS_LCD1280x768_3Data; 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;
@@ -9668,6 +9707,7 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
SiS_Pr->CP_PreferredX = SiS_Pr->CP_PreferredY = 0;
SiS_Pr->CP_PreferredIndex = -1;
SiS_Pr->CP_PrefClock = 0;
+ SiS_Pr->PanelSelfDetected = FALSE;
if(!(pSiS->VBFlags & (VB_301|VB_301B|VB_301C|VB_302B))) return 0;
if(pSiS->VBFlags & VB_30xBDH) return 0;
@@ -9757,6 +9797,10 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
panelproduct = buffer[10] | (buffer[11] << 8);
if(buffer[0x18] & 0x02) {
+
+ USHORT pclk = (buffer[0x36] | (buffer[0x37] << 8));
+ USHORT phb = (buffer[0x39] | ((buffer[0x3a] & 0x0f) << 8));
+ USHORT pvb = (buffer[0x3c] | ((buffer[0x3d] & 0x0f) << 8));
SiS_Pr->CP_PreferredX = xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4);
SiS_Pr->CP_PreferredY = yres = buffer[0x3b] | ((buffer[0x3d] & 0xf0) << 4);
@@ -9787,14 +9831,20 @@ SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS)
paneltype = Panel310_1280x960;
}
} else if(yres == 768) {
- if( ((buffer[0x36] | (buffer[0x37] << 8)) == 8100) &&
- ((buffer[0x39] | ((buffer[0x3a] & 0x0f) << 8)) == (1688 - 1280)) &&
- ((buffer[0x3c] | ((buffer[0x3d] & 0x0f) << 8)) == (802 - 768)) ) {
+ if( (pclk == 8100) &&
+ (phb == (1688 - 1280)) &&
+ (pvb == (802 - 768)) ) {
paneltype = Panel_1280x768;
checkexpand = FALSE;
cr37 |= 0x10;
}
- }
+ } else if(yres == 800) {
+ if( (pclk == 6900) &&
+ (phb == (1408 - 1280)) &&
+ (pvb == (816 - 800)) ) {
+ paneltype = Panel_1280x800;
+ }
+ }
break;
case 1400:
if(pSiS->VGAEngine == SIS_315_VGA) {
@@ -11325,7 +11375,7 @@ SetDelayComp661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo,
lcdpdcindex = (SiS_Pr->SiS_VBType & VB_UMC) ? 14 : 12;
- /* For LV, the BIOS must know about the correct value */
+ /* For LVDS (and sometimes TMDS), the BIOS must know about the correct value */
delay = ROMAddr[romptr + lcdpdcindex + 1]; /* LCD */
delay |= (ROMAddr[romptr + lcdpdcindex] << 8); /* LCDA */
@@ -11338,9 +11388,9 @@ SetDelayComp661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo,
case Panel_1024x768: delay = 0x0008; break;
case Panel_1280x720: delay = 0x0004; break;
case Panel_1280x768:
- case Panel_1280x768_2:
- case Panel_1280x768_3:delay = 0x0004; break;
- case Panel_1280x800: delay = 0x0004; break;
+ case Panel_1280x768_2:delay = 0x0004; break;
+ case Panel_1280x800:
+ case Panel_1280x800_2:delay = 0x0004; break; /* Verified for 1280x800 */
case Panel_1280x1024: delay = 0x1e04; break;
case Panel_1400x1050: delay = 0x0004; break;
case Panel_1600x1200: delay = 0x0400; break;
diff --git a/src/init301.h b/src/init301.h
index 1bba215..12511b1 100644
--- a/src/init301.h
+++ b/src/init301.h
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/init301.h,v 1.8 2004/08/10 21:57:20 twini Exp $ */
/*
* Data and prototypes for init301.c
*
@@ -247,15 +247,12 @@ static const UCHAR SiS_LCDStruct661[] = {
/* 1280x720 */
0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x20,
0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05,
- /* 1280x800 */
+ /* 1280x800 (_2) */
0x0C,0xE0,0x00,0x05,0x20,0x03,0x10,0x06,0x2C,0x03,0x30,0x00,0x70,
0x00,0x04,0x00,0x03,0x00,0x49,0xCE,0x1E,0x00,0x00,0x00,0x00,0x09,
/* 1680x1050 */
0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C,
0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06,
- /* 1280x768 (_3) (not in 0.93 and later) */
- 0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x06,0x1E,0x03,0x40,0x00,0x80,
- 0x00,0x03,0x00,0x07,0x00,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x06
};
#endif
diff --git a/src/initdef.h b/src/initdef.h
index 047d4db..b3127c4 100644
--- a/src/initdef.h
+++ b/src/initdef.h
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/initdef.h,v 1.8 2004/08/12 12:59:25 twini Exp $ */
/*
* Global definitions for init.c and init301.c
*
@@ -406,10 +406,10 @@
#define Panel_1400x1050 0x09
#define Panel_1280x768 0x0a /* 30xB/C and LVDS only (BIOS: all) */
#define Panel_1600x1200 0x0b
-#define Panel_1280x800 0x0c /* 661etc */
+#define Panel_1280x800 0x0c /* 661etc (TMDS) */
#define Panel_1680x1050 0x0d /* 661etc */
#define Panel_1280x720 0x0e /* 661etc */
-#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection */
+#define Panel_Custom 0x0f /* MUST BE 0x0f (for DVI DDC detection) */
#define Panel_320x480 0x10 /* SiS 550 fstn - TW: This is fake, can be any */
#define Panel_Barco1366 0x11
#define Panel_848x480 0x12
@@ -417,6 +417,7 @@
#define Panel_640x480_3 0x14 /* SiS 550 */
#define Panel_1280x768_2 0x15 /* 30xLV */
#define Panel_1280x768_3 0x16 /* 30xLV */
+#define Panel_1280x800_2 0x17 /* 30xLV */
/* Index in ModeResInfo table */
#define SIS_RI_320x200 0
@@ -489,7 +490,7 @@
#define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */
#define VCLK34_315 0x55
#define VCLK68_315 0x0d
-#define VCLK_1280x800_315 0x5c /* Index in VBVCLKData table (315) */
+#define VCLK_1280x800_315_2 0x5c /* Index in VBVCLKData table (315) */
#define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */
#define VCLK_1280x720 0x5f
#define VCLK_1280x768_2 0x60
@@ -505,6 +506,7 @@
#define VCLK_1024x576 0x51
#define VCLK_1152x864 0x64
#define VCLK_1360x768 0x58
+#define VCLK_1280x800_315 0x6c
#define TVCLKBASE_300 0x21 /* Indices on TV clocks in VCLKData table (300) */
#define TVCLKBASE_315 0x3a /* Indices on TV clocks in (VB)VCLKData table (315) */
diff --git a/src/sis.h b/src/sis.h
index 6dfa98c..d102181 100644
--- a/src/sis.h
+++ b/src/sis.h
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v 1.17 2004/08/14 15:26:50 twini Exp $ */
/*
* Main global data and definitions
*
@@ -40,7 +40,7 @@
#define SISDRIVERVERSIONYEAR 4
#define SISDRIVERVERSIONMONTH 8
-#define SISDRIVERVERSIONDAY 14
+#define SISDRIVERVERSIONDAY 20
#define SISDRIVERREVISION 1
#define SISDRIVERIVERSION (SISDRIVERVERSIONYEAR << 16) | \
diff --git a/src/sis_driver.c b/src/sis_driver.c
index 4601e54..9147584 100644
--- a/src/sis_driver.c
+++ b/src/sis_driver.c
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_driver.c,v 1.19 2004/08/14 15:26:51 twini Exp $ */
/*
* SiS driver main code
*
@@ -5129,7 +5129,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
if(SiSAllowSyncOverride(pSiS)) {
/* Set sane ranges for LCD and TV */
pScrn->monitor->nVrefresh = 1;
- pScrn->monitor->vrefresh[0].lo = 59;
+ pScrn->monitor->vrefresh[0].lo = 56; /* 56 for 720/768x576 */
pScrn->monitor->vrefresh[0].hi = 71; /* 71 for 640x400 */
xf86DrvMsg(pScrn->scrnIndex, X_INFO, sanev,
#ifdef SISDUALHEAD
@@ -5171,7 +5171,7 @@ SISPreInit(ScrnInfoPtr pScrn, int flags)
if(pSiS->VBFlags & (CRT2_TV | CRT2_LCD)) {
/* Set sane ranges for LCD and TV */
pSiS->CRT2pScrn->monitor->nVrefresh = 1;
- pSiS->CRT2pScrn->monitor->vrefresh[0].lo = 59;
+ pSiS->CRT2pScrn->monitor->vrefresh[0].lo = 56; /* 56 for 768/720x576 */
pSiS->CRT2pScrn->monitor->vrefresh[0].hi = 71; /* 71 for 640x400 */
xf86DrvMsg(pScrn->scrnIndex, X_INFO, sanev, 2);
}
diff --git a/src/sis_vb.c b/src/sis_vb.c
index 5bf1c35..4a954fc 100644
--- a/src/sis_vb.c
+++ b/src/sis_vb.c
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/sis_vb.c,v 1.12 2004/08/11 00:45:43 twini Exp $ */
/*
* Video bridge detection and configuration for 300, 315 and 330 series
*
@@ -313,6 +313,7 @@ void SISLCDPreInit(ScrnInfoPtr pScrn, Bool quiet)
if(pSiS->forcecrt2redetection) {
pSiS->VBFlags &= ~CRT2_LCD;
+ /* Do NOT clear CR32[D3] here! */
}
if(!(pSiS->nocrt2ddcdetection)) {
diff --git a/src/vstruct.h b/src/vstruct.h
index 08b20ce..85be9a0 100644
--- a/src/vstruct.h
+++ b/src/vstruct.h
@@ -1,5 +1,5 @@
/* $XFree86$ */
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/drivers/sis/vstruct.h,v 1.6 2004/08/10 21:57:20 twini Exp $ */
/*
* General structure definitions for universal mode switching modules
*
@@ -421,8 +421,8 @@ typedef struct _SiS_Private
const SiS_LCDDataStruct *SiS_LCD1280x720Data;
const SiS_LCDDataStruct *SiS_StLCD1280x768_2Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x768_2Data;
- const SiS_LCDDataStruct *SiS_LCD1280x768_3Data;
const SiS_LCDDataStruct *SiS_LCD1280x800Data;
+ const SiS_LCDDataStruct *SiS_LCD1280x800_2Data;
const SiS_LCDDataStruct *SiS_LCD1280x960Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x1024Data;
const SiS_LCDDataStruct *SiS_St2LCD1280x1024Data;