Commit 100eac71 authored by Thomas Winischhofer's avatar Thomas Winischhofer

SiS driver: Add support for 1280x854 panels Fix Xv for 300 series to

    support a width of 768 (prev. 720)
parent 89d489c6
......@@ -26,12 +26,12 @@ sis \- SiS video driver
.SH DESCRIPTION
.B sis
is an __myservername__ driver for SiS (Silicon Integrated Systems) video chips. The
driver is accelerated, and provides support for colordepths of 8, 16 and 24 bpp.
driver is accelerated and provides support for colordepths of 8, 16 and 24 bpp.
XVideo, Render and other extensions are supported as well.
.SH SUPPORTED HARDWARE
The
.B sis
driver supports PCI and AGP video cards based on the following chipsets:
driver supports PCI, AGP and PCIe video cards based on the following chipsets:
.PP
.B SiS5597/5598
.B SiS530/620
......@@ -41,9 +41,9 @@ driver supports PCI and AGP video cards based on the following chipsets:
.B SiS630/730
.B SiS315/E/H/PRO
.B SiS550/551/552
.B SiS650/651/M650/661FX/M661FX/M661MX/740/741/741GX/M741
.B SiS650/651/661/741
.B SiS330 (Xabre)
.B SiS760/760GX/M760
.B SiS760/761
.PP
In the following text, the following terms are used:
.PP
......@@ -54,7 +54,7 @@ for SiS5597/5598, 530/620 and 6326/AGP/DVD
for SiS300/305, 540 and 630/730
.PP
.B 315/330 series
for SiS315, 55x and (M)65x/(M)661xX/74x(GX), 330, (M)760(GX)
for SiS315, 55x and 661/741/760/761 (plus M, FX, MX, GX variants thereof)
.PP
.SH CONFIGURATION DETAILS
Please refer to __myxconfigfile__(__filemansuffix__) for general configuration
......@@ -69,7 +69,7 @@ This manpage only covers a subset of the supported options.
.I "1. For all supported chipsets"
.PP
The following driver
.B Options
.B options
are supported on all chipsets:
.TP
.BI "Option \*qNoAccel\*q \*q" boolean \*q
......@@ -81,25 +81,24 @@ Enable or disable the HW cursor. Default: HWCursor is on.
.BI "Option \*qSWCursor\*q \*q" boolean \*q
The opposite of HWCursor. Default: SWCursor is off.
.TP
.BI "Option \*qRotate\*q \*qCW\*q"
Rotate the display clockwise. This mode is unaccelerated, and uses
the Shadow Frame Buffer layer. Using this option disables
the Resize and Rotate extension (RandR).
Default: no rotation.
.TP
.BI "Option \*qRotate\*q \*qCCW\*q"
Rotate the display counterclockwise. This mode is unaccelerated, and
uses the Shadow Frame Buffer layer. Using this option disables
the Resize and Rotate extension (RandR).
.BI "Option \*qRotate\*q \*q" string \*q
Rotate the display clockwise ("CW") or counter-clockwise ("CCW"). This
mode is unaccelerated. Using this option disables XVideo and the Resize
and Rotate extension (RandR). Rotation and reflection (see below) are
mutually exclusive.
Default: no rotation.
.TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer.
Default: Shadow framebuffer is off.
.BI "Option \*qReflect\*q \*q" string \*q
Reflect (mirror) the display horizontally ("X"), vertically ("Y") or
both ("XY"). This mode is unaccelerated. Using this option disables
XVideo and the Resize and Rotate extension (RandR). Rotation (see
above) and reflection are mutually exclusive.
Default: no reflection.
.TP
.BI "Option \*qCRT1Gamma\*q \*q" boolean \*q
Enable or disable gamma correction.
Default: Gamma correction is on.
Enable or disable gamma correction. (On the 300 and 315/330 series, this
option only affects CRT1 output).
Default: Gamma correction is enabled.
.PP
.I "2. Old series specific information"
.PP
......@@ -111,16 +110,11 @@ the 3D engine can address RAM above 4MB. However, you can override this
limitation using the
.B \*qVideoRAM\*q
option in the Device section if your board has more than 4MB and you
need to use it. However, 2D acceleration, Xvideo and the HWCursor will
need to use it. However, 2D acceleration, XVideo and the HWCursor will
be disabled in this case.
.PP
The driver will also auto-detect the maximum dotclock and DAC speed.
If you have problems getting high resolutions because of dot clock
limitations, try using the
.B \*qDacSpeed\*q
option, also in the Device section. However, this is not recommended
for the 6326. For this chip, the driver has two built-in modes for
high resolutions which you should use instead. These are named
For the 6326, the driver has two built-in modes for high resolutions
which you should use instead of the default ones. These are named
.B \*qSIS1280x1024-75\*q
and
.B \*qSIS1600x1200-60\*q
......@@ -135,8 +129,8 @@ is available at 8bpp only.
TV support for the 6326
.PP
TV output is supported for the 6326. The driver will auto detect a
TV connected and in this case add the following modes to the list
of default modes: "PAL800x600", "PAL800x600U", "PAL720x540",
connected TV and in this case add the following display modes to the list
of available display modes: "PAL800x600", "PAL800x600U", "PAL720x540",
"PAL640x480", "NTSC640x480", "NTSC640x480U" and "NTSC640x400".
Use these modes like the hi-res modes described above.
.PP
......
......@@ -151,6 +151,9 @@ static const SiS_ExtStruct SiS310_EModeIDTable[]=
{0x20,0x6a1b,0x0000,SIS_RI_960x600, 0x00,0x00,0x00,0x00,0x54,-1}, /* 960x600 */
{0x21,0x6a3d,0x0000,SIS_RI_960x600, 0x00,0x00,0x00,0x00,0x54,-1},
{0x22,0x6a7f,0x0000,SIS_RI_960x600, 0x00,0x00,0x00,0x00,0x54,-1},
{0x1a,0x0e3b,0x0000,SIS_RI_1280x854, 0x00,0x00,0x00,0x00,0x55, 8}, /* 1280x854 */
{0x1b,0x0e7d,0x0000,SIS_RI_1280x854, 0x00,0x00,0x00,0x00,0x55, 8},
{0x1c,0x0eff,0x0000,SIS_RI_1280x854, 0x00,0x00,0x00,0x00,0x55, 8},
{0xff,0x0000,0x0000,0, 0x00,0x00,0x00,0x00,0x00,-1}
};
......@@ -241,6 +244,9 @@ static const SiS_Ext2Struct SiS310_RefIndex[]=
{0x0087,0x51,0x69,0x00,0x00,0x2c,1920,1080, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x52 1920x1080 60Hzi */
{0x0067,0x52,0x6a,0x00,0x1c,0x1d, 960, 540, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x53 960x540 60Hz */
{0x0077,0x53,0x6b,0x0b,0x1d,0x20, 960, 600, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, /* 0x54 960x600 60Hz */
{0x2067,0x61,0x76,0x0d,0x22,0x1a,1280, 854, 0x30, 0x00, 0x00, 0x62, 0x19, 0x61, 0x76}, /* 0x55 1280x854-60Hz */
{0x2067,0x61,0x76,0x0d,0x22,0x1a,1280, 854, 0x30, 0x00, 0x00, 0x63, 0x1e, 0xff, 0xff}, /* 0x56 1280x854-75Hz */
{0x2067,0x61,0x76,0x0d,0x22,0x1a,1280, 854, 0x30, 0x00, 0x00, 0x64, 0x20, 0xff, 0xff}, /* 0x57 1280x854-85Hz */
{0xffff,0x00,0x00,0x00,0x00,0x00, 0, 0, 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
};
......@@ -287,6 +293,9 @@ static const struct {
{ 0x50, 0x00, 0x0127 },
{ 0x51, 0x00, 0x0128 },
{ 0x52, 0x00, 0x0129 },
{ 0x53, 0x1a, 0x0141 },
{ 0x54, 0x1b, 0x0142 },
{ 0x55, 0x1c, 0x0143 },
{ 0x56, 0x00, 0x012a },
{ 0x57, 0x00, 0x012b },
{ 0x58, 0x00, 0x012c },
......@@ -627,7 +636,19 @@ static const SiS_CRT1TableStruct SiS310_CRT1Table[]=
0x01}}, /* 0x5f */
{{0xc9,0x9f,0x9f,0x8d,0xb0,0x15,0xec,0xf0, /* 1280x720 (wide) 60 Hz */
0xd4,0x89,0xcf,0xd3,0xed,0x20,0x00,0x07,
0x01}} /* 0x60 */
0x01}}, /* 0x60 */
{{0xcb,0x9f,0x9f,0x8f,0xa5,0x13,0x5b,0xff, /* 1280x854-60 wide */
0x56,0x89,0x55,0x55,0x5c,0x30,0x00,0x07,
0x01}}, /* 0x61 */
{{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xde, /* 1280x854 (1280x1024) 60 Hz */
0xbd,0x81,0x55,0xbc,0x29,0x01,0x00,0x07,
0x41}}, /* 0x62 */
{{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xde, /* 1280x854 (1280x1024) 75 Hz */
0xbd,0x81,0x55,0xbc,0x29,0x01,0x00,0x07,
0x41}}, /* 0x63 */
{{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xde, /* 1280x854 (1280x1024) 85 Hz */
0xc0,0x84,0x55,0xbf,0x2f,0x01,0x00,0x07,
0x41}} /* 0x64 */
};
static const SiS_MCLKDataStruct SiS310_MCLKData_0_315[] =
......@@ -857,7 +878,8 @@ static SiS_VCLKDataStruct SiS310_VCLKData[]=
{ 0xa8,0x42,131}, /* 0x72 1600x1200@60 for LCDA */
{ 0x1b,0xc1, 34}, /* 0x73 800x480 60Hz (wide) */
{ 0x41,0x64, 48}, /* 0x74 1024x576 60Hz (wide) */
{ 0x52,0x27, 75} /* 0x75 1280x720 60Hz (wide) */
{ 0x52,0x27, 75}, /* 0x75 1280x720 60Hz (wide) */
{ 0x75,0x13, 84} /* 0x76 1280x854 60Hz (wide) */
};
static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
......@@ -985,7 +1007,8 @@ static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]=
{ 0xa8,0x42,131}, /* 0x72 1600x1200@60 for LCDA */
{ 0x1b,0xc1, 34}, /* 0x73 800x480 60Hz (wide) */
{ 0x41,0x64, 48}, /* 0x74 1024x576 60Hz (wide) */
{ 0x52,0x27, 75} /* 0x75 1280x720 60Hz (wide) */
{ 0x52,0x27, 75}, /* 0x75 1280x720 60Hz (wide) */
{ 0x75,0x13, 84} /* 0x76 1280x854 60Hz (SiS LVDS) LCD */
};
static const DRAM4Type SiS310_SR15[8] = {
......
......@@ -138,6 +138,7 @@ InitCommonPointer(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
SiS_Pr->SiS_ExtLCD1280x768_2Data = SiS_ExtLCD1280x768_2Data;
SiS_Pr->SiS_LCD1280x800Data = SiS_LCD1280x800Data;
SiS_Pr->SiS_LCD1280x800_2Data = SiS_LCD1280x800_2Data;
SiS_Pr->SiS_LCD1280x854Data = SiS_LCD1280x854Data;
SiS_Pr->SiS_LCD1280x960Data = SiS_LCD1280x960Data;
SiS_Pr->SiS_StLCD1400x1050Data = SiS_StLCD1400x1050Data;
SiS_Pr->SiS_ExtLCD1400x1050Data = SiS_ExtLCD1400x1050Data;
......@@ -505,6 +506,11 @@ SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
ModeIndex = ModeIndex_1280x800[Depth];
}
break;
case 854:
if(VGAEngine == SIS_315_VGA) {
ModeIndex = ModeIndex_1280x854[Depth];
}
break;
case 960:
ModeIndex = ModeIndex_1280x960[Depth];
break;
......@@ -742,6 +748,11 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay,
ModeIndex = ModeIndex_1280x800[Depth];
}
break;
case 854:
if(VGAEngine == SIS_315_VGA) {
ModeIndex = ModeIndex_1280x854[Depth];
}
break;
case 960:
ModeIndex = ModeIndex_1280x960[Depth];
break;
......@@ -967,8 +978,11 @@ SiS_GetModeID_VGA2(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int
}
} else if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth];
else if(VDisplay == 720) ModeIndex = ModeIndex_1280x720[Depth];
else if(VDisplay == 800) ModeIndex = ModeIndex_1280x800[Depth];
else if(VDisplay == 960) ModeIndex = ModeIndex_1280x960[Depth];
else if(VGAEngine == SIS_315_VGA) {
if(VDisplay == 800) ModeIndex = ModeIndex_1280x800[Depth];
else if(VDisplay == 854) ModeIndex = ModeIndex_1280x854[Depth];
}
break;
case 1360:
if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth];
......@@ -1260,6 +1274,9 @@ SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
/* HELPER: SetLVDSetc */
/*********************************************/
#ifdef LINUX_KERNEL
static
#endif
void
SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
{
......@@ -1502,6 +1519,9 @@ SiS_ResetSegmentRegisters(SiS_Private *SiS_Pr,PSIS_HW_INFO HwInfo)
/* HELPER: GetVBType */
/*********************************************/
#ifdef LINUX_KERNEL
static
#endif
void
SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
{
......
......@@ -113,6 +113,7 @@ static const USHORT ModeIndex_300_1280x768[] = {0x55, 0x5a, 0x00, 0x5b};
static const USHORT ModeIndex_310_1280x768[] = {0x23, 0x24, 0x00, 0x25};
static const USHORT ModeIndex_1280x720[] = {0x79, 0x75, 0x00, 0x78};
static const USHORT ModeIndex_1280x800[] = {0x14, 0x15, 0x00, 0x16};
static const USHORT ModeIndex_1280x854[] = {0x1a, 0x1b, 0x00, 0x1c};
static const USHORT ModeIndex_1360x768[] = {0x48, 0x4b, 0x00, 0x4e};
static const USHORT ModeIndex_300_1360x1024[]= {0x67, 0x6f, 0x00, 0x72}; /* 300 series, BARCO only */
static const USHORT ModeIndex_1400x1050[] = {0x26, 0x27, 0x00, 0x28}; /* 315 series only */
......@@ -286,7 +287,8 @@ static const SiS_ModeResInfoStruct SiS_ModeResInfo[] =
{ 1280, 800, 8,16}, /* 0x1e */
{ 1920,1080, 8,16}, /* 0x1f */
{ 960, 540, 8,16}, /* 0x20 */
{ 960, 600, 8,16} /* 0x21 */
{ 960, 600, 8,16}, /* 0x21 */
{ 1280, 854, 8,16} /* 0x22 */
};
#if defined(SIS300) || defined(SIS315H)
......@@ -1086,6 +1088,24 @@ static const SiS_LCDDataStruct SiS_LCD1280x800_3Data[] = /* 2.02.05a (LVDS); m2
};
#endif
static const SiS_LCDDataStruct SiS_LCD1280x854Data[] = /* 2.21.00CS (LVDS) */
{
{ 56, 15, 936, 410, 1664, 861 }, /* 640x400 */
{ 64, 25, 1586, 355, 1664, 861 },
{ 56, 15, 936, 410, 1664, 861 },
{ 64, 25, 1586, 355, 1664, 861 },
{ 91, 45, 1464, 485, 1664, 861 }, /* 640x480 */
{ 182, 75, 976, 605, 1664, 861 }, /* 800x600 */
{ 91, 66, 1342, 774, 1664, 861 }, /* 1024x768 */
{ 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */
{ 26, 25, 1708, 807, 1664, 861 }, /* 1280x800 */
{ 13, 12, 1708, 774, 1664, 861 }, /* 1280x768 - patch index */
{ 52, 45, 1708, 725, 1664, 861 }, /* 1280x720 */
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1664, 861, 1664, 861 } /* 1280x854 */
};
static const SiS_LCDDataStruct SiS_LCD1280x960Data[] =
{
{ 9, 2, 800, 500, 1800, 1000 },
......@@ -1096,7 +1116,12 @@ static const SiS_LCDDataStruct SiS_LCD1280x960Data[] =
{ 30, 11, 1056, 625, 1800, 1000 },
{ 5, 3, 1350, 800, 1800, 1000 },
{ 1, 1, 1576, 1050, 1576, 1050 },
{ 1, 1, 1800, 1000, 1800, 1000 }
{ 1, 1, 1800, 1000, 1800, 1000 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
static const SiS_LCDDataStruct SiS_StLCD1400x1050Data[] =
......@@ -1109,7 +1134,12 @@ static const SiS_LCDDataStruct SiS_StLCD1400x1050Data[] =
{ 211, 72, 1008, 609, 1688, 1066 },
{ 211, 128, 1400, 776, 1688, 1066 },
{ 211, 205, 1680, 1041, 1688, 1066 },
{ 1, 1, 1688, 1066, 1688, 1066 }
{ 1, 1, 1688, 1066, 1688, 1066 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
static const SiS_LCDDataStruct SiS_ExtLCD1400x1050Data[] =
......@@ -1127,7 +1157,10 @@ static const SiS_LCDDataStruct SiS_ExtLCD1400x1050Data[] =
{ 211, 205, 1680, 1041, 1688, 1066 }, /* 1280x1024 - not used (always unscaled) */
{ 1, 1, 1688, 1066, 1688, 1066 }, /* 1400x1050 */
{ 0, 0, 0, 0, 0, 0 }, /* kludge */
{ 211, 120, 1400, 730, 1688, 1066 } /* 1280x720 */
{ 211, 120, 1400, 730, 1688, 1066 }, /* 1280x720 */
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
static const SiS_LCDDataStruct SiS_LCD1680x1050Data[] =
......@@ -1144,7 +1177,8 @@ static const SiS_LCDDataStruct SiS_LCD1680x1050Data[] =
{ 95, 69, 1800, 817, 1900, 1066 }, /* 9 1280x800 patch index */
{ 13, 9, 1900, 739, 1900, 1066 }, /* 10 1280x720 */
{ 95, 94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch index */
{ 1, 1, 1900, 1066, 1900, 1066 } /* 12 1680x1050 */
{ 1, 1, 1900, 1066, 1900, 1066 }, /* 12 1680x1050 */
{ 0, 0, 0, 0, 0, 0 }
};
static const SiS_LCDDataStruct SiS_StLCD1600x1200Data[] =
......@@ -1158,7 +1192,11 @@ static const SiS_LCDDataStruct SiS_StLCD1600x1200Data[] =
{ 5, 2,1350, 800, 2160, 1250 },
{135,88,1600,1100, 2160, 1250 },
{72, 49,1680,1092, 2160, 1250 },
{ 1, 1,2160,1250, 2160, 1250 }
{ 1, 1,2160,1250, 2160, 1250 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
static const SiS_LCDDataStruct SiS_ExtLCD1600x1200Data[] =
......@@ -1174,7 +1212,11 @@ static const SiS_LCDDataStruct SiS_ExtLCD1600x1200Data[] =
{ 5, 2,1350, 800, 2160, 1250 },
{27,16,1500,1064, 2160, 1250 }, /* 1280x1024 */
{72,49,1680,1092, 2160, 1250 }, /* 1400x1050 (6330, was not supported on 6325) */
{ 1, 1,2160,1250, 2160, 1250 }
{ 1, 1,2160,1250, 2160, 1250 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 0, 0 }
};
static const SiS_LCDDataStruct SiS_NoScaleData[] =
......@@ -1211,7 +1253,8 @@ static const SiS_LCDDataStruct SiS_NoScaleData[] =
{ 1, 1,1120, 618,1120, 618 }, /* 0x1d: 960x600 */
{ 1, 1,1408, 816,1408, 816 }, /* 0x1f: 1280x800 (TMDS special) */
{ 1, 1,1760,1235,1760,1235 }, /* 0x20: 1600x1200 for LCDA */
{ 1, 1,2048,1320,2048,1320 } /* 0x21: 1600x1200 for non-SiS LVDS */
{ 1, 1,2048,1320,2048,1320 }, /* 0x21: 1600x1200 for non-SiS LVDS */
{ 1, 1,1664, 861,1664, 861 } /* 0x22: 1280x854 */
};
/**************************************************************/
......@@ -1958,11 +2001,15 @@ void SiS_SetRegOR(SISIOADDRESS Port,USHORT Index, USHORT DataOR);
void SiS_DisplayOn(SiS_Private *SiS_Pr);
void SiS_DisplayOff(SiS_Private *SiS_Pr);
void SiSRegInit(SiS_Private *SiS_Pr, SISIOADDRESS BaseAddr);
#ifndef LINUX_KERNEL
void SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
#endif
BOOLEAN SiSDetermineROMLayout661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
void SiS_SetEnableDstn(SiS_Private *SiS_Pr, int enable);
void SiS_SetEnableFstn(SiS_Private *SiS_Pr, int enable);
#ifndef LINUX_KERNEL
void SiS_GetVBType(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
#endif
BOOLEAN SiS_SearchModeID(SiS_Private *SiS_Pr, USHORT *ModeNo, USHORT *ModeIdIndex);
UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex);
......@@ -2011,7 +2058,6 @@ extern void SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT Mod
extern void SiS_SetYPbPr(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern void SiS_SetTVMode(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo);
extern void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo);
extern void SiS_DisableBridge(SiS_Private *, PSIS_HW_INFO);
extern BOOLEAN SiS_SetCRT2Group(SiS_Private *, PSIS_HW_INFO, USHORT);
extern USHORT SiS_GetRatePtr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
......
......@@ -90,6 +90,9 @@
#define SiS_I2CDELAYSHORT 150
static USHORT SiS_GetBIOSLCDResInfo(SiS_Private *SiS_Pr);
#ifdef LINUX_KERNEL
static void SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx);
#endif
/*********************************************/
/* HELPER: Lock/Unlock CRT2 */
......@@ -104,6 +107,9 @@ SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
SiS_SetRegOR(SiS_Pr->SiS_Part1Port,0x24,0x01);
}
#ifdef LINUX_KERNEL
static
#endif
void
SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
{
......@@ -1431,8 +1437,11 @@ 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_1280x800_2) temp = Panel_1280x800;
switch(temp) {
case Panel_1280x768_2: temp = Panel_1280x768; break;
case Panel_1280x800_2: temp = Panel_1280x800; break;
case Panel_1280x854: temp = Panel661_1280x854; break;
}
return temp;
}
......@@ -1569,11 +1578,15 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
#endif
/* Translate to our internal types */
#ifdef SIS315H
if(HwInfo->jChipType == SIS_550) {
if (temp == Panel310_1152x768) temp = Panel_320x240_2; /* Verified working */
else if(temp == Panel310_320x240_2) temp = Panel_320x240_2;
else if(temp == Panel310_320x240_3) temp = Panel_320x240_3;
} else if(HwInfo->jChipType >= SIS_661) {
if(temp == Panel661_1280x854) temp = Panel_1280x854;
}
#endif
if(SiS_Pr->SiS_VBType & VB_SISLVDS) { /* SiS LVDS */
if(temp == Panel310_1280x768) {
......@@ -1782,6 +1795,13 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315_2;
SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
break;
case Panel_1280x854: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 854;
SiS_Pr->PanelHT = 1664; SiS_Pr->PanelVT = 861;
SiS_Pr->PanelHRS = 16; SiS_Pr->PanelHRE = 112;
SiS_Pr->PanelVRS = 1; SiS_Pr->PanelVRE = 3;
SiS_Pr->PanelVCLKIdx315 = VCLK_1280x854;
SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo);
break;
case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960;
SiS_Pr->PanelHT = 1800; SiS_Pr->PanelVT = 1000;
SiS_Pr->PanelVCLKIdx300 = VCLK108_3_300;
......@@ -1982,12 +2002,29 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
}
break;
}
case Panel_1280x854: { /* 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_960x600, SIS_RI_1024x576,SIS_RI_1024x600,
SIS_RI_1152x768,0xff
};
SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
switch(resinfo) {
case SIS_RI_1280x720:
case SIS_RI_1280x768:
case SIS_RI_1280x800: if(SiS_Pr->UsePanelScaler == -1) {
SiS_Pr->SiS_LCDInfo |= DontExpandLCD;
}
break;
}
break;
}
case Panel_1280x960: {
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_960x600, SIS_RI_1024x576,SIS_RI_1024x600,
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800,
0xff
SIS_RI_1280x854,0xff
};
SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
break;
......@@ -1997,7 +2034,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480,
SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600,
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800,
SIS_RI_1280x960,0xff
SIS_RI_1280x854,SIS_RI_1280x960,0xff
};
SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
break;
......@@ -2006,8 +2043,8 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
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_960x600, SIS_RI_1024x576,SIS_RI_1024x600,
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x768,SIS_RI_1280x800,SIS_RI_1280x960,
0xff
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x768,SIS_RI_1280x800,SIS_RI_1280x854,
SIS_RI_1280x960,0xff
};
SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
switch(resinfo) {
......@@ -2025,7 +2062,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480,
SIS_RI_856x480, SIS_RI_960x540, SIS_RI_960x600, SIS_RI_1024x576,SIS_RI_1024x600,
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800,
SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,0xff
SIS_RI_1280x854,SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,0xff
};
SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
break;
......@@ -2034,8 +2071,8 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex,
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_960x600, SIS_RI_1024x576,SIS_RI_1024x600,
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,
0xff
SIS_RI_1152x768,SIS_RI_1152x864,SIS_RI_1280x854,SIS_RI_1280x960,SIS_RI_1360x768,
SIS_RI_1360x1024,0xff
};
SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes);
break;
......@@ -2882,11 +2919,13 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
tempbx = SiS_Pr->SiS_LCDResInfo;
if(!(SiS_Pr->SiS_SetFlag & LCDVESATiming)) tempbx += 32;
/* patch index */
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) ||
(SiS_Pr->SiS_LCDResInfo == Panel_1280x800_2)) {
(SiS_Pr->SiS_LCDResInfo == Panel_1280x800_2) ||
(SiS_Pr->SiS_LCDResInfo == Panel_1280x854)) {
if (resinfo == SIS_RI_1280x768) tempal = 9;
}
......@@ -3475,6 +3514,8 @@ SiS_GetCRT2Data301(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex,
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_1280x854 :
case Panel_1280x854 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x854Data; break;
case Panel_1280x960 :
case Panel_1280x960 + 32: LCDPtr = SiS_Pr->SiS_LCD1280x960Data; break;
case Panel_1280x1024 : LCDPtr = SiS_Pr->SiS_ExtLCD1280x1024Data; break;
......@@ -3690,6 +3731,7 @@ SiS_GetLVDSDesData(SiS_Private *SiS_Pr, USHORT ModeNo,USHORT ModeIdIndex,
break;
case Panel_1280x800: /* Verified for Averatec 6240 */
case Panel_1280x800_2: /* Verified for Asus A4L */
case Panel_1280x854: /* Not verified yet FIXME */
SiS_Pr->SiS_LCDVDES = SiS_Pr->PanelVT - 1;
break;
}
......@@ -4250,6 +4292,9 @@ SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
* from outside the context of a mode switch!
* MUST call getVBType before calling this
*/
#ifdef LINUX_KERNEL
static
#endif
void
SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo)
{
......@@ -9102,6 +9147,9 @@ SiS_SetTrumpReg(SiS_Private *SiS_Pr, USHORT tempbx)
/* Write to Chrontel 700x */
/* Parameter is [Data (S15-S8) | Register no (S7-S0)] */
#ifdef LINUX_KERNEL
static
#endif
void
SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx)
{
......@@ -9140,6 +9188,9 @@ SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx)
SiS_SetChReg(SiS_Pr, tempbx, 0);
}
#ifdef LINUX_KERNEL
static
#endif
void
SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
{
......@@ -9246,6 +9297,9 @@ SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx)
/* Read from Chrontel 70xx */
/* Parameter is [Register no (S7-S0)] */
#ifdef LINUX_KERNEL
static
#endif
USHORT
SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempbx)
{
......@@ -11334,6 +11388,7 @@ SetDelayComp661(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo, USHORT ModeNo,
case Panel_1280x768_2:delay = 0x0004; break;
case Panel_1280x800:
case Panel_1280x800_2:delay = 0x0004; break; /* Verified for 1280x800 */
case Panel_1280x854: delay = 0x0004; break; /* FIXME */
case Panel_1280x1024: delay = 0x1e04; break;
case Panel_1400x1050: delay = 0x0004; break;
case Panel_1600x1200: delay = 0x0400; break;
......@@ -11908,7 +11963,7 @@ SetOEMLCDData(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo,
}
temp = GetOEMLCDPtr(SiS_Pr,HwInfo, 1);
if(temp = 0xFFFF) return;
if(temp == 0xFFFF) return;
index = SiS_Pr->SiS_VBModeIDTable[ModeIdIndex]._VB_LCDHIndex;
for(i=0x14, j=0; i<=0x17; i++, j++) {
......
This diff is collapsed.
......@@ -404,7 +404,7 @@
#define Panel661_1024x600 0x05
#define Panel661_1152x864 0x06
#define Panel661_1280x960 0x07
#define Panel661_1152x768 0x08
#define Panel661_1280x854 0x08
#define Panel661_1400x1050 0x09
#define Panel661_1280x768 0x0a
#define Panel661_1600x1200 0x0b
......@@ -437,6 +437,7 @@
#define Panel_1280x768_3 0x16 /* (unused) */
#define Panel_1280x800_2 0x17 /* 30xLV */
#define Panel_856x480 0x18
#define Panel_1280x854 0x19 /* 661etc */
/* Index in ModeResInfo table */
#define SIS_RI_320x200 0
......@@ -473,6 +474,7 @@
#define SIS_RI_1920x1080 31
#define SIS_RI_960x540 32
#define SIS_RI_960x600 33
#define SIS_RI_1280x854 34
/* CR5F */
#define IsM650 0x80
......@@ -528,6 +530,7 @@
#define VCLK_1152x864 0x64
#define VCLK_1360x768 0x58
#define VCLK_1280x800_315 0x6c
#define VCLK_1280x854 0x76
#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) */
......
......@@ -36,8 +36,8 @@
#define _SIS_H_
#define SISDRIVERVERSIONYEAR 5
#define SISDRIVERVERSIONMONTH 4
#define SISDRIVERVERSIONDAY 21
#define SISDRIVERVERSIONMONTH 6
#define SISDRIVERVERSIONDAY 20
#define SISDRIVERREVISION 1
#define SISDRIVERIVERSION ((SISDRIVERVERSIONYEAR << 16) | \
......@@ -377,6 +377,7 @@
#define VB_LCD_1280x720 0x00040000
#define VB_LCD_320x240 0x00080000
#define VB_LCD_856x480 0x00100000
#define VB_LCD_1280x854 0x00200000
#define VB_LCD_UNKNOWN 0x10000000
#define VB_LCD_BARCO1366 0x20000000
#define VB_LCD_CUSTOM 0x40000000
......@@ -746,7 +747,6 @@ typedef struct {
Bool CRT1gamma, CRT1gammaGiven, CRT2gamma, XvGamma, XvGammaGiven, XvDefAdaptorBlit;
int XvGammaRed, XvGammaGreen, XvGammaBlue;
int GammaBriR, GammaBriG, GammaBriB; /* strictly for Xinerama */
int GammaPBriR, GammaPBriG, GammaPBriB; /* strictly for Xinerama */
unsigned int CRT1MonGamma, CRT2MonGamma;
unsigned int CRT1VGAMonitorGamma, CRT2LCDMonitorGamma, CRT2VGAMonitorGamma;
int curxvcrtnum;
......@@ -1160,7 +1160,6 @@ typedef struct {
UChar *CurMonoSrc;
CARD32 *CurARGBDest;
int GammaBriR, GammaBriG, GammaBriB;
int GammaPBriR, GammaPBriG, GammaPBriB;
unsigned int CRT1MonGamma, CRT2MonGamma;
unsigned int CRT1VGAMonitorGamma, CRT2LCDMonitorGamma, CRT2VGAMonitorGamma;
Bool HideHWCursor; /* Custom application */
......@@ -1196,7 +1195,6 @@ typedef struct {
float GammaR2, GammaG2, GammaB2;
int GammaR2i, GammaG2i, GammaB2i;
int GammaBriR2, GammaBriG2, GammaBriB2;
int GammaPBriR2, GammaPBriG2, GammaPBriB2;
ExtensionEntry *SiSCtrlExtEntry;
char devsectname[32];
Bool SCLogQuiet;
......
......@@ -1373,17 +1373,21 @@ SiSEstimateCRT2Clock(ScrnInfoPtr pScrn, Bool FakeForCRT2)
} else if(pSiS->VBLCDFlags & (VB_LCD_1024x768 | VB_LCD_1024x600 | VB_LCD_1152x768)) {
return 65000;
} else if(pSiS->VBLCDFlags & VB_LCD_1280x720) {
/* Fake clock; VGA mode is 108, but uses only 75 for LCD */
/* Fake clock; VGA (4:3) mode is 108, but uses only 75 for LCD */
if(FakeForCRT2) return 108000;
else return 75000;
} else if(pSiS->VBLCDFlags & VB_LCD_1280x768) {
/* Fake clock; VGA mode is 108, but uses only 81 for LCD */
/* Fake clock; VGA (4:3) mode is 108, but uses only 81 for LCD */
if(FakeForCRT2) return 108000;
else return 81000;
} else if(pSiS->VBLCDFlags & VB_LCD_1280x800) {
/* Fake clock; VGA mode is 108, but uses only 83 for LCD */
/* Fake clock; VGA (4:3) mode is 108, but uses only 83 for LCD */
if(FakeForCRT2) return 108000;
else return 83000;
} else if(pSiS->VBLCDFlags & VB_LCD_1280x854) {
/* Fake clock; VGA (4:3) mode is 108, but uses only 84 for LCD */
if(FakeForCRT2) return 108000;
else return 84000;
} else if(pSiS->VBLCDFlags & (VB_LCD_1280x1024 | VB_LCD_1280x960)) {
return 108000;
} else if(pSiS->VBLCDFlags & VB_LCD_1400x1050) {
......
......@@ -65,6 +65,14 @@ extern char *DRICreatePCIBusID(pciVideoPtr PciInfo);
#include "sis_common.h"
#endif
#ifndef DRIINFO_MAJOR_VERSION
#define DRIINFO_MAJOR_VERSION 4
#endif
#ifndef DRIINFO_MINOR_VERSION
#define DRIINFO_MINOR_VERSION 0
#endif
/* Idle function for 300 series */
#define BR(x) (0x8200 | (x) << 2)
#define SiSIdle \
......@@ -274,10 +282,9 @@ SISDRIScreenInit(ScreenPtr pScreen)
if(major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION) {
xf86DrvMsg(pScreen->myNum, X_ERROR,
"[dri] SISDRIScreenInit failed because of a version mismatch.\n"
"\t[dri] libdri version is %d.%d.%d but version %d.%d.x is needed.\n"
"\t[dri] libDRI version is %d.%d.%d but version %d.%d.x is needed.\n"
"\t[dri] Disabling DRI.\n",
major, minor, patch,
DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION);
major, minor, patch, DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION);
return FALSE;
}