Commit 08c8d743 authored by James Simmons's avatar James Simmons

[FBDEV] Updates for the SIS fbdev driver to the new api. Removed poll. We wil...

[FBDEV] Updates for the SIS fbdev driver to the new api. Removed poll. We wil use signals in the future instead.
parent fdd82b90
......@@ -57,7 +57,7 @@ obj-$(CONFIG_FB_TX3912) += tx3912fb.o cfbfillrect.o cfbcopyarea.o cfbi
obj-$(CONFIG_FB_MATROX) += matrox/
obj-$(CONFIG_FB_RIVA) += riva/ cfbimgblt.o vgastate.o
obj-$(CONFIG_FB_SIS) += sis/
obj-$(CONFIG_FB_SIS) += sis/ cfbimgblt.o cfbfillrect.o cfbcopyarea.o
obj-$(CONFIG_FB_ATY) += aty/ cfbimgblt.o cfbfillrect.o cfbcopyarea.o
obj-$(CONFIG_FB_I810) += i810/ cfbfillrect.o cfbcopyarea.o \
cfbimgblt.o vgastate.o
......
......@@ -107,14 +107,12 @@ static int hitfb_setcolreg(unsigned regno, unsigned red, unsigned green,
if (regno < 16) {
switch(info->var.bits_per_pixel) {
#ifdef FBCON_HAS_CFB16
case 16:
((u16 *)(info->pseudo_palette))[regno] =
((red & 0xf800) ) |
((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11);
break;
#endif
}
}
return 0;
......
......@@ -15,7 +15,7 @@ typedef struct _SiS300_StStruct
UCHAR VB_StTVYFilterIndex;
} SiS300_StStruct;
SiS300_StStruct SiS300_SModeIDTable[]=
static const SiS300_StStruct SiS300_SModeIDTable[] =
{
{0x01,0x9208,0x01,0x00,0x00,0x00,0x00,0x00},
{0x01,0x1210,0x14,0x01,0x01,0x00,0x00,0x00},
......@@ -34,10 +34,9 @@ SiS300_StStruct SiS300_SModeIDTable[]=
{0x11,0x0212,0x1a,0x04,0x04,0x00,0x00,0x00},
{0x12,0x0212,0x1b,0x04,0x04,0x00,0x00,0x00},
{0x13,0x021b,0x1c,0x00,0x00,0x00,0x00,0x00},
/* {0x12,0x0210,0x18,0x00,0x00,0x00,0x00,0x00}, */ /* <--- Different in BIOS */
{0x12,0x0010,0x18,0x02,0x02,0x00,0x00,0x00},
{0x12,0x0210,0x18,0x01,0x01,0x00,0x00,0x00},
{0xff,0,0,0,0,0,0,0}
{0xff, 0, 0, 0, 0, 0, 0, 0}
};
typedef struct _SiS300_StandTableStruct
......@@ -53,9 +52,9 @@ typedef struct _SiS300_StandTableStruct
UCHAR GRC[9];
} SiS300_StandTableStruct;
SiS300_StandTableStruct SiS300_StandTable[]=
{ /* TW: @ 0x38d4 in BIOS */
{0x28,0x18,0x08,0x0800,
static const SiS300_StandTableStruct SiS300_StandTable[] =
{
{0x28,0x18,0x08,0x0800, /* 0x00 */
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
......@@ -67,7 +66,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x28,0x18,0x08,0x0800,
{0x28,0x18,0x08,0x0800, /* 0x01 */
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
......@@ -79,7 +78,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x50,0x18,0x08,0x1000,
{0x50,0x18,0x08,0x1000, /* 0x02 */
{0x01,0x03,0x00,0x02},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -91,7 +90,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x50,0x18,0x08,0x1000,
{0x50,0x18,0x08,0x1000, /* 0x03 */
{0x01,0x03,0x00,0x02},
0x63,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -103,7 +102,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x28,0x18,0x08,0x4000,
{0x28,0x18,0x08,0x4000, /* 0x04 */
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
......@@ -115,7 +114,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x03,0x00},
{0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
0xff} },
{0x28,0x18,0x08,0x4000,
{0x28,0x18,0x08,0x4000, /* 0x05 */
{0x09,0x03,0x00,0x02},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
......@@ -127,7 +126,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x03,0x00},
{0x00,0x00,0x00,0x00,0x00,0x30,0x0f,0x00,
0xff} },
{0x50,0x18,0x08,0x4000,
{0x50,0x18,0x08,0x4000, /* 0x06 */
{0x01,0x01,0x00,0x06},
0x63,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
......@@ -139,7 +138,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x01,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,
0xff} },
{0x50,0x18,0x0e,0x1000,
{0x50,0x18,0x0e,0x1000, /* 0x07 */
{0x00,0x03,0x00,0x03},
0xa6,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -152,7 +151,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
{0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
0xff} },
/* MDA_DAC*/
{0x00,0x00,0x00,0x0000,
{0x00,0x00,0x00,0x0000, /* 0x08 */
{0x00,0x00,0x00,0x15},
0x15,
{0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
......@@ -165,7 +164,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
{0x15,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,0x3f,
0x3f} },
/* CGA_DAC*/
{0x00,0x10,0x04,0x0114,
{0x00,0x10,0x04,0x0114, /* 0x09 */
{0x11,0x09,0x15,0x00},
0x10,
{0x04,0x14,0x01,0x11,0x09,0x15,0x2a,0x3a,
......@@ -178,7 +177,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
{0x3f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
0x3f} },
/* EGA_DAC*/
{0x00,0x10,0x04,0x0114,
{0x00,0x10,0x04,0x0114, /* 0x0a */
{0x11,0x05,0x15,0x20},
0x30,
{0x24,0x34,0x21,0x31,0x25,0x35,0x08,0x18,
......@@ -191,7 +190,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
{0x1f,0x2a,0x3a,0x2e,0x3e,0x2b,0x3b,0x2f,
0x3f} },
/* VGA_DAC*/
{0x00,0x10,0x04,0x0114,
{0x00,0x10,0x04,0x0114, /* 0x0b */
{0x11,0x09,0x15,0x2a},
0x3a,
{0x2e,0x3e,0x2b,0x3b,0x2f,0x3f,0x00,0x05,
......@@ -203,7 +202,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x1c,0x0e,0x11,0x15},
{0x18,0x1c,0x14,0x16,0x18,0x1a,0x1c,0x00,
0x04} },
{0x08,0x0c,0x10,0x0a08,
{0x08,0x0c,0x10,0x0a08, /* 0x0c */
{0x0c,0x0e,0x10,0x0b},
0x0c,
{0x0d,0x0f,0x10,0x10,0x01,0x08,0x00,0x00,
......@@ -215,7 +214,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00} },
{0x28,0x18,0x08,0x2000,
{0x28,0x18,0x08,0x2000, /* 0x0d */
{0x09,0x0f,0x00,0x06},
0x63,
{0x2d,0x27,0x28,0x90,0x2b,0x80,0xbf,0x1f,
......@@ -227,7 +226,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff} },
{0x50,0x18,0x08,0x4000,
{0x50,0x18,0x08,0x4000, /* 0x0e */
{0x01,0x0f,0x00,0x06},
0x63,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
......@@ -239,8 +238,8 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff} },
{0x00,0x00,0x00,0x0000, /* TW: Standtable for VGA modes */
{0x01,0x0f,0x00,0x0e}, /* (identical to BIOS) */
{0x00,0x00,0x00,0x0000, /* 0x0f */ /* TW: Standtable for VGA modes */
{0x01,0x0f,0x00,0x0e},
0x23,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
......@@ -251,7 +250,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
0xff} },
{0x4a,0x36,0x00,0x00c0,
{0x4a,0x36,0x00,0x00c0, /* 0x10 */
{0x00,0x00,0x00,0x00},
0x00,
{0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x3a,
......@@ -263,7 +262,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00} },
{0x50,0x18,0x0e,0x8000,
{0x50,0x18,0x0e,0x8000, /* 0x11 */
{0x01,0x0f,0x00,0x06},
0xa2,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
......@@ -275,7 +274,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x0b,0x00,0x05,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x05,
0xff} },
{0x50,0x18,0x0e,0x8000,
{0x50,0x18,0x0e,0x8000, /* 0x12 */
{0x01,0x0f,0x00,0x06},
0xa3,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
......@@ -287,7 +286,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff} },
{0x28,0x18,0x0e,0x0800,
{0x28,0x18,0x0e,0x0800, /* 0x13 */
{0x09,0x03,0x00,0x02},
0xa3,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
......@@ -299,7 +298,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x28,0x18,0x0e,0x0800,
{0x28,0x18,0x0e,0x0800, /* 0x14 */
{0x09,0x03,0x00,0x02},
0xa3,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
......@@ -311,7 +310,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x50,0x18,0x0e,0x1000,
{0x50,0x18,0x0e,0x1000, /* 0x15 */
{0x01,0x03,0x00,0x02},
0xa3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -323,7 +322,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x50,0x18,0x0e,0x1000,
{0x50,0x18,0x0e,0x1000, /* 0x16 */
{0x01,0x03,0x00,0x02},
0xa3,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -335,7 +334,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x08,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x28,0x18,0x10,0x0800,
{0x28,0x18,0x10,0x0800, /* 0x17 */
{0x08,0x03,0x00,0x02},
0x67,
{0x2d,0x27,0x28,0x90,0x2b,0xa0,0xbf,0x1f,
......@@ -347,7 +346,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x0c,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x50,0x18,0x10,0x1000,
{0x50,0x18,0x10,0x1000, /* 0x18 */
{0x00,0x03,0x00,0x02},
0x67,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -359,7 +358,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x0c,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0e,0x00,
0xff} },
{0x50,0x18,0x10,0x1000,
{0x50,0x18,0x10,0x1000, /* 0x19 */
{0x00,0x03,0x00,0x02},
0x66,
{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
......@@ -371,7 +370,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x0e,0x00,0x0f,0x08},
{0x00,0x00,0x00,0x00,0x00,0x10,0x0a,0x00,
0xff} },
{0x50,0x1d,0x10,0xa000,
{0x50,0x1d,0x10,0xa000, /* 0x1a */
{0x01,0x0f,0x00,0x06},
0xe3,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
......@@ -383,7 +382,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x01,
0xff} },
{0x50,0x1d,0x10,0xa000,
{0x50,0x1d,0x10,0xa000, /* 0x1b */
{0x01,0x0f,0x00,0x06},
0xe3,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
......@@ -395,7 +394,7 @@ SiS300_StandTableStruct SiS300_StandTable[]=
0x01,0x00,0x0f,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x0f,
0xff} },
{0x28,0x18,0x08,0x2000,
{0x28,0x18,0x08,0x2000, /* 0x1c */
{0x01,0x0f,0x00,0x0e},
0x63,
{0x5f,0x4f,0x50,0x82,0x54,0x80,0xbf,0x1f,
......@@ -424,61 +423,85 @@ typedef struct _SiS300_ExtStruct
UCHAR REFindex;
} SiS300_ExtStruct;
SiS300_ExtStruct SiS300_EModeIDTable[]=
{
{0x6a,0x2212,0x47,0x3563,0x0102,0x08,0x07,0x00,0x00,0x00,0x00}, /* 37ed */ /* 800x600x? */
{0x2e,0x0a1b,0x36,0x3539,0x0101,0x08,0x06,0x00,0x00,0x00,0x08}, /* 37c3 */
{0x2f,0x021b,0x35,0x3532,0x0100,0x08,0x05,0x00,0x00,0x00,0x10}, /* 37bc */
{0x30,0x2a1b,0x47,0x3563,0x0103,0x08,0x07,0x00,0x00,0x00,0x00}, /* 37ed */
{0x31,0x0a1b,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11}, /* 38ba */ /* 720x480x8 */
{0x32,0x2a1b,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12}, /* 38c1 */ /* 720x576x8 */
{0x33,0x0a1d,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11}, /* 38ba */ /* 720x480x16 */
{0x34,0x2a1d,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12}, /* 38c1 */ /* 720x576x16 */
{0x35,0x0a1f,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11}, /* 38ba */ /* 720x480x32 */
{0x36,0x2a1f,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12}, /* 38c1 */ /* 720x576x32 */
{0x37,0x0212,0x58,0x358d,0x0104,0x08,0x08,0x00,0x00,0x00,0x13}, /* 3817 */ /* 1024x768x? */
{0x38,0x0a1b,0x58,0x358d,0x0105,0x08,0x08,0x00,0x00,0x00,0x13}, /* 3817 */ /* 1024x768x8 */
{0x3a,0x0e3b,0x69,0x35be,0x0107,0x08,0x09,0x00,0x00,0x00,0x1a}, /* 3848 */ /* 1280x1024x8 */
{0x3c,0x063b,0x7a,0x35d4,0x0130,0x08,0x0a,0x00,0x00,0x00,0x1e}, /* 385e */
{0x3d,0x067d,0x7a,0x35d4,0x0131,0x08,0x0a,0x00,0x00,0x00,0x1e}, /* 385e */
{0x40,0x921c,0x00,0x3516,0x010d,0x08,0x00,0x00,0x00,0x00,0x23}, /* 37a0 */
{0x41,0x921d,0x00,0x3516,0x010e,0x08,0x00,0x00,0x00,0x00,0x23}, /* 37a0 */
{0x43,0x0a1c,0x36,0x3539,0x0110,0x08,0x06,0x00,0x00,0x00,0x08}, /* 37c3 */
{0x44,0x0a1d,0x36,0x3539,0x0111,0x08,0x06,0x00,0x00,0x00,0x08}, /* 37c3 */
{0x46,0x2a1c,0x47,0x3563,0x0113,0x08,0x07,0x00,0x00,0x00,0x00}, /* 37ed */
{0x47,0x2a1d,0x47,0x3563,0x0114,0x08,0x07,0x00,0x00,0x00,0x00}, /* 37ed */
{0x49,0x0a3c,0x58,0x358d,0x0116,0x08,0x08,0x00,0x00,0x00,0x13}, /* 3817 */
{0x4a,0x0a3d,0x58,0x358d,0x0117,0x08,0x08,0x00,0x00,0x00,0x13}, /* 3817 */
{0x4c,0x0e7c,0x69,0x35be,0x0119,0x08,0x09,0x00,0x00,0x00,0x1a}, /* 3848 */
{0x4d,0x0e7d,0x69,0x35be,0x011a,0x08,0x09,0x00,0x00,0x00,0x1a}, /* 3848 */
{0x50,0x921b,0x01,0x351d,0x0132,0x08,0x01,0x00,0x00,0x00,0x24}, /* 37a7 */
{0x51,0xb21b,0x13,0x3524,0x0133,0x08,0x03,0x00,0x00,0x00,0x25}, /* 37ae */
{0x52,0x921b,0x24,0x352b,0x0134,0x08,0x04,0x00,0x00,0x00,0x26}, /* 37b5 */
{0x56,0x921d,0x01,0x351d,0x0135,0x08,0x01,0x00,0x00,0x00,0x24}, /* 37a7 */
{0x57,0xb21d,0x13,0x3524,0x0136,0x08,0x03,0x00,0x00,0x00,0x25}, /* 37ae */
{0x58,0x921d,0x24,0x352b,0x0137,0x08,0x04,0x00,0x00,0x00,0x26}, /* 37b5 */
{0x59,0x921b,0x00,0x3516,0x0138,0x08,0x00,0x00,0x00,0x00,0x23}, /* 37a0 */
static const SiS300_ExtStruct SiS300_EModeIDTable[] =
{
{0x6a,0x2212,0x47,0x3563,0x0102,0x08,0x07,0x00,0x00,0x00,0x00}, /* 800x600x? */
{0x2e,0x0a1b,0x36,0x3539,0x0101,0x08,0x06,0x00,0x00,0x00,0x08},
{0x2f,0x021b,0x35,0x3532,0x0100,0x08,0x05,0x00,0x00,0x00,0x10}, /* 640x400x8 */
{0x30,0x2a1b,0x47,0x3563,0x0103,0x08,0x07,0x00,0x00,0x00,0x00},
{0x31,0x0a1b,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11}, /* 720x480x8 */
{0x32,0x2a1b,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12}, /* 720x576x8 */
{0x33,0x0a1d,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11}, /* 720x480x16 */
{0x34,0x2a1d,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12}, /* 720x576x16 */
{0x35,0x0a1f,0xad,0x3630,0x0000,0x08,0x0c,0x00,0x00,0x00,0x11}, /* 720x480x32 */
{0x36,0x2a1f,0xae,0x3637,0x0000,0x08,0x0d,0x00,0x00,0x00,0x12}, /* 720x576x32 */
{0x37,0x0212,0x58,0x358d,0x0104,0x08,0x08,0x00,0x00,0x00,0x13}, /* 1024x768x? */
{0x38,0x0a1b,0x58,0x358d,0x0105,0x08,0x08,0x00,0x00,0x00,0x13}, /* 1024x768x8 */
{0x3a,0x0e3b,0x69,0x35be,0x0107,0x08,0x09,0x00,0x00,0x00,0x1a}, /* 1280x1024x8 */
{0x3c,0x063b,0x7a,0x35d4,0x0130,0x08,0x0a,0x00,0x00,0x00,0x1e},
{0x3d,0x067d,0x7a,0x35d4,0x0131,0x08,0x0a,0x00,0x00,0x00,0x1e},
{0x40,0x921c,0x00,0x3516,0x010d,0x08,0x00,0x00,0x00,0x00,0x23},
{0x41,0x921d,0x00,0x3516,0x010e,0x08,0x00,0x00,0x00,0x00,0x23},
{0x43,0x0a1c,0x36,0x3539,0x0110,0x08,0x06,0x00,0x00,0x00,0x08},
{0x44,0x0a1d,0x36,0x3539,0x0111,0x08,0x06,0x00,0x00,0x00,0x08},
{0x46,0x2a1c,0x47,0x3563,0x0113,0x08,0x07,0x00,0x00,0x00,0x00}, /* 800x600 */
{0x47,0x2a1d,0x47,0x3563,0x0114,0x08,0x07,0x00,0x00,0x00,0x00}, /* 800x600 */
{0x49,0x0a3c,0x58,0x358d,0x0116,0x08,0x08,0x00,0x00,0x00,0x13},
{0x4a,0x0a3d,0x58,0x358d,0x0117,0x08,0x08,0x00,0x00,0x00,0x13},
{0x4c,0x0e7c,0x69,0x35be,0x0119,0x08,0x09,0x00,0x00,0x00,0x1a},
{0x4d,0x0e7d,0x69,0x35be,0x011a,0x08,0x09,0x00,0x00,0x00,0x1a},
{0x50,0x921b,0x01,0x351d,0x0132,0x08,0x01,0x00,0x00,0x00,0x24},
{0x51,0xb21b,0x13,0x3524,0x0133,0x08,0x03,0x00,0x00,0x00,0x25}, /* 400x300 */
{0x52,0x921b,0x24,0x352b,0x0134,0x08,0x04,0x00,0x00,0x00,0x26},
{0x56,0x921d,0x01,0x351d,0x0135,0x08,0x01,0x00,0x00,0x00,0x24},
{0x57,0xb21d,0x13,0x3524,0x0136,0x08,0x03,0x00,0x00,0x00,0x25}, /* 400x300 */
{0x58,0x921d,0x24,0x352b,0x0137,0x08,0x04,0x00,0x00,0x00,0x26},
{0x59,0x921b,0x00,0x3516,0x0138,0x08,0x00,0x00,0x00,0x00,0x23},
{0x5c,0x921f,0x24,0x352b,0x0000,0x08,0x04,0x00,0x00,0x00,0x26}, /* TW: inserted 512x384x32 */
{0x5d,0x021d,0x35,0x3532,0x0139,0x08,0x05,0x00,0x00,0x00,0x10}, /* 37bc */
{0x62,0x0a3f,0x36,0x3539,0x013a,0x08,0x06,0x00,0x00,0x00,0x08}, /* 37c3 */
{0x63,0x2a3f,0x47,0x3563,0x013b,0x08,0x07,0x00,0x00,0x00,0x00}, /* 37ed */
{0x64,0x0a7f,0x58,0x358d,0x013c,0x08,0x08,0x00,0x00,0x00,0x13}, /* 3817 */
{0x65,0x0eff,0x69,0x35be,0x013d,0x08,0x09,0x00,0x00,0x00,0x1a}, /* 3848 */
{0x66,0x06ff,0x7a,0x35d4,0x013e,0x08,0x0a,0x00,0x00,0x00,0x1e}, /* 385e */
{0x68,0x067b,0x8b,0x35ef,0x013f,0x08,0x0b,0x00,0x00,0x00,0x27}, /* 3879 */
{0x69,0x06fd,0x8b,0x35ef,0x0140,0x08,0x0b,0x00,0x00,0x00,0x27}, /* 3879 */
{0x6b,0x07ff,0x8b,0x35ef,0x0000,0x10,0x0b,0x00,0x00,0x00,0x27}, /* 3879 */
{0x6c,0x067b,0x9c,0x35f6,0x0000,0x08,0x0c,0x00,0x00,0x00,0x28}, /* 3880 */
{0x6d,0x06fd,0x9c,0x35f6,0x0000,0x10,0x0c,0x00,0x00,0x00,0x28}, /* 3880 */
{0x6e,0x0e3b,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29}, /* 383c */ /* 1280x960x8 */
{0x6f,0x0e7d,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29}, /* 383c */ /* 1280x960x16 */
{0x7b,0x0eff,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29}, /* 383c */ /* 1280x960x32 */
{0x20,0x0a1b,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b}, /* 1024x600 */
{0x5d,0x021d,0x35,0x3532,0x0139,0x08,0x05,0x00,0x00,0x00,0x10}, /* 640x400x16 */
{0x5e,0x021f,0x35,0x3532,0x0000,0x08,0x05,0x00,0x00,0x00,0x10}, /* TW: inserted 640x400x32 */
{0x62,0x0a3f,0x36,0x3539,0x013a,0x08,0x06,0x00,0x00,0x00,0x08},
{0x63,0x2a3f,0x47,0x3563,0x013b,0x08,0x07,0x00,0x00,0x00,0x00}, /* 800x600 */
{0x64,0x0a7f,0x58,0x358d,0x013c,0x08,0x08,0x00,0x00,0x00,0x13},
{0x65,0x0eff,0x69,0x35be,0x013d,0x08,0x09,0x00,0x00,0x00,0x1a},
{0x66,0x06ff,0x7a,0x35d4,0x013e,0x08,0x0a,0x00,0x00,0x00,0x1e},
{0x68,0x067b,0x8b,0x35ef,0x013f,0x08,0x0b,0x00,0x00,0x00,0x27},
{0x69,0x06fd,0x8b,0x35ef,0x0140,0x08,0x0b,0x00,0x00,0x00,0x27},
{0x6b,0x07ff,0x8b,0x35ef,0x0000,0x10,0x0b,0x00,0x00,0x00,0x27},
{0x6c,0x067b,0x9c,0x35f6,0x0000,0x08,0x11,0x00,0x00,0x00,0x28}, /* TW: 2048x1536x8 - not in BIOS! */
{0x6d,0x06fd,0x9c,0x35f6,0x0000,0x10,0x11,0x00,0x00,0x00,0x28}, /* TW: 2048x1536x16 - not in BIOS! */
{0x6e,0x0a3b,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29}, /* 1280x960x8 */
{0x6f,0x0a7d,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29}, /* 1280x960x16 */
/* TW: 16:9 modes copied from 310/325 series - not in ANY BIOS */
{0x70,0x2a1b,0x40,0x3b52,0x0000,0x08,0x12,0x00,0x00,0x07,0x2d}, /* 800x480x8 */
{0x71,0x0a1b,0x51,0x3b63,0x0000,0x08,0x13,0x00,0x00,0x00,0x30}, /* 1024x576x8 */
{0x74,0x0a1d,0x51,0x3b63,0x0000,0x08,0x13,0x00,0x00,0x00,0x30}, /* 1024x576x16 */
{0x75,0x0e3d,0x62,0x3b74,0x0000,0x08,0x14,0x00,0x00,0x00,0x33}, /* 1280x720x16 */
{0x76,0x2a1f,0x40,0x3b52,0x0000,0x08,0x12,0x00,0x00,0x07,0x2d}, /* 800x480x32 */
{0x77,0x0a3f,0x51,0x3b63,0x0000,0x08,0x13,0x00,0x00,0x00,0x30}, /* 1024x576x32 */
{0x78,0x0eff,0x62,0x3b74,0x0000,0x08,0x14,0x00,0x00,0x00,0x33}, /* 1280x720x32 */
{0x79,0x0e3b,0x62,0x3b74,0x0000,0x08,0x14,0x00,0x00,0x00,0x33}, /* 1280x720x8 */
{0x7a,0x2a1d,0x40,0x3b52,0x0000,0x08,0x12,0x00,0x00,0x07,0x2d}, /* 800x480x16 */
/* TW: End of new 16:9 modes */
{0x7b,0x0aff,0x6f,0x35b2,0x0000,0x08,0x0e,0x00,0x00,0x00,0x29}, /* 1280x960x32 */
{0x20,0x0a1b,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b}, /* 1024x600 */
{0x21,0x0a3d,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},
{0x22,0x0a7f,0x54,0x0000,0x0000,0x08,0x0f,0x00,0x00,0x00,0x2b},
{0x23,0x0a1b,0xc5,0x0000,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c}, /* 1152x768 */
{0x23,0x0a1b,0xc5,0x0000,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c}, /* 1152x768 */
{0x24,0x0a3d,0xc5,0x431d,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},
{0x25,0x0a7f,0xc5,0x431d,0x0000,0x08,0x10,0x00,0x00,0x00,0x2c},
{0x29,0x0e1b,0xc5,0x0000,0x0000,0x08,0x15,0x00,0x00,0x00,0x36}, /* TW: NEW 1152x864 - not in BIOS */
{0x2a,0x0e3d,0xc5,0x0000,0x0000,0x08,0x15,0x00,0x00,0x00,0x36},
{0x2b,0x0e7f,0xc5,0x0000,0x0000,0x08,0x15,0x00,0x00,0x00,0x36},
{0x39,0x2a1b,0xd6,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x38}, /* TW: NEW 848x480 - not in BIOS */
{0x3b,0x2a3d,0xd6,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x38},
{0x3e,0x2a7f,0xd6,0x0000,0x0000,0x08,0x16,0x00,0x00,0x00,0x38},
{0x3f,0x2a1b,0xd7,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x3a}, /* TW: NEW 856x480 - not in BIOS */
{0x42,0x2a3d,0xd7,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x3a},
{0x45,0x2a7f,0xd7,0x0000,0x0000,0x08,0x17,0x00,0x00,0x00,0x3a},
{0x48,0x223b,0xe8,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x3c}, /* TW: NEW 1360x768 - not in BIOS */
{0x4b,0x227d,0xe8,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x3c},
{0x4e,0x22ff,0xe8,0x0000,0x0000,0x08,0x18,0x00,0x00,0x00,0x3c},
{0xff,0x0000,0x00,0x0000,0xffff,0x00,0x00,0x00,0x00,0x00,0x00}
};
......@@ -486,7 +509,7 @@ typedef struct _SiS300_Ext2Struct
{
USHORT Ext_InfoFlag;
UCHAR Ext_CRT1CRTC; /* TW: Index in SiS300_CRT1Table */
UCHAR Ext_CRTVCLK;
UCHAR Ext_CRTVCLK; /* TW: Index in VCLK array */
UCHAR Ext_CRT2CRTC; /* TW: Index in LCD Paneltype arrays (&3f) */
UCHAR ModeID;
USHORT XRes;
......@@ -494,15 +517,15 @@ typedef struct _SiS300_Ext2Struct
USHORT ROM_OFFSET;
} SiS300_Ext2Struct;
SiS300_Ext2Struct SiS300_RefIndex[]=
static const SiS300_Ext2Struct SiS300_RefIndex[] =
{ /* TW: Don't ever insert anything here, table is indexed */
{0x085f,0x0d,0x03,0x05,0x6a, 800, 600,0x3563}, /* 00 */
{0x0467,0x0e,0x44,0x05,0x6a, 800, 600,0x3568}, /* 01 */
{0x0067,0x4f,0x07,0x48,0x6a, 800, 600,0x356d}, /* 02 */
{0x0067,0x0f,0x07,0x48,0x6a, 800, 600,0x356d}, /* 02 - CRT1CRTC was 0x4f */
{0x0067,0x10,0x06,0x8b,0x6a, 800, 600,0x3572}, /* 03 */
{0x0147,0x11,0x08,0x00,0x6a, 800, 600,0x3577}, /* 04 */
{0x0147,0x12,0x0c,0x00,0x6a, 800, 600,0x357c}, /* 05 */
{0x0047,0x51,0x4e,0x00,0x6a, 800, 600,0x3581}, /* 06 */
{0x0047,0x11,0x4e,0x00,0x6a, 800, 600,0x3581}, /* 06 - CRT1CRTC was 0x51 */
{0x0047,0x11,0x13,0x00,0x6a, 800, 600,0x3586}, /* 07 */
{0xc85f,0x05,0x00,0x04,0x2e, 640, 480,0x3539}, /* 08 */
{0xc067,0x06,0x02,0x04,0x2e, 640, 480,0x353e}, /* 09 */
......@@ -517,30 +540,46 @@ SiS300_Ext2Struct SiS300_RefIndex[]=
{0x000f,0x32,0x03,0x06,0x32, 720, 576,0x3637}, /* 12 */
{0x0187,0x15,0x05,0x00,0x37,1024, 768,0x358d}, /* 13 */
{0xc877,0x16,0x09,0x06,0x37,1024, 768,0x3592}, /* 14 */
{0xc067,0x97,0x0b,0x49,0x37,1024, 768,0x3597}, /* 15 */
{0xc067,0x17,0x0b,0x49,0x37,1024, 768,0x3597}, /* 15 - CRT1CRTC was 0x97 */
{0x0267,0x18,0x0d,0x00,0x37,1024, 768,0x359c}, /* 16 */
{0x0047,0x59,0x11,0x8c,0x37,1024, 768,0x35a1}, /* 17 */
{0x0047,0x19,0x11,0x8c,0x37,1024, 768,0x35a1}, /* 17 - CRT1CRTC was 0x59 */
{0x0047,0x1a,0x52,0x00,0x37,1024, 768,0x35a6}, /* 18 */
{0x0047,0x5b,0x16,0x00,0x37,1024, 768,0x35ab}, /* 19 */
{0x0387,0x5c,0x4d,0x00,0x3a,1280,1024,0x35be}, /* 1a */
{0x0007,0x1b,0x16,0x00,0x37,1024, 768,0x35ab}, /* 19 - CRT1CRTC was 0x5b */
{0x0387,0x1c,0x4d,0x00,0x3a,1280,1024,0x35be}, /* 1a - CRT1CRTC was 0x5c */
{0x0077,0x1d,0x14,0x07,0x3a,1280,1024,0x35c3}, /* 1b */
{0x0047,0x1e,0x17,0x00,0x3a,1280,1024,0x35c8}, /* 1c */
{0x0007,0x1f,0x98,0x00,0x3a,1280,1024,0x35cd}, /* 1d */
{0x0007,0x60,0x59,0x00,0x3c,1600,1200,0x35d4}, /* 1e */
{0x0007,0x20,0x59,0x00,0x3c,1600,1200,0x35d4}, /* 1e - CRT1CRTC was 0x60 */
{0x0007,0x21,0x5a,0x00,0x3c,1600,1200,0x35d9}, /* 1f */
{0x0007,0x22,0x1b,0x00,0x3c,1600,1200,0x35de}, /* 20 */
{0x0007,0x63,0x1d,0x00,0x3c,1600,1200,0x35e3}, /* 21 */
{0x0007,0x23,0x1d,0x00,0x3c,1600,1200,0x35e3}, /* 21 - CRT1CRTC was 0x63 */
{0x0007,0x24,0x1e,0x00,0x3c,1600,1200,0x35e8}, /* 22 */
{0x407f,0x00,0x00,0x00,0x40, 320, 200,0x3516}, /* 23 */
{0xc07f,0x01,0x00,0x04,0x50, 320, 240,0x351d}, /* 24 */
{0x0077,0x02,0x04,0x05,0x51, 400, 300,0x3524}, /* 25 */
{0xc077,0x03,0x09,0x06,0x52, 512, 384,0x352b}, /* 26 */
{0xc877,0x03,0x09,0x06,0x52, 512, 384,0x352b}, /* 26 */ /* was c077 */
{0x8207,0x25,0x1f,0x00,0x68,1920,1440,0x35ef}, /* 27 */
{0x0007,0x26,0x20,0x00,0x6c, 720, 480,0x35f6}, /* 28 */
{0x0027,0x27,0x14,0x08,0x6e,1280, 960,0x35b2}, /* 29 */
{0x0027,0x27,0x14,0x08,0x6e,1280, 960,0x35b7}, /* 2a */
{0x0007,0x26,0x20,0x00,0x6c,2048,1536,0x35f6}, /* 28 */
{0x0067,0x27,0x14,0x08,0x6e,1280, 960,0x35b7}, /* 29 - TW: 1280x960-60 */
{0x0027,0x45,0x3c,0x08,0x6e,1280, 960,0x35b7}, /* 2a - TW: 1280x960-85 */
{0xc077,0x33,0x09,0x06,0x20,1024, 600,0x0000}, /* 2b */
{0xc077,0x34,0x09,0x06,0x23,1152, 768,0x0000}, /* 2c */
{0xc077,0x34,0x0b,0x06,0x23,1152, 768,0x0000}, /* 2c */ /* VCLK 0x09 */
{0x0057,0x35,0x27,0x08,0x70, 800, 480,0x3b52}, /* 2d - TW: 16:9 modes */
{0x0047,0x36,0x37,0x08,0x70, 800, 480,0x3b57}, /* 2e */
{0x0047,0x37,0x08,0x08,0x70, 800, 480,0x3b5c}, /* 2f */
{0x0057,0x38,0x09,0x09,0x71,1024, 576,0x3b63}, /* 30 */
{0x0047,0x39,0x38,0x09,0x71,1024, 576,0x3b68}, /* 31 */
{0x0047,0x3a,0x11,0x09,0x71,1024, 576,0x3b6d}, /* 32 */
{0x0057,0x3b,0x39,0x0a,0x75,1280, 720,0x3b74}, /* 33 */
{0x0047,0x3c,0x3a,0x0a,0x75,1280, 720,0x3b79}, /* 34 */
{0x0007,0x3d,0x3b,0x0a,0x75,1280, 720,0x3b7e}, /* 35 - TW: END of 16:9 modes */
{0x0047,0x3e,0x34,0x06,0x29,1152, 864,0x0000}, /* 36 TW: 1152x864-75Hz - Non-BIOS, new */
{0x0047,0x44,0x3a,0x06,0x29,1152, 864,0x0000}, /* 37 TW: 1152x864-85Hz - Non-BIOS, new */
{0x00c7,0x3f,0x28,0x00,0x39, 848, 480,0x0000}, /* 38 TW: 848x480-38Hzi - Non-BIOS, new */
{0xc047,0x40,0x3d,0x00,0x39, 848, 480,0x0000}, /* 39 TW: 848x480-60Hz - Non-BIOS, new */
{0x00c7,0x41,0x28,0x00,0x3f, 856, 480,0x0000}, /* 3a TW: 856x480-38Hzi - Non-BIOS, new */
{0xc047,0x42,0x28,0x00,0x3f, 856, 480,0x0000}, /* 3b TW: 856x480-60Hz - Non-BIOS, new */
{0x0047,0x43,0x3e,0x00,0x48,1360, 768,0x0000}, /* 3c TW: 1360x768-60Hz - Non-BIOS, new */
{0xffff,0,0,0,0,0,0,0}
};
......@@ -557,9 +596,9 @@ typedef struct _SiS_VBModeIDTableStruct
UCHAR _VB_LCDVIndex;
}SiS_VBModeIDTableStruct;
SiS_VBModeIDTableStruct SiS300_VBModeIDTable[]=
static const SiS_VBModeIDTableStruct SiS300_VBModeIDTable[] =
{
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, /* TW: Identical to 630/301B BIOS */
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
{0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01},
{0x01,0x00,0x00,0x00,0x01,0x00,0x01,0x02},
{0x03,0x00,0x00,0x00,0x02,0x00,0x02,0x00},
......@@ -619,7 +658,7 @@ typedef struct _SiS300_CRT1TableStruct
UCHAR CR[17];
} SiS300_CRT1TableStruct;
SiS300_CRT1TableStruct SiS300_CRT1Table[]=
static const SiS300_CRT1TableStruct SiS300_CRT1Table[] =
{
{{0x2d,0x27,0x28,0x90,0x2c,0x80,0xbf,0x1f, /* 0x00 */
0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x00,
......@@ -636,29 +675,49 @@ SiS300_CRT1TableStruct SiS300_CRT1Table[]=
{{0x5f,0x4f,0x50,0x82,0x55,0x81,0xbf,0x1f,
0x9c,0x8e,0x8f,0x96,0xb9,0x30,0x00,0x05,
0x00}},
{{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e,
#if 0
{{0x5f,0x4f,0x50,0x82,0x55,0x81,0x0b,0x3e, /* 0x05 */
0xe9,0x8b,0xdf,0xe7,0x04,0x00,0x00,0x05,
0x00}},
{{0x63,0x4f,0x50,0x86,0x56,0x9b,0x06,0x3e,
#endif
{{0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e, /* 0x05 - corrected 640x480-60 */
0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05,
0x00}},
#if 0
{{0x63,0x4f,0x50,0x86,0x56,0x9b,0x06,0x3e, /* 0x06 */
0xe8,0x8b,0xdf,0xe7,0xff,0x10,0x00,0x01,
0x00}},
#endif
{{0x63,0x4f,0x4f,0x87,0x56,0x9b,0x06,0x3e, /* 0x06 - corrected 640x480-72 */
0xe8,0x8a,0xdf,0xe7,0x07,0x00,0x00,0x01,
0x00}},
{{0x64,0x4f,0x4f,0x88,0x55,0x9d,0xf2,0x1f,
0xe0,0x83,0xdf,0xdf,0xf3,0x10,0x00,0x01,
0x00}},
{{0x63,0x4f,0x4f,0x87,0x5a,0x81,0xfb,0x1f,
0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x05,
0x00}},
{{0x66,0x4f,0x4f,0x86,0x56,0x9e,0x03,0x3e,
#if 0
{{0x66,0x4f,0x4f,0x86,0x56,0x9e,0x03,0x3e, /* 0x09 */
0xe4,0x87,0xdf,0xdf,0x04,0x00,0x00,0x01,
0x00}},
#endif
{{0x67,0x4f,0x4f,0x8b,0x57,0x83,0x10,0x3e, /* 0x09 - corrected 640x480-100 */
0xe7,0x8d,0xdf,0xe6,0x11,0x00,0x00,0x05,
0x00}},
#if 0
{{0x6c,0x4f,0x4f,0x83,0x59,0x9e,0x00,0x3e, /* 0x0a */
0xe5,0x8d,0xdf,0xdf,0x01,0x00,0x00,0x01,
0x00}},
#endif
{{0x67,0x4f,0x4f,0x8b,0x57,0x83,0x10,0x3e, /* 0x0a - corrected 640x480-120 */
0xe7,0x8d,0xdf,0xe6,0x11,0x00,0x00,0x05,
0x00}},
{{0x63,0x4f,0x4f,0x87,0x56,0x9d,0xfb,0x1f,
0xe0,0x83,0xdf,0xdf,0xfc,0x10,0x00,0x01,
0x00}},
{{0x65,0x4f,0x4f,0x89,0x57,0x9f,0xfb,0x1f,
0xe6,0x8a,0xe5,0xe5,0xfc,0x00,0x00,0x01,
0xe6,0x8a,0xdf,0xdf,0xfc,0x10,0x00,0x01, /* TW: Corrected VDE, VBE */
0x00}},
{{0x7b,0x63,0x63,0x9f,0x6a,0x93,0x6f,0xf0,
0x58,0x8a,0x57,0x57,0x70,0x20,0x00,0x05,
......@@ -699,7 +758,7 @@ SiS300_CRT1TableStruct SiS300_CRT1Table[]=
{{0xa7,0x7f,0x7f,0x8b,0x89,0x95,0x26,0xf5,
0x00,0x83,0xff,0xff,0x27,0x10,0x00,0x02,
0x01}},
{{0x9f,0x7f,0x7f,0x83,0x83,0x93,0x1e,0xf5,
{{0x9f,0x7f,0x7f,0x83,0x83,0x93,0x1e,0xf5, /* 0x1a */
0x00,0x84,0xff,0xff,0x1f,0x10,0x00,0x02,
0x01}},
{{0xa2,0x7f,0x7f,0x86,0x84,0x94,0x37,0xf5,
......@@ -738,9 +797,14 @@ SiS300_CRT1TableStruct SiS300_CRT1Table[]=
{{0x55,0xff,0xff,0x99,0x0d,0x0c,0x3e,0xba,
0x00,0x84,0xff,0xff,0x3f,0x0f,0x41,0x05,
0x00}},
{{0xdc,0x9f,0x9f,0x00,0xab,0x19,0xe6,0xef,
#if 0
{{0xdc,0x9f,0x9f,0x00,0xab,0x19,0xe6,0xef, /* 0x27: 1280x960-70 - invalid! */
0xc0,0xc3,0xbf,0xbf,0xe7,0x10,0x00,0x07,
0x01}},
#endif
{{0xdc,0x9f,0x9f,0x80,0xaf,0x9d,0xe6,0xff, /* 0x27: 1280x960-60 - correct */
0xc0,0x83,0xbf,0xbf,0xe7,0x10,0x00,0x07,
0x01}},
{{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba, /* 0x28 */
0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06,
0x01}},
......@@ -777,9 +841,70 @@ SiS300_CRT1TableStruct SiS300_CRT1Table[]=
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x1e,0xf1, /* 0x33 - 1024x600 */
0xae,0x85,0x57,0x57,0x1f,0x30,0x00,0x02,
0x01}},
#if 0
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf5, /* 0x34 - 1152x768 */
0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
0x01}}
0x01}},
#endif
{{0xa3,0x8f,0x8f,0x97,0x96,0x97,0x24,0xf5, /* 0x34 - 1152x768 - TW: corrected */
0x02,0x88,0xff,0xff,0x25,0x10,0x00,0x02,
0x01}},
{{0x7f,0x63,0x63,0x83,0x6c,0x1c,0x72,0xba, /* 0x35 - NEW 16:9 modes, not in BIOS ------ */
0x27,0x8b,0xdf,0xdf,0x73,0x00,0x00,0x06,
0x01}}, /* 0x35 */
{{0x7f,0x63,0x63,0x83,0x69,0x13,0x6f,0xba,
0x26,0x89,0xdf,0xdf,0x6f,0x00,0x00,0x06,
0x01}}, /* 0x36 */
{{0x7f,0x63,0x63,0x82,0x6b,0x13,0x75,0xba,
0x29,0x8c,0xdf,0xdf,0x75,0x00,0x00,0x06,
0x01}}, /* 0x37 */
{{0xa3,0x7f,0x7f,0x87,0x86,0x97,0x24,0xf1,
0xaf,0x85,0x3f,0x3f,0x25,0x30,0x00,0x02,
0x01}}, /* 0x38 */
{{0x9f,0x7f,0x7f,0x83,0x85,0x91,0x1e,0xf1,
0xad,0x81,0x3f,0x3f,0x1f,0x30,0x00,0x02,
0x01}}, /* 0x39 */
{{0xa7,0x7f,0x7f,0x88,0x89,0x95,0x26,0xf1, /* TW: 95 was 15 - illegal HBE! */
0xb1,0x85,0x3f,0x3f,0x27,0x30,0x00,0x02,
0x01}}, /* 0x3a */
{{0xce,0x9f,0x9f,0x92,0xa9,0x17,0x28,0xc4,
0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07,
0x01}}, /* 0x3b */
{{0xce,0x9f,0x9f,0x92,0xa5,0x17,0x28,0xd4,
0x7a,0x8e,0xcf,0xcf,0x29,0x21,0x00,0x07,
0x01}}, /* 0x3c */
{{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0x2e,0xd4,
0x7d,0x81,0xcf,0xcf,0x2f,0x21,0x00,0x07,
0x01}}, /* 0x3d */ /* TW: End of 16:9 modes --------------- */
{{0xc3,0x8f,0x8f,0x87,0x9b,0x0b,0x82,0xef, /* TW: New, 1152x864-75 (not in any BIOS) */
0x60,0x83,0x5f,0x5f,0x83,0x10,0x00,0x07,
0x01}}, /* 0x3e */
{{0x86,0x69,0x69,0x8A,0x74,0x06,0x8C,0x15, /* TW: New, 848x480-38i, not in BIOS */
0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
0x00}}, /* 0x3f */
#if 0
{{0x81,0x69,0x69,0x85,0x70,0x00,0x0F,0x3E, /* TW: New, 848x480-60, not in BIOS - incorrect for Philips panel */
0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
0x00}}, /* 0x40 */
#endif
{{0x83,0x69,0x69,0x87,0x6f,0x1d,0x03,0x3E, /* TW: New, 848x480-60, not in BIOS */
0xE5,0x8d,0xDF,0xe4,0x04,0x00,0x00,0x06,
0x00}}, /* 0x40 */
{{0x86,0x6A,0x6A,0x8A,0x74,0x06,0x8C,0x15, /* TW: New, 856x480-38i, not in BIOS */
0x4F,0x83,0xEF,0xEF,0x8D,0x30,0x00,0x02,
0x00}}, /* 0x41 */
{{0x81,0x6A,0x6A,0x85,0x70,0x00,0x0F,0x3E, /* TW: New, 856x480-60, not in BIOS */
0xEB,0x8E,0xDF,0xDF,0x10,0x00,0x00,0x02,
0x00}}, /* 0x42 */
{{0xdd,0xa9,0xa9,0x81,0xb4,0x97,0x26,0xfd, /* TW: New, 1360x768-60, not in BIOS */
0x01,0x8d,0xff,0x00,0x27,0x10,0x00,0x03,
0x01}}, /* 0x43 */
{{0xd9,0x8f,0x8f,0x9d,0xba,0x0a,0x8a,0xff, /* TW: New, 1152x864-84 (not in any BIOS) */
0x60,0x8b,0x5f,0x5f,0x8b,0x10,0x00,0x03,
0x01}}, /* 0x44 */
{{0xd3,0x9f,0x9f,0x97,0xab,0x1f,0xf1,0xff, /* TW: New, 1280x960-85 (not in any BIOS) */
0xc0,0x83,0xbf,0xbf,0xf2,0x10,0x00,0x07,
0x01}} /* 0x45 */
};
typedef struct _SiS300_MCLKDataStruct
......@@ -788,7 +913,7 @@ typedef struct _SiS300_MCLKDataStruct
USHORT CLOCK;
} SiS300_MCLKDataStruct;
SiS300_MCLKDataStruct SiS300_MCLKData[]=
static const SiS300_MCLKDataStruct SiS300_MCLKData_630[] = /* 630 */
{ /* TW: at 0x54 in BIOS */
{ 0x5a,0x64,0x80, 66},
{ 0xb3,0x45,0x80, 83},
......@@ -800,13 +925,25 @@ SiS300_MCLKDataStruct SiS300_MCLKData[]=
{ 0x37,0x61,0x80,100}
};
static const SiS300_MCLKDataStruct SiS300_MCLKData_300[] = /* 300 */
{ /* TW: at 0x54 in BIOS */
{ 0x68,0x43,0x80,125},
{ 0x68,0x43,0x80,125},
{ 0x68,0x43,0x80,125},
{ 0x37,0x61,0x80,100},
{ 0x37,0x61,0x80,100},
{ 0x37,0x61,0x80,100},
{ 0x37,0x61,0x80,100},
{ 0x37,0x61,0x80,100}
};
typedef struct _SiS300_ECLKDataStruct
{
UCHAR SR2E,SR2F,SR30;
USHORT CLOCK;
} SiS300_ECLKDataStruct;
SiS300_ECLKDataStruct SiS300_ECLKData[]=
static const SiS300_ECLKDataStruct SiS300_ECLKData[] =
{
{ 0x54,0x43,0x80,100},
{ 0x53,0x43,0x80,100},
......@@ -824,68 +961,79 @@ typedef struct _SiS300_VCLKDataStruct
USHORT CLOCK;
} SiS300_VCLKDataStruct;
SiS300_VCLKDataStruct SiS300_VCLKData[]=
static const SiS300_VCLKDataStruct SiS300_VCLKData[] =
{
{ 0x1b,0xe1, 25},
{ 0x1b,0xe1, 25}, /* 0x00 */
{ 0x4e,0xe4, 28},
{ 0x57,0xe4, 32},
{ 0x57,0xe4, 32}, /* 0x02 */
{ 0xc3,0xc8, 36},
{ 0x42,0xc3, 40},
{ 0x42,0xc3, 40}, /* 0x04 */
{ 0x5d,0xc4, 45},
{ 0x52,0x65, 50},
{ 0x52,0x65, 50}, /* 0x06 */
{ 0x53,0x65, 50},
{ 0x6d,0x66, 56},
{ 0x6d,0x66, 56}, /* 0x08 */
{ 0x5a,0x64, 65},
{ 0x46,0x44, 68},
{ 0x46,0x44, 68}, /* 0x0a */
{ 0x3e,0x43, 75},
{ 0x6d,0x46, 76}, /* 0x0c: 800x600 | LVDS_2(CH), MITAC(CH); - LVDS2(CH), A901(301B): 0xb1,0x46, 76 */
{ 0x6d,0x46, 76}, /* 0x0c: 800x600 | LVDS_2(CH), MITAC(CH); - 730, A901(301B): 0xb1,0x46, 76 */
{ 0x41,0x43, 79},
{ 0x31,0x42, 79},
{ 0x31,0x42, 79}, /* 0x0e */
{ 0x46,0x25, 85},
{ 0x78,0x29, 87}, /* 0x10 */
{ 0x62,0x44, 95},
{ 0x2b,0x22,105},
{ 0x2b,0x22,105}, /* 0x12 */
{ 0x49,0x24,106},
{ 0xc3,0x28,108},
{ 0xc3,0x28,108}, /* 0x14 */
{ 0x3c,0x23,109},
{ 0xf7,0x2c,132},
{ 0xf7,0x2c,132}, /* 0x16 */
{ 0xd4,0x28,136},
{ 0x41,0x05,158},
{ 0x41,0x05,158}, /* 0x18 */
{ 0x43,0x05,162},
{ 0xe1,0x0f,175},
{ 0xfc,0x12,189},
{ 0xde,0x26,194},
{ 0xe1,0x0f,175}, /* 0x1a */
{ 0xfc,0x12,189}, /* 0x1b */
{ 0xde,0x26,194}, /* 0x1c */
{ 0x54,0x05,203},
{ 0x3f,0x03,230},
{ 0x3f,0x03,230}, /* 0x1e */
{ 0x30,0x02,234},
{ 0x24,0x01,266}, /* 0x20 */
{ 0x52,0x2a, 54}, /* 301 TV */
{ 0x52,0x6a, 27}, /* 301 TV */
{ 0x62,0x24, 70}, /* 301 TV */
{ 0x62,0x64, 70}, /* 301 TV */
{ 0xa8,0x4c, 30}, /* 301 TV */
{ 0x20,0x26, 33}, /* 301 TV */
{ 0x24,0x01,266}, /* 0x20 */
{ 0x52,0x2a, 54}, /* 301 TV */
{ 0x52,0x6a, 27}, /* 301 TV */
{ 0x62,0x24, 70}, /* 301 TV */
{ 0x62,0x64, 70}, /* 301 TV */
{ 0xa8,0x4c, 30}, /* 301 TV */
{ 0x20,0x26, 33}, /* 301 TV */
{ 0x31,0xc2, 39},
{ 0xbf,0xc8, 35}, /* 0x28 */
{ 0x60,0x36, 30}, /* 0x29 CH/UNTSC TEXT | LVDS_2(CH) - LVDS2(CH), A901(301B), Mitac(CH): 0xe0, 0xb6, 30 */
{ 0xbf,0xc8, 35}, /* 0x28 - 856x480 */
{ 0x60,0x36, 30}, /* 0x29 CH/UNTSC TEXT | LVDS_2(CH) - 730, A901(301B), Mitac(CH): 0xe0, 0xb6, 30 */
{ 0x40,0x4a, 28},
{ 0x9f,0x46, 44},
{ 0x97,0x2c, 26},
{ 0x44,0xe4, 25},
{ 0x7e,0x32, 47},
{ 0x8a,0x24, 31}, /* 0x2f CH/PAL TEXT | LVDS_2(CH), Mitac(CH) - LVDS2(CH), A901(301B): 0x57, 0xe4, 31 */
{ 0x8a,0x24, 31}, /* 0x2f CH/PAL TEXT | LVDS_2(CH), Mitac(CH) - 730, A901(301B): 0x57, 0xe4, 31 */
{ 0x97,0x2c, 26},
{ 0xce,0x3c, 39},
{ 0x52,0x4a, 36},
{ 0x52,0x4a, 36}, /* 0x32 CH/PAL 800x600 5/6 */
{ 0x34,0x61, 95},
{ 0x78,0x27,108},
{ 0xce,0x25,189},
{ 0x45,0x6b, 21}, /* 0x36 */ /* TW: Added from Mitac */
{ 0xff,0x00, 0}
{ 0xce,0x25,189}, /* 0x35 */
{ 0x45,0x6b, 21}, /* 0x36 */ /* TW: Added from Mitac */
{ 0x52,0xe2, 49}, /* 0x37 - added for 16:9 modes (not in any BIOS) */
{ 0x2b,0x61, 78}, /* 0x38 - added for 16:9 modes (not in any BIOS) */
{ 0x70,0x44,108}, /* 0x39 - added for 16:9 modes (not in any BIOS) */
{ 0x54,0x42,135}, /* 0x3a - added for 16:9 modes (not in any BIOS) */
{ 0x41,0x22,157}, /* 0x3b - added for 16:9 modes (not in any BIOS) */
{ 0x52,0x07,149}, /* 0x3c - added for 1280x960-85 (not in any BIOS)*/
{ 0x62,0xc6, 34}, /* 0x3d - added for 848x480-60 (not in any BIOS) */
{ 0x30,0x23, 88}, /* 0x3e - added for 1360x768-60 (not in any BIOS)*/
{ 0x3f,0x64, 46}, /* 0x3f - added for 640x480-100 (not in any BIOS)*/
{ 0x72,0x2a, 76}, /* 0x40 - test for SiS730 */
{ 0x15,0x21, 79}, /* 0x41 - test for SiS730 */
{ 0xff,0x00, 0}
};
#if 0 /* TW: This table is in all BIOSes, but not used */
SiS300_VCLKDataStruct SiS300_VBVCLKData[]=
static const SiS300_VCLKDataStruct SiS300_VBVCLKData[] =
{
{ 0x1b,0xe1, 25},
{ 0x4e,0xe4, 28},
......@@ -938,10 +1086,11 @@ SiS300_VCLKDataStruct SiS300_VBVCLKData[]=
};
#endif
UCHAR SiS300_ScreenOffset[] =
static const UCHAR SiS300_ScreenOffset[] =
{
0x14,0x19,0x20,0x28,0x32,0x40,0x50,
0x64,0x78,0x80,0x2d,0x35,0x48,0xff
0x64,0x78,0x80,0x2d,0x35,0x48,0x35, /* 0x35 for 848 and 856 */
0x55,0xff /* 0x55 for 1360 */
};
typedef struct _SiS300_StResInfoStruct
......@@ -950,7 +1099,7 @@ typedef struct _SiS300_StResInfoStruct
USHORT VTotal;
} SiS300_StResInfoStruct;
SiS300_StResInfoStruct SiS300_StResInfo[] =
static const SiS300_StResInfoStruct SiS300_StResInfo[] =
{
{ 640,400},
{ 640,350},
......@@ -967,7 +1116,7 @@ typedef struct _SiS300_ModeResInfoStruct
UCHAR YChar;
} SiS300_ModeResInfoStruct;
SiS300_ModeResInfoStruct SiS300_ModeResInfo[] =
static const SiS300_ModeResInfoStruct SiS300_ModeResInfo[] =
{
{ 320, 200, 8, 8}, /* 0x00 */
{ 320, 240, 8, 8}, /* 0x01 */
......@@ -985,62 +1134,81 @@ SiS300_ModeResInfoStruct SiS300_ModeResInfo[] =
{ 720, 576, 8,16}, /* 0x0d */
{ 1280, 960, 8,16}, /* 0x0e */
{ 1024, 600, 8,16}, /* 0x0f */
{ 1152, 768, 8,16} /* 0x10 */
};
UCHAR SiS300_OutputSelect =0x40;
UCHAR SiS300_SoftSetting = 30;
UCHAR SiS300_SR07=0x10;
UCHAR SiS300_SR15[8][4] =
{
{0x1,0x9,0xa3,0x0},
{0x43,0x43,0x43,0x0},
{0x1e,0x1e,0x1e,0x0},
{0x2a,0x2a,0x2a,0x0},
{0x6,0x6,0x6,0x0},
{0x0,0x0,0x0,0x0},
{0x0,0x0,0x0,0x0},
{0x0,0x0,0x0,0x0}
};
UCHAR SiS300_SR1F=0x0;
UCHAR SiS300_SR21=0x16;
UCHAR SiS300_SR22=0xb2;
UCHAR SiS300_SR23=0xf6;
UCHAR SiS300_SR24=0xd;
UCHAR SiS300_SR25[]={0x0,0x0};
UCHAR SiS300_SR31=0x0;
UCHAR SiS300_SR32=0x11;
UCHAR SiS300_SR33=0x0;
UCHAR SiS300_CRT2Data_1_2 = 0x40;
UCHAR SiS300_CRT2Data_4_D = 0x0;
UCHAR SiS300_CRT2Data_4_E = 0x0;
UCHAR SiS300_CRT2Data_4_10 = 0x80;
USHORT SiS300_RGBSenseData = 0xd1;
USHORT SiS300_VideoSenseData = 0xb3;
USHORT SiS300_YCSenseData = 0xb9;
USHORT SiS300_RGBSenseData2 = 0x0190; /*301b*/
USHORT SiS300_VideoSenseData2 = 0x0174;
USHORT SiS300_YCSenseData2 = 0x016b;
UCHAR SiS300_CR40[5][4];
UCHAR SiS300_CR49[2];
UCHAR SiS300_NTSCPhase[] = {0x21,0xed,0x8a,0x08};
UCHAR SiS300_PALPhase[] = {0x2a,0x05,0xd3,0x00};
UCHAR SiS300_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6}; /* 301b */
UCHAR SiS300_PALPhase2[] = {0x2a,0x09,0x86,0xe9}; /* 301b */
UCHAR SiS300_PALMPhase[] = {0x21,0xE4,0x2E,0x9B}; /* palmn */
UCHAR SiS300_PALNPhase[] = {0x21,0xF4,0x3E,0xBA};
UCHAR SiS300_PALMPhase2[] = {0x21,0xE6,0xEF,0xA4}; /* TW: palm 301b*/
UCHAR SiS300_PALNPhase2[] = {0x21,0xF6,0x94,0x46}; /* TW: paln 301b*/
{ 1152, 768, 8,16}, /* 0x10 */
{ 2048,1536, 8,16}, /* 0x11 - TW: Not in BIOS! */
{ 800, 480, 8,16}, /* 0x12 - TW: New, not in any BIOS */
{ 1024, 576, 8,16}, /* 0x13 - TW: New, not in any BIOS */
{ 1280, 720, 8,16}, /* 0x14 - TW: New, not in any BIOS */
{ 1152, 864, 8,16}, /* 0x15 - TW: New, not in any BIOS */
{ 848, 480, 8,16}, /* 0x16 - TW: New, not in any BIOS */
{ 856, 480, 8,16}, /* 0x17 - TW: New, not in any BIOS */
{ 1360, 768, 8,16} /* 0x18 - TW: New, not in any BIOS */
};
static const UCHAR SiS300_OutputSelect = 0x40;
static const UCHAR SiS300_SoftSetting = 0x30;
#ifndef LINUX_XF86
static UCHAR SiS300_SR07 = 0x10;
#endif
static const UCHAR SiS300_SR15[8][4] =
{
{0x01,0x09,0xa3,0x00},
{0x43,0x43,0x43,0x00},
{0x1e,0x1e,0x1e,0x00},
{0x2a,0x2a,0x2a,0x00},
{0x06,0x06,0x06,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00}
};
#ifndef LINUX_XF86
static UCHAR SiS300_SR1F = 0x00;
static UCHAR SiS300_SR21 = 0x16;
static UCHAR SiS300_SR22 = 0xb2;
static UCHAR SiS300_SR23 = 0xf6;
static UCHAR SiS300_SR24 = 0x0d;
static UCHAR SiS300_SR25[] = {0x0,0x0};
static UCHAR SiS300_SR31 = 0x00;
static UCHAR SiS300_SR32 = 0x11;
static UCHAR SiS300_SR33 = 0x00;
static UCHAR SiS300_CRT2Data_1_2 = 0x40;
static UCHAR SiS300_CRT2Data_4_D = 0x00;
static UCHAR SiS300_CRT2Data_4_E = 0x00;
static UCHAR SiS300_CRT2Data_4_10 = 0x80;
static const USHORT SiS300_RGBSenseData = 0xd1;
static const USHORT SiS300_VideoSenseData = 0xb3;
static const USHORT SiS300_YCSenseData = 0xb9;
static const USHORT SiS300_RGBSenseData2 = 0x0190; /*301b*/
static const USHORT SiS300_VideoSenseData2 = 0x0174;
static const USHORT SiS300_YCSenseData2 = 0x016b;
static const UCHAR SiS300_CR40[5][4];
static UCHAR SiS300_CR49[2];
#endif
static const UCHAR SiS300_NTSCPhase[] = {0x21,0xed,0xba,0x08}; /* TW: Was {0x21,0xed,0x8a,0x08}; */
static const UCHAR SiS300_PALPhase[] = {0x2a,0x05,0xe3,0x00}; /* TW: Was {0x2a,0x05,0xd3,0x00}; */
static const UCHAR SiS300_PALMPhase[] = {0x21,0xE4,0x2E,0x9B}; /* palmn */
static const UCHAR SiS300_PALNPhase[] = {0x21,0xF4,0x3E,0xBA};
static const UCHAR SiS300_NTSCPhase2[] = {0x21,0xF0,0x7B,0xD6}; /* 301b */
static const UCHAR SiS300_PALPhase2[] = {0x2a,0x09,0x86,0xe9}; /* 301b */
static const UCHAR SiS300_PALMPhase2[] = {0x21,0xE6,0xEF,0xA4}; /* TW: palm 301b*/
static const UCHAR SiS300_PALNPhase2[] = {0x21,0xF6,0x94,0x46}; /* TW: paln 301b*/
typedef struct _SiS300_PanelDelayTblStruct
{
UCHAR timer[2];
} SiS300_PanelDelayTblStruct;
SiS300_PanelDelayTblStruct SiS300_PanelDelayTbl[] =
static const SiS300_PanelDelayTblStruct SiS300_PanelDelayTbl[] =
{
{{0x05,0xaa}},
{{0x05,0xaa}}, /* TW: From 2.04.5a */
{{0x05,0x14}},
{{0x05,0x36}},
{{0x05,0x14}},
......@@ -1052,13 +1220,13 @@ SiS300_PanelDelayTblStruct SiS300_PanelDelayTbl[] =
{{0x05,0x14}},
{{0x05,0x14}},
{{0x05,0x14}},
{{0x05,0x64}},
{{0x05,0x14}},
{{0x20,0x80}},
{{0x05,0x14}},
{{0x05,0x14}}
{{0x05,0x40}},
{{0x05,0x60}}
};
SiS300_PanelDelayTblStruct SiS300_PanelDelayTblLVDS[] =
static const SiS300_PanelDelayTblStruct SiS300_PanelDelayTblLVDS[] =
{
{{0x05,0xaa}},
{{0x05,0x14}},
......@@ -1071,7 +1239,7 @@ SiS300_PanelDelayTblStruct SiS300_PanelDelayTblLVDS[] =
{{0x05,0x14}},
{{0x05,0x14}},
{{0x05,0x14}},
{{0x05,0x14}},
{{0x05,0x14}}, /* 2.07a (JVC): 14,96 */
{{0x05,0x28}}, /* 2.04.5c: 20, 80 - Clevo (2.04.2c): 05, 28 */
{{0x05,0x14}},
{{0x05,0x14}}, /* Some BIOSes: 05, 40 */
......@@ -1088,7 +1256,7 @@ typedef struct _SiS300_LCDDataStruct
USHORT LCDVT;
} SiS300_LCDDataStruct;
SiS300_LCDDataStruct SiS300_StLCD1024x768Data[]=
static const SiS300_LCDDataStruct SiS300_StLCD1024x768Data[] =
{
{ 66, 31, 992, 510,1320, 816},
{ 66, 31, 992, 510,1320, 816},
......@@ -1099,7 +1267,7 @@ SiS300_LCDDataStruct SiS300_StLCD1024x768Data[]=
{ 1, 1,1344, 806,1344, 806}
};
SiS300_LCDDataStruct SiS300_ExtLCD1024x768Data[]=
static const SiS300_LCDDataStruct SiS300_ExtLCD1024x768Data[] =
{
{ 12, 5, 896, 512,1344, 806},
{ 12, 5, 896, 510,1344, 806},
......@@ -1116,7 +1284,7 @@ SiS300_LCDDataStruct SiS300_ExtLCD1024x768Data[]=
{ 1, 1,1344, 806,1344, 806}
};
SiS300_LCDDataStruct SiS300_St2LCD1024x768Data[]=
static const SiS300_LCDDataStruct SiS300_St2LCD1024x768Data[] =
{
{ 62, 25, 800, 546,1344, 806},
{ 32, 15, 930, 546,1344, 806},
......@@ -1127,7 +1295,7 @@ SiS300_LCDDataStruct SiS300_St2LCD1024x768Data[]=
{ 1, 1,1344, 806,1344, 806}
};
SiS300_LCDDataStruct SiS300_StLCD1280x1024Data[]=
static const SiS300_LCDDataStruct SiS300_StLCD1280x1024Data[] =
{
{ 4, 1, 880, 510,1650,1088},
{ 4, 1, 880, 510,1650,1088},
......@@ -1139,7 +1307,7 @@ SiS300_LCDDataStruct SiS300_StLCD1280x1024Data[]=
{ 1, 1,1688,1066,1688,1066}
};
SiS300_LCDDataStruct SiS300_ExtLCD1280x1024Data[]=
static const SiS300_LCDDataStruct SiS300_ExtLCD1280x1024Data[] =
{
{ 211, 60,1024, 501,1688,1066},
{ 211, 60,1024, 508,1688,1066},
......@@ -1151,7 +1319,7 @@ SiS300_LCDDataStruct SiS300_ExtLCD1280x1024Data[]=
{ 1, 1,1688,1066,1688,1066}
};
SiS300_LCDDataStruct SiS300_St2LCD1280x1024Data[]=
static const SiS300_LCDDataStruct SiS300_St2LCD1280x1024Data[] =
{
{ 22, 5, 800, 510,1650,1088},
{ 22, 5, 800, 510,1650,1088},
......@@ -1163,7 +1331,7 @@ SiS300_LCDDataStruct SiS300_St2LCD1280x1024Data[]=
{ 1, 1,1688,1066,1688,1066}
};
SiS300_LCDDataStruct SiS300_NoScaleData1024x768[]=
static const SiS300_LCDDataStruct SiS300_NoScaleData1024x768[] =
{
{ 1, 1, 800, 449, 800, 449},
{ 1, 1, 800, 449, 800, 449},
......@@ -1175,7 +1343,7 @@ SiS300_LCDDataStruct SiS300_NoScaleData1024x768[]=
{ 1, 1,1688,1066,1688,1066}
};
SiS300_LCDDataStruct SiS300_NoScaleData1280x1024[]= /* TW: Fake */
static const SiS300_LCDDataStruct SiS300_NoScaleData1280x1024[] = /* TW: Fake */
{
{ 1, 1, 800, 449, 800, 449},
{ 1, 1, 800, 449, 800, 449},
......@@ -1187,7 +1355,7 @@ SiS300_LCDDataStruct SiS300_NoScaleData1280x1024[]= /* TW: Fake */
{ 1, 1,1688,1066,1688,1066}
};
SiS300_LCDDataStruct SiS300_LCD1280x960Data[]=
static const SiS300_LCDDataStruct SiS300_LCD1280x960Data[] =
{
{ 9, 2, 800, 500,1800,1000},
{ 9, 2, 800, 500,1800,1000},
......@@ -1200,6 +1368,91 @@ SiS300_LCDDataStruct SiS300_LCD1280x960Data[]=
{ 1, 1,1800,1000,1800,1000}
};
static const SiS300_LCDDataStruct SiS300_ExtLCD1400x1050Data[] = /* TW: New */
{
{ 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},
{ 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 SiS300_LCDDataStruct SiS300_ExtLCD1600x1200Data[] = /* TW: New */
{
{ 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},
{ 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 SiS300_LCDDataStruct SiS300_StLCD1400x1050Data[] = /* TW: New */
{
{ 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},
{ 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 SiS300_LCDDataStruct SiS300_StLCD1600x1200Data[] = /* TW: New */
{
{ 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},
{ 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 SiS300_LCDDataStruct SiS300_NoScaleData1400x1050[] = /* TW: New */
{
{ 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},
{ 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 SiS300_LCDDataStruct SiS300_NoScaleData1600x1200[] = /* TW: New */
{
{ 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},
{ 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}
};
typedef struct _SiS300_TVDataStruct
{
USHORT RVBHCMAX;
......@@ -1217,7 +1470,7 @@ typedef struct _SiS300_TVDataStruct
UCHAR RY4COE;
} SiS300_TVDataStruct;
SiS300_TVDataStruct SiS300_StPALData[]=
static const SiS300_TVDataStruct SiS300_StPALData[] =
{
{ 1, 1, 864, 525,1270, 400, 100, 0, 760,0xf4,0xff,0x1c,0x22},
{ 1, 1, 864, 525,1270, 350, 100, 0, 760,0xf4,0xff,0x1c,0x22},
......@@ -1227,7 +1480,7 @@ SiS300_TVDataStruct SiS300_StPALData[]=
{ 1, 1, 864, 525,1270, 600, 50, 0, 0,0xf4,0xff,0x1c,0x22}
};
SiS300_TVDataStruct SiS300_ExtPALData[]=
static const SiS300_TVDataStruct SiS300_ExtPALData[] =
{
{ 27, 10, 848, 448,1270, 530, 50, 0, 50,0xf4,0xff,0x1c,0x22},
{ 108, 35, 848, 398,1270, 530, 50, 0, 50,0xf4,0xff,0x1c,0x22},
......@@ -1236,11 +1489,11 @@ SiS300_TVDataStruct SiS300_ExtPALData[]=
{ 9, 4, 848, 528,1270, 530, 0, 0, 50,0xf5,0xfb,0x1b,0x2a},
{ 36, 25,1060, 648,1316, 530, 438, 0, 438,0xeb,0x05,0x25,0x16},
{ 3, 2,1080, 619,1270, 540, 438, 0, 438,0xf3,0x00,0x1d,0x20},
{ 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20} /*301b*/
{ 1, 1,1170, 821,1270, 520, 686, 0, 686,0xF3,0x00,0x1D,0x20}
};
SiS300_TVDataStruct SiS300_StNTSCData[]=
static const SiS300_TVDataStruct SiS300_StNTSCData[] =
{
{ 1, 1, 858, 525,1270, 400, 50, 0, 760,0xf1,0x04,0x1f,0x18},
{ 1, 1, 858, 525,1270, 350, 50, 0, 640,0xf1,0x04,0x1f,0x18},
......@@ -1249,7 +1502,7 @@ SiS300_TVDataStruct SiS300_StNTSCData[]=
{ 1, 1, 858, 525,1270, 480, 0, 0, 760,0xf1,0x04,0x1f,0x18}
};
SiS300_TVDataStruct SiS300_ExtNTSCData[]=
static const SiS300_TVDataStruct SiS300_ExtNTSCData[] =
{
{ 143, 65, 858, 443,1270, 440, 171, 0, 171,0xf1,0x04,0x1f,0x18},
{ 88, 35, 858, 393,1270, 440, 171, 0, 171,0xf1,0x04,0x1f,0x18},
......@@ -1258,59 +1511,152 @@ SiS300_TVDataStruct SiS300_ExtNTSCData[]=
{ 143, 76, 836, 523,1270, 440, 224, 0, 0,0xf1,0x05,0x1f,0x16},
{ 143, 120,1056, 643,1270, 440, 0, 128, 0,0xf4,0x10,0x1c,0x00},
{ 143, 76, 836, 523,1270, 440, 0, 128, 0,0xee,0x0c,0x22,0x08},
{ 65, 64,1056, 791,1270, 480, 638, 0, 0,0xf1,0x04,0x1f,0x18} /*301b*/
{ 65, 64,1056, 791,1270, 480, 638, 0, 0,0xf1,0x04,0x1f,0x18}
};
SiS_TVDataStruct SiS300_St1HiTVData[]=
#if 0
static const SiS310_TVDataStruct SiS300_St1HiTVData[]=
{
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
};
#endif
SiS_TVDataStruct SiS300_St2HiTVData[]=
static const SiS300_TVDataStruct SiS300_St2HiTVData[]=
{
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
{ 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x37c,0x233,0x2b2,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x348,0x1e3,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00},
{ 1, 1, 0x3e8,0x233,0x311,0x2bc, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 5, 2, 0x348,0x233,0x670,0x3c0,0x08d,128, 0, 0x00,0x00,0x00,0x00},
{ 8, 5, 0x41a,0x2ab,0x670,0x3c0,0x17c,128, 0, 0x00,0x00,0x00,0x00}
};
SiS_TVDataStruct SiS300_ExtHiTVData[]=
static const SiS300_TVDataStruct SiS300_ExtHiTVData[]=
{
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
{ 6, 1, 0x348,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x348,0x1e3,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 3, 1, 0x3c0,0x233,0x660,0x3c0, 0, 0, 0, 0x00,0x00,0x00,0x00},
{ 5, 1, 0x348,0x233,0x670,0x3c0,0x166,128, 0, 0x00,0x00,0x00,0x00},
{ 16, 5, 0x41a,0x2ab,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},
{ 25, 12, 0x4ec,0x353,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00},
{ 5, 4, 0x627,0x464,0x670,0x3c0,0x128, 0, 0, 0x00,0x00,0x00,0x00},
{ 4, 1, 0x41a,0x233,0x670,0x3c0,0x143,128, 0, 0x00,0x00,0x00,0x00},
{ 5, 2, 0x578,0x293,0x670,0x3c0,0x032, 0, 0, 0x00,0x00,0x00,0x00},
{ 8, 5, 0x6d6,0x323,0x670,0x3c0,0x128, 0, 0, 0x00,0x00,0x00,0x00}
};
UCHAR SiS300_NTSCTiming[] = {
static const UCHAR SiS300_NTSCTiming[] =
{
0x17,0x1d,0x03,0x09,0x05,0x06,0x0c,0x0c,
0x94,0x49,0x01,0x0a,0x06,0x0d,0x04,0x0a,
0x06,0x14,0x0d,0x04,0x0a,0x00,0x85,0x1b,
0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17,
0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02,
0x0c,0x50,0x00,0x97,0x00,0xda,0x4a,0x17, /* (in 2.06.50) */
/* 0x0c,0x50,0x00,0x99,0x00,0xec,0x4a,0x17, (in 2.04.5a) */
0x7d,0x05,0x4b,0x00,0x00,0xe2,0x00,0x02, /* (in 2.06.50) */
/* 0x88,0x00,0x4b,0x00,0x00,0xe2,0x00,0x02, (in 2.04.5a) */
0x03,0x0a,0x65,0x9d,0x08,0x92,0x8f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x50,
0x00,0x40,0x44,0x00,0xdb,0x02,0x3b,0x00
};
UCHAR SiS300_PALTiming[] = {
static const UCHAR SiS300_PALTiming[] =
{
0x19,0x52,0x35,0x6e,0x04,0x38,0x3d,0x70,
0x94,0x49,0x01,0x12,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0x45,0x2b,
0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17,
0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02,
0x70,0x50,0x00,0x9b,0x00,0xd9,0x5d,0x17, /* (in 2.06.50) */
/* 0x70,0x50,0x00,0x97,0x00,0xd7,0x5d,0x17, (in 2.04.5a) */
0x7d,0x05,0x45,0x00,0x00,0xe8,0x00,0x02, /* (in 2.06.50) */
/* 0x88,0x00,0x45,0x00,0x00,0xe8,0x00,0x02, (in 2.04.5a) */
0x0d,0x00,0x68,0xb0,0x0b,0x92,0x8f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x63,
0x00,0x40,0x3e,0x00,0xe1,0x02,0x28,0x00
};
UCHAR SiS300_HiTVExtTiming[] = {0x00};
static const UCHAR SiS300_HiTVExtTiming[] = /* TW: New */
{
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
};
UCHAR SiS300_HiTVSt1Timing[] = {0x00};
static const UCHAR SiS300_HiTVSt1Timing[] = /* TW: New */
{
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x65,0x90,0x7b,0xa8,0x03,0xf0,0x87,0x03,
0x11,0x15,0x11,0xcf,0x10,0x11,0xcf,0x10,
0x35,0x35,0x3b,0x69,0x1d,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x86,
0xaf,0x5d,0x0e,0x00,0xfc,0xff,0x2d,0x00
};
UCHAR SiS300_HiTVSt2Timing[] = {0x00};
static const UCHAR SiS300_HiTVSt2Timing[] = /* TW: New */
{
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x64,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x64,0x90,0x33,0x8c,0x18,0x36,0x3e,0x13,
0x2a,0xde,0x2a,0x44,0x40,0x2a,0x44,0x40,
0x8e,0x8e,0x82,0x07,0x0b,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x14,0x3d,
0x63,0x4f,0x27,0x00,0xfc,0xff,0x6a,0x00
};
UCHAR SiS300_HiTVTextTiming[] = {0x00};
static const UCHAR SiS300_HiTVTextTiming[] = /* TW: New */
{
0x32,0x65,0x2c,0x5f,0x08,0x31,0x3a,0x65,
0x28,0x02,0x01,0x3d,0x06,0x3e,0x35,0x6d,
0x06,0x14,0x3e,0x35,0x6d,0x00,0xc5,0x3f,
0x65,0x90,0xe7,0xbc,0x03,0x0c,0x97,0x03,
0x14,0x78,0x14,0x08,0x20,0x14,0x08,0x20,
0xc8,0xc8,0x3b,0xd2,0x26,0x92,0x0f,0x40,
0x60,0x80,0x14,0x90,0x8c,0x60,0x04,0x96,
0x72,0x5c,0x11,0x00,0xfc,0xff,0x32,0x00
};
UCHAR SiS300_HiTVGroup3Data[] = {0x00};
static const UCHAR SiS300_HiTVGroup3Data[] = /* TW: New */
{
0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x5f,
0x05,0x21,0xb2,0xb2,0x55,0x77,0x2a,0xa6,
0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
0x8c,0x6e,0x60,0x2e,0x58,0x48,0x72,0x44,
0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
0x4f,0x7f,0x03,0xa8,0x7d,0x20,0x1a,0xa9,
0x14,0x05,0x03,0x7e,0x64,0x31,0x14,0x75,
0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
};
UCHAR SiS300_HiTVGroup3Simu[] = {0x00};
static const UCHAR SiS300_HiTVGroup3Simu[] = /* TW: New */
{
0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0x95,
0xdb,0x20,0xb8,0xb8,0x55,0x47,0x2a,0xa6,
0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
0x8c,0x6e,0x60,0x15,0x26,0xd3,0xe4,0x11,
0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
0x67,0x36,0x01,0x47,0x0e,0x10,0xbe,0xb4,
0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
};
UCHAR SiS300_HiTVGroup3Text[] = {0x00};
static const UCHAR SiS300_HiTVGroup3Text[] = /* TW: New */
{
0x00,0x1a,0x22,0x63,0x62,0x22,0x08,0xa7,
0xf5,0x20,0xce,0xce,0x55,0x47,0x2a,0xa6,
0x25,0x2f,0x47,0xfa,0xc8,0xff,0x8e,0x20,
0x8c,0x6e,0x60,0x18,0x2c,0x0c,0x20,0x22,
0x56,0x36,0x4f,0x6e,0x3f,0x80,0x00,0x80,
0x93,0x3c,0x01,0x50,0x2f,0x10,0xf4,0xca,
0x01,0x05,0x03,0x7e,0x65,0x31,0x14,0x75,
0x18,0x05,0x18,0x05,0x4c,0xa8,0x01
};
typedef struct _SiS300_LVDSDataStruct
{
......@@ -1320,7 +1666,20 @@ typedef struct _SiS300_LVDSDataStruct
USHORT LCDVT;
} SiS300_LVDSDataStruct;
SiS300_LVDSDataStruct SiS300_LVDS800x600Data_1[]=
static const SiS300_LVDSDataStruct SiS300_LVDS320x480Data_1[] =
{
{848, 433,400, 525},
{848, 389,400, 525},
{848, 433,400, 525},
{848, 389,400, 525},
{848, 518,400, 525},
{1056,628,400, 525},
{400, 525,400, 525},
{800, 449,1000, 644},
{800, 525,1000, 635}
};
static const SiS300_LVDSDataStruct SiS300_LVDS800x600Data_1[] =
{
{848, 433,1060, 629},
{848, 389,1060, 629},
......@@ -1333,7 +1692,7 @@ SiS300_LVDSDataStruct SiS300_LVDS800x600Data_1[]=
{800, 525,1000, 635}
};
SiS300_LVDSDataStruct SiS300_LVDS800x600Data_2[]=
static const SiS300_LVDSDataStruct SiS300_LVDS800x600Data_2[] =
{
{1056, 628,1056, 628},
{1056, 628,1056, 628},
......@@ -1346,7 +1705,7 @@ SiS300_LVDSDataStruct SiS300_LVDS800x600Data_2[]=
{800, 525,1000, 635}
};
SiS300_LVDSDataStruct SiS300_LVDS1024x768Data_1[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1024x768Data_1[] =
{
{840, 438,1344, 806},
{840, 409,1344, 806},
......@@ -1359,7 +1718,7 @@ SiS300_LVDSDataStruct SiS300_LVDS1024x768Data_1[]=
{800, 525,1280, 813}
};
SiS300_LVDSDataStruct SiS300_LVDS1024x768Data_2[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1024x768Data_2[] =
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
......@@ -1372,7 +1731,7 @@ SiS300_LVDSDataStruct SiS300_LVDS1024x768Data_2[]=
{800, 525,1280, 813}
};
SiS300_LVDSDataStruct SiS300_LVDS1280x1024Data_1[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1280x1024Data_1[] =
{
{840, 438,1344, 806},
{840, 409,1344, 806},
......@@ -1385,7 +1744,7 @@ SiS300_LVDSDataStruct SiS300_LVDS1280x1024Data_1[]=
{800, 525,1280, 813}
};
SiS300_LVDSDataStruct SiS300_LVDS1280x1024Data_2[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1280x1024Data_2[] =
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
......@@ -1398,21 +1757,60 @@ SiS300_LVDSDataStruct SiS300_LVDS1280x1024Data_2[]=
{800, 525,1280, 813}
};
SiS300_LVDSDataStruct SiS300_LVDS640x480Data_1[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1400x1050Data_1[] = /* TW: New */
{
{800, 449, 800, 449},
{800, 449, 800, 449},
{800, 449, 800, 449},
{800, 449, 800, 449},
{800, 525, 800, 525},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628}
{928, 416, 1688, 1066},
{928, 366, 1688, 1066},
{928, 416, 1688, 1066},
{928, 366, 1688, 1066},
{928, 496, 1688, 1066},
{1088, 616, 1688, 1066},
{1312, 784, 1688, 1066},
{1568, 1040, 1688, 1066},
{1688, 1066, 1688, 1066}
};
static const SiS300_LVDSDataStruct SiS300_LVDS1400x1050Data_2[] = /* TW: New */
{
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
{1688,1066, 1688,1066},
};
static const SiS300_LVDSDataStruct SiS300_LVDS1280x768Data_1[]= /* TW: New - TODO */
{ /* TW: Temp data, invalid (is identical to 1024x768) */
{840, 438,1344, 806},
{840, 409,1344, 806},
{840, 438,1344, 806},
{840, 409,1344, 806},
{840, 518,1344, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
static const SiS300_LVDSDataStruct SiS300_LVDS1280x768Data_2[]= /* TW: New - TODO */
{ /* TW: Temp data, invalid (is identical to 1024x768) */
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
/* TW: New: */
SiS300_LVDSDataStruct SiS300_LVDS1024x600Data_1[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1024x600Data_1[] =
{
{840, 604,1344, 800},
{840, 560,1344, 800},
......@@ -1421,12 +1819,40 @@ SiS300_LVDSDataStruct SiS300_LVDS1024x600Data_1[]=
{840, 689,1344, 800},
{1050, 800,1344, 800},
{1344, 800,1344, 800},
{800, 449,1280, 789},
{800, 525,1280, 785}
};
/* TW: New: */
static const SiS300_LVDSDataStruct SiS300_LVDS1024x600Data_2[] =
{
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{1344, 800,1344, 800},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
/* TW: New: */
static const SiS300_LVDSDataStruct SiS300_LVDS1152x768Data_1[] =
{
{840, 438,1344, 806},
{840, 409,1344, 806},
{840, 438,1344, 806},
{840, 409,1344, 806},
{840, 518,1344, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
/* TW: New: */
SiS300_LVDSDataStruct SiS300_LVDS1024x600Data_2[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1152x768Data_2[] =
{
{1344, 806,1344, 806},
{1344, 806,1344, 806},
......@@ -1439,8 +1865,33 @@ SiS300_LVDSDataStruct SiS300_LVDS1024x600Data_2[]=
{800, 525,1280, 813}
};
/* TW: New: */
SiS300_LVDSDataStruct SiS300_LVDS1152x768Data_1[]=
/* TW: New in 650/LVDS BIOS - 1:1 */
static const SiS300_LVDSDataStruct SiS300_LVDSXXXxXXXData_1[] = /* TW: New */
{
{ 800, 449, 800, 449},
{ 800, 449, 800, 449},
{ 900, 449, 900, 449},
{ 900, 449, 900, 449},
{ 800, 525, 800, 525},
{1056, 628,1056, 628},
{1344, 806,1344, 806},
{1688, 806,1688, 806} /* 1280x768 ! */
};
static const SiS300_LVDSDataStruct SiS300_LVDS640x480Data_1[] =
{
{800, 449, 800, 449},
{800, 449, 800, 449},
{800, 449, 800, 449},
{800, 449, 800, 449},
{800, 525, 800, 525},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628},
{1056, 628,1056, 628}
};
static const SiS300_LVDSDataStruct SiS300_LVDS1280x960Data_1[] = /* TW: New */
{
{840, 438,1344, 806},
{840, 409,1344, 806},
......@@ -1453,22 +1904,77 @@ SiS300_LVDSDataStruct SiS300_LVDS1152x768Data_1[]=
{800, 525,1280, 813}
};
/* TW: New: */
SiS300_LVDSDataStruct SiS300_LVDS1152x768Data_2[]=
static const SiS300_LVDSDataStruct SiS300_LVDS1280x960Data_2[] = /* TW: New */
{
{840, 438,1344, 806},
{840, 409,1344, 806},
{840, 438,1344, 806},
{840, 409,1344, 806},
{840, 518,1344, 806},
{1050, 638,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
static const SiS300_LVDSDataStruct SiS300_LCDA1400x1050Data_1[] = /* TW: New */
{ /* TW: Might be temporary (invalid) data */
{928, 416, 1688, 1066},
{928, 366, 1688, 1066},
{1008, 416, 1688, 1066},
{1008, 366, 1688, 1066},
{1200, 530, 1688, 1066},
{1088, 616, 1688, 1066},
{1312, 784, 1688, 1066},
{1568, 1040, 1688, 1066},
{1688, 1066, 1688, 1066}
};
static const SiS300_LVDSDataStruct SiS300_LCDA1400x1050Data_2[] = /* TW: New */
{ /* TW: Temporary data. Not valid */
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
static const SiS300_LVDSDataStruct SiS300_LCDA1600x1200Data_1[] = /* TW: New */
{ /* TW: Temporary data. Not valid */
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{1344, 806,1344, 806},
{800, 449,1280, 801},
{800, 525,1280, 813}
};
static const SiS300_LVDSDataStruct SiS300_LCDA1600x1200Data_2[] = /* TW: New */
{ /* TW: Temporary data. Not valid */
{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, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
/* TW: New: */
SiS300_LVDSDataStruct SiS300_CHTVUNTSCData[]=
static const SiS300_LVDSDataStruct SiS300_CHTVUNTSCData[] =
{
{840, 600, 840, 600},
{840, 600, 840, 600},
......@@ -1478,7 +1984,7 @@ SiS300_LVDSDataStruct SiS300_CHTVUNTSCData[]=
{1064, 750,1064, 750}
};
SiS300_LVDSDataStruct SiS300_CHTVONTSCData[]=
static const SiS300_LVDSDataStruct SiS300_CHTVONTSCData[] =
{
{840, 525, 840, 525},
{840, 525, 840, 525},
......@@ -1488,7 +1994,7 @@ SiS300_LVDSDataStruct SiS300_CHTVONTSCData[]=
{1040, 700,1040, 700}
};
SiS300_LVDSDataStruct SiS300_CHTVUPALData[]=
static const SiS300_LVDSDataStruct SiS300_CHTVUPALData[] =
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1498,7 +2004,7 @@ SiS300_LVDSDataStruct SiS300_CHTVUPALData[]=
{936, 836, 936, 836}
};
SiS300_LVDSDataStruct SiS300_CHTVOPALData[]=
static const SiS300_LVDSDataStruct SiS300_CHTVOPALData[] =
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
......@@ -1507,6 +2013,17 @@ SiS300_LVDSDataStruct SiS300_CHTVOPALData[]=
{840, 625, 840, 625},
{960, 750, 960, 750}
};
static const SiS300_LVDSDataStruct SiS300_CHTVSOPALData[] =
{
{1008, 625,1008, 625},
{1008, 625,1008, 625},
{1008, 625,1008, 625},
{1008, 625,1008, 625},
{840, 500, 840, 500},
{944, 625, 944, 625}
};
/* TW: new end */
typedef struct _SiS300_LVDSDesStruct
......@@ -1515,7 +2032,7 @@ typedef struct _SiS300_LVDSDesStruct
USHORT LCDVDES;
} SiS300_LVDSDesStruct;
SiS300_LVDSDesStruct SiS300_PanelType00_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType00_1[] =
{
{0, 626},
{0, 624},
......@@ -1528,7 +2045,7 @@ SiS300_LVDSDesStruct SiS300_PanelType00_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType01_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType01_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1541,7 +2058,7 @@ SiS300_LVDSDesStruct SiS300_PanelType01_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType02_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType02_1[] =
{
{0, 626},
{0, 624},
......@@ -1554,7 +2071,7 @@ SiS300_LVDSDesStruct SiS300_PanelType02_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType03_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType03_1[] =
{
{ 8, 436},
{ 8, 440},
......@@ -1567,7 +2084,7 @@ SiS300_LVDSDesStruct SiS300_PanelType03_1[]=
{1343, 794}
};
SiS300_LVDSDesStruct SiS300_PanelType04_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType04_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1580,7 +2097,7 @@ SiS300_LVDSDesStruct SiS300_PanelType04_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType05_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType05_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1593,7 +2110,7 @@ SiS300_LVDSDesStruct SiS300_PanelType05_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType06_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType06_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1606,7 +2123,7 @@ SiS300_LVDSDesStruct SiS300_PanelType06_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType07_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType07_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1619,7 +2136,7 @@ SiS300_LVDSDesStruct SiS300_PanelType07_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType08_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType08_1[] =
{
{1059, 626},
{1059, 624},
......@@ -1632,7 +2149,7 @@ SiS300_LVDSDesStruct SiS300_PanelType08_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType09_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType09_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1645,7 +2162,7 @@ SiS300_LVDSDesStruct SiS300_PanelType09_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0a_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0a_1[] =
{
{1059, 626},
{1059, 624},
......@@ -1658,20 +2175,20 @@ SiS300_LVDSDesStruct SiS300_PanelType0a_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0b_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0b_1[] =
{
{1343, 798},
{1343, 794},
{1343, 798},
{1343, 794},
{1343, 0},
{1343, 0},
{ 0, 805},
{ 0, 794},
{ 0, 0}
{1343, 0},
{1343, 0},
{1343, 0},
{1343, 0},
{1343, 0}, /* 640x480 - BIOS 1343, 0 */
{1343, 0},
{ 0, 799},
{ 0, 0},
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0c_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0c_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1684,7 +2201,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0c_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0d_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0d_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1697,7 +2214,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0d_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0e_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0e_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1710,7 +2227,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0e_1[]=
{ 0, 0} /* 1280x960 - not applicable */
};
SiS300_LVDSDesStruct SiS300_PanelType0f_1[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0f_1[] =
{
{1343, 798},
{1343, 794},
......@@ -1723,7 +2240,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0f_1[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType00_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType00_2[] =
{
{976, 527},
{976, 502},
......@@ -1736,7 +2253,7 @@ SiS300_LVDSDesStruct SiS300_PanelType00_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType01_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType01_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1749,7 +2266,7 @@ SiS300_LVDSDesStruct SiS300_PanelType01_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType02_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType02_2[] =
{
{976, 527},
{976, 502},
......@@ -1762,7 +2279,7 @@ SiS300_LVDSDesStruct SiS300_PanelType02_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType03_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType03_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1775,7 +2292,7 @@ SiS300_LVDSDesStruct SiS300_PanelType03_2[]=
{1152, 597}
};
SiS300_LVDSDesStruct SiS300_PanelType04_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType04_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1788,7 +2305,7 @@ SiS300_LVDSDesStruct SiS300_PanelType04_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType05_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType05_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1801,7 +2318,7 @@ SiS300_LVDSDesStruct SiS300_PanelType05_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType06_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType06_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1814,7 +2331,7 @@ SiS300_LVDSDesStruct SiS300_PanelType06_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType07_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType07_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1827,7 +2344,7 @@ SiS300_LVDSDesStruct SiS300_PanelType07_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType08_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType08_2[] =
{
{976, 527},
{976, 502},
......@@ -1840,7 +2357,7 @@ SiS300_LVDSDesStruct SiS300_PanelType08_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType09_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType09_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1853,7 +2370,7 @@ SiS300_LVDSDesStruct SiS300_PanelType09_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0a_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0a_2[] =
{
{976, 527},
{976, 502},
......@@ -1866,20 +2383,20 @@ SiS300_LVDSDesStruct SiS300_PanelType0a_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0b_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0b_2[] =
{
{1152, 622},
{1152, 597},
{1152, 622},
{1152, 597},
{1152, 662},
{1232, 722},
{ 0, 805},
{ 0, 794},
{ 0, 0}
{ 1152, 700},
{ 1152, 675},
{ 1152, 700},
{ 1152, 675},
{ 1152, 740},
{ 1232, 799},
{ 0, 799},
{ 0, 0},
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0c_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0c_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1892,7 +2409,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0c_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0d_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0d_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1905,7 +2422,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0d_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0e_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0e_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1918,7 +2435,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0e_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType0f_2[]=
static const SiS300_LVDSDesStruct SiS300_PanelType0f_2[] =
{
{1152, 622},
{1152, 597},
......@@ -1931,7 +2448,7 @@ SiS300_LVDSDesStruct SiS300_PanelType0f_2[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_PanelType1076_1[]= /* TW: New */
static const SiS300_LVDSDesStruct SiS300_PanelType1076_1[] = /* TW: New */
{
{ 0 , 0},
{ 0 , 0},
......@@ -1944,7 +2461,7 @@ SiS300_LVDSDesStruct SiS300_PanelType1076_1[]= /* TW: New */
{ 0 , 0}
};
SiS300_LVDSDesStruct SiS300_PanelType1076_2[]= /* TW: New */
static const SiS300_LVDSDesStruct SiS300_PanelType1076_2[] = /* TW: New */
{
{ 1152, 622 },
{ 1152, 597 },
......@@ -1957,7 +2474,7 @@ SiS300_LVDSDesStruct SiS300_PanelType1076_2[]= /* TW: New */
{ 0, 0 }
};
SiS300_LVDSDesStruct SiS300_PanelType1210_1[]= /* TW: New */
static const SiS300_LVDSDesStruct SiS300_PanelType1210_1[] = /* TW: New */
{
{ 0 , 0},
{ 0 , 0},
......@@ -1970,7 +2487,7 @@ SiS300_LVDSDesStruct SiS300_PanelType1210_1[]= /* TW: New */
{ 0 , 0}
};
SiS300_LVDSDesStruct SiS300_PanelType1210_2[]= /* TW: New */
static const SiS300_LVDSDesStruct SiS300_PanelType1210_2[] = /* TW: New */
{
{ 0 , 0},
{ 0 , 0},
......@@ -1983,7 +2500,7 @@ SiS300_LVDSDesStruct SiS300_PanelType1210_2[]= /* TW: New */
{ 0 , 0}
};
SiS300_LVDSDesStruct SiS300_PanelType1296_1[]= /* TW: New */
static const SiS300_LVDSDesStruct SiS300_PanelType1296_1[] = /* TW: New */
{
{ 0 , 0},
{ 0 , 0},
......@@ -1996,7 +2513,7 @@ SiS300_LVDSDesStruct SiS300_PanelType1296_1[]= /* TW: New */
{ 0 , 0}
};
SiS300_LVDSDesStruct SiS300_PanelType1296_2[]= /* TW: New */
static const SiS300_LVDSDesStruct SiS300_PanelType1296_2[] = /* TW: New */
{
{ 0 , 0},
{ 0 , 0},
......@@ -2011,7 +2528,7 @@ SiS300_LVDSDesStruct SiS300_PanelType1296_2[]= /* TW: New */
/* TW: New */
SiS300_LVDSDesStruct SiS300_CHTVUNTSCDesData[]=
static const SiS300_LVDSDesStruct SiS300_CHTVUNTSCDesData[] =
{
{ 0, 0},
{ 0, 0},
......@@ -2021,7 +2538,7 @@ SiS300_LVDSDesStruct SiS300_CHTVUNTSCDesData[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_CHTVONTSCDesData[]=
static const SiS300_LVDSDesStruct SiS300_CHTVONTSCDesData[] =
{
{ 0, 0},
{ 0, 0},
......@@ -2031,7 +2548,7 @@ SiS300_LVDSDesStruct SiS300_CHTVONTSCDesData[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_CHTVUPALDesData[]=
static const SiS300_LVDSDesStruct SiS300_CHTVUPALDesData[] =
{
{256, 0},
{256, 0},
......@@ -2041,7 +2558,7 @@ SiS300_LVDSDesStruct SiS300_CHTVUPALDesData[]=
{ 0, 0}
};
SiS300_LVDSDesStruct SiS300_CHTVOPALDesData[]=
static const SiS300_LVDSDesStruct SiS300_CHTVOPALDesData[] =
{
{256, 0},
{256, 0},
......@@ -2052,12 +2569,90 @@ SiS300_LVDSDesStruct SiS300_CHTVOPALDesData[]=
};
/* TW: New end */
/* TW: New for SiS300+301LV */
typedef struct _SiS300_Part2PortTblStruct
{
UCHAR CR[12];
} SiS300_Part2PortTblStruct;
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_1[] =
{ /* VESA Timing */
{{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x2c,0x12,0x9a,0xae,0x88,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x21,0x12,0xbf,0xe4,0xc0,0x21,0x45,0x09,0x00,0xa9,0x09,0x04}},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}},
{{0x22,0x13,0xfe,0x25,0xff,0x21,0x45,0x0a,0x00,0xa9,0x0d,0x04}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_1[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_1[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_1[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_2[] =
{ /* Non-VESA */
{{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x28,0x12,0xa3,0xd0,0xaa,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x2c,0x12,0x9a,0xae,0x88,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x28,0x13,0xe7,0x0b,0xe8,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x38,0x18,0x16,0x00,0x00,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}},
{{0x36,0x13,0x13,0x25,0xff,0x5a,0x45,0x0a,0x07,0xfa,0x0a,0x24}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_2[] =
{
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_2[] =
{
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_2[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1024x768_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1280x1024_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1400x1050_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
static const SiS300_Part2PortTblStruct SiS300_CRT2Part2_1600x1200_3[] =
{ /* TW: Temporary data, invalid */
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
};
typedef struct _SiS300_LVDSCRT1DataStruct
{
UCHAR CR[15];
} SiS300_LVDSCRT1DataStruct;
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1[] =
{
{{0x65,0x4f,0x89,0x56,0x83,0xaf,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x05,
......@@ -2079,7 +2674,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1[] =
{
{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
......@@ -2101,10 +2696,10 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1[]=
0x01}},
{{0xa3,0x7f,0x87,0x86,0x97,0x24,0xf5,
0x02,0x88,0xff,0x25,0x10,0x00,0x02,
0x01} }
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1[] =
{
{{0x63,0x4f,0x87,0x54,0x9f,0xb4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
......@@ -2129,7 +2724,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1_H[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1_H[] =
{
{{0x30,0x27,0x94,0x2c,0x92,0xaf,0x1f,
0x90,0x85,0x8f,0xab,0x30,0x00,0x04,
......@@ -2151,7 +2746,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_1_H[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1_H[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1_H[] =
{
{{0x37,0x27,0x9B,0x2b,0x94,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
......@@ -2176,7 +2771,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_1_H[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1_H[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xb4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x04,
......@@ -2201,7 +2796,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_1_H[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2[] =
{
{{0x7f,0x4f,0x83,0x62,0x12,0x72,0x3e,
0xf4,0x88,0x8f,0x73,0x20,0x00,0x06,
......@@ -2223,7 +2818,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
......@@ -2248,7 +2843,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
......@@ -2273,7 +2868,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2_H[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2_H[] =
{
{{0x3d,0x27,0x81,0x32,0x1a,0x72,0x3e,
0xf4,0x88,0x8f,0x73,0x20,0x00,0x05,
......@@ -2295,7 +2890,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT1800x600_2_H[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2_H[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
......@@ -2320,7 +2915,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x768_2_H[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2_H[]=
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x81,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
......@@ -2345,7 +2940,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11280x1024_2_H[]=
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_1[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_1[] =
{
{{0x64,0x4f,0x88,0x54,0x9f,0x5a,0x3e,
0xe8,0x8f,0x8f,0x5b,0x00,0x00,0x01,
......@@ -2370,7 +2965,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_1[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_1_H[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
......@@ -2395,7 +2990,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_1_H[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_2[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
......@@ -2420,7 +3015,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_2[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_2_H[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
......@@ -2445,7 +3040,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11024x600_2_H[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_1[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_1[] =
{
{{0x64,0x4f,0x88,0x54,0x9f,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x01,
......@@ -2470,7 +3065,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_1[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_1_H[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_1_H[] =
{
{{0x2f,0x27,0x93,0x2b,0x90,0xc4,0x1f,
0x92,0x89,0x8f,0xb5,0x30,0x00,0x44,
......@@ -2495,7 +3090,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_1_H[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_2[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_2[] =
{
{{0xa3,0x4f,0x87,0x6e,0x9f,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x06,
......@@ -2520,7 +3115,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_2[] =
0x01}}
};
SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_2_H[] =
static const SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_2_H[] =
{
{{0x4f,0x27,0x93,0x39,0x01,0x24,0xbb,
0x4a,0x80,0x8f,0x25,0x30,0x00,0x01,
......@@ -2546,7 +3141,7 @@ SiS300_LVDSCRT1DataStruct SiS300_LVDSCRT11152x768_2_H[] =
};
/* TW: New */
SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UNTSC[]=
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UNTSC[] =
{
{{0x64,0x4f,0x88,0x56,0x9f,0x56,0x3e,
0xe8,0x84,0x8f,0x57,0x20,0x00,0x01,
......@@ -2568,7 +3163,7 @@ SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UNTSC[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1ONTSC[]=
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1ONTSC[] =
{
{{0x64,0x4f,0x88,0x5a,0x9f,0x0b,0x3e,
0xc0,0x84,0x8f,0x0c,0x20,0x00,0x01,
......@@ -2590,7 +3185,7 @@ SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1ONTSC[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UPAL[]=
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf8,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -2612,7 +3207,7 @@ SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1UPAL[]=
0x01 }}
};
SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1OPAL[]=
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1OPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
......@@ -2633,6 +3228,28 @@ SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1OPAL[]=
0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
0x01 }}
};
static const SiS300_LVDSCRT1DataStruct SiS300_CHTVCRT1SOPAL[] =
{
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
0x00 }},
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
0x00 }},
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xf0,0x83,0x8f,0x70,0x20,0x00,0x05,
0x00 }},
{{0x79,0x4f,0x9d,0x5a,0x90,0x6f,0x3e,
0xde,0x81,0x5d,0x70,0x00,0x00,0x05,
0x00 }},
{{0x64,0x4f,0x88,0x55,0x80,0x6f,0xba, /* TODO */
0x20,0x83,0xdf,0x70,0x00,0x00,0x05,
0x00 }},
{{0x73,0x63,0x97,0x69,0x8e,0xec,0xf0, /* TODO */
0x90,0x8c,0x57,0xed,0x20,0x00,0x05,
0x01 }}
};
/* TW: New end */
/* TW: New */
......@@ -2641,7 +3258,8 @@ typedef struct _SiS300_CHTVRegDataStruct
UCHAR Reg[16];
} SiS300_CHTVRegDataStruct;
SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] = {
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] =
{
{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
{{0x4a,0x94,0x00,0x48,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
......@@ -2650,7 +3268,8 @@ SiS300_CHTVRegDataStruct SiS300_CHTVReg_UNTSC[] = {
{{0x8d,0xc4,0x00,0x3b,0xfb,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 24: 800x600 NTSC 7/10 */
};
SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] = {
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] =
{
{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
{{0x49,0x94,0x00,0x34,0xfe,0,0,0,0,0,0,0,0,0,0,0}},
......@@ -2659,37 +3278,51 @@ SiS300_CHTVRegDataStruct SiS300_CHTVReg_ONTSC[] = {
{{0x8c,0xb4,0x00,0x32,0xf9,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 23: 800x600 NTSC 3/4 */
};
SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] = {
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_UPAL[] =
{
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
{{0x63,0x94,0x01,0x50,0x30,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 15: 640x480 PAL 5/6 */
/* TW: For 800x600, 3/4 is VERY underscan */
{{0x84,0x64,0x01,0x4e,0x2f,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 21: 800x600 PAL 3/4 */
/* TW: Mode 20 is still underscan, use it instead? */
/* {{0x83,0x76,0x01,0x40,0x31}} */ /* Mode 20: 800x600 PAL 5/6 */
};
SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] = {
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_OPAL[] =
{
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 1/1 */
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
{{0x61,0x94,0x01,0x36,0x30,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 14: 640x480 PAL 1/1 */
{{0x83,0x76,0x01,0x40,0x31,0,0,0,0,0,0,0,0,0,0,0}} /* Mode 20: 800x600 PAL 5/6 */
/* {{0x81,0x12,0x01,0x50,0x34}} */ /* TW: (test) Mode 19: 800x600 PAL 1/1 */
};
static const SiS300_CHTVRegDataStruct SiS300_CHTVReg_SOPAL[] =
{
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}}, /* Mode 9: 640x400 PAL 5/4 */
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x01,0x50,0x34,0,0,0,0,0,0,0,0,0,0,0}},
{{0x41,0x12,0x00,0x50,0x00,0,0,0,0,0,0,0,0,0,0,0}},
{{0x60,0x30,0x00,0x10,0x00,0,0,0,0,0,0,0,0,0,0,0}}, /* TW: Mode 13: 640x480 PAL 5/4 */
{{0x81,0x50,0x00,0x1b,0x00,0,0,0,0,0,0,0,0,0,0,0}} /* TW: Mode 19: 800x600 PAL 1/1 */
};
/* TW: New end */
/* TW: New */
UCHAR SiS300_CHTVVCLKUNTSC[] = {0x29,0x29,0x29,0x29,0x2a,0x2e};
static const UCHAR SiS300_CHTVVCLKUNTSC[] = {0x29,0x29,0x29,0x29,0x2a,0x2e};
static const UCHAR SiS300_CHTVVCLKONTSC[] = {0x2c,0x2c,0x2c,0x2c,0x2d,0x2b};
static const UCHAR SiS300_CHTVVCLKSONTSC[] = {0x2c,0x2c,0x2c,0x2c,0x2d,0x2b};
UCHAR SiS300_CHTVVCLKONTSC[] = {0x2c,0x2c,0x2c,0x2c,0x2d,0x2b};
static const UCHAR SiS300_CHTVVCLKUPAL[] = {0x2f,0x2f,0x2f,0x2f,0x2f,0x31};
UCHAR SiS300_CHTVVCLKUPAL[] = {0x2f,0x2f,0x2f,0x2f,0x2f,0x31};
static const UCHAR SiS300_CHTVVCLKOPAL[] = {0x2f,0x2f,0x2f,0x2f,0x30,0x32};
UCHAR SiS300_CHTVVCLKOPAL[] = {0x2f,0x2f,0x2f,0x2f,0x30,0x32};
static const UCHAR SiS300_CHTVVCLKSOPAL[] = {0x2f,0x2f,0x2f,0x2f,0x36,0x29};
/* TW: New end */
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -24,9 +24,16 @@
#endif
#ifdef LINUX_KERNEL
#include <linux/config.h>
#include <linux/version.h>
#include <linux/types.h>
#include <asm/io.h>
#include <linux/fb.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/sisfb.h>
#else
#include <video/sisfb.h>
#endif
#endif
#ifdef WIN2000
......@@ -42,7 +49,7 @@
#include "tools.h"
#endif
USHORT SiS_DRAMType[17][5]={
const USHORT SiS_DRAMType[17][5]={
{0x0C,0x0A,0x02,0x40,0x39},
{0x0D,0x0A,0x01,0x40,0x48},
{0x0C,0x09,0x02,0x20,0x35},
......@@ -62,7 +69,7 @@ USHORT SiS_DRAMType[17][5]={
{0x09,0x08,0x01,0x01,0x00}
};
USHORT SiS_SDRDRAM_TYPE[13][5] =
const USHORT SiS_SDRDRAM_TYPE[13][5] =
{
{ 2,12, 9,64,0x35},
{ 1,13, 9,64,0x44},
......@@ -79,7 +86,7 @@ USHORT SiS_SDRDRAM_TYPE[13][5] =
{ 1, 9, 8, 2,0x00}
};
USHORT SiS_DDRDRAM_TYPE[4][5] =
const USHORT SiS_DDRDRAM_TYPE[4][5] =
{
{ 2,12, 9,64,0x35},
{ 2,12, 8,32,0x31},
......@@ -87,9 +94,7 @@ USHORT SiS_DDRDRAM_TYPE[4][5] =
{ 2, 9, 8, 4,0x01}
};
UCHAR SiS_ChannelAB, SiS_DataBusWidth;
USHORT SiS_MDA_DAC[] =
const USHORT SiS_MDA_DAC[] =
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x15,0x15,0x15,0x15,0x15,0x15,0x15,0x15,
......@@ -101,7 +106,7 @@ USHORT SiS_MDA_DAC[] =
0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F
};
USHORT SiS_CGA_DAC[] =
const USHORT SiS_CGA_DAC[] =
{
0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
......@@ -113,7 +118,7 @@ USHORT SiS_CGA_DAC[] =
0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F
};
USHORT SiS_EGA_DAC[] =
const USHORT SiS_EGA_DAC[] =
{
0x00,0x10,0x04,0x14,0x01,0x11,0x05,0x15,
0x20,0x30,0x24,0x34,0x21,0x31,0x25,0x35,
......@@ -125,7 +130,7 @@ USHORT SiS_EGA_DAC[] =
0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F
};
USHORT SiS_VGA_DAC[] =
const USHORT SiS_VGA_DAC[] =
{
0x00,0x10,0x04,0x14,0x01,0x11,0x09,0x15,
0x2A,0x3A,0x2E,0x3E,0x2B,0x3B,0x2F,0x3F,
......@@ -139,195 +144,189 @@ USHORT SiS_VGA_DAC[] =
0x0B,0x0C,0x0D,0x0F,0x10
};
USHORT SiS_P3c4,SiS_P3d4,SiS_P3c0,SiS_P3ce,SiS_P3c2;
USHORT SiS_P3ca,SiS_P3c6,SiS_P3c7,SiS_P3c8,SiS_P3c9,SiS_P3da;
USHORT SiS_Part1Port,SiS_Part2Port;
USHORT SiS_Part3Port,SiS_Part4Port,SiS_Part5Port;
USHORT SiS_CRT1Mode;
USHORT flag_clearbuffer;
int SiS_RAMType;
USHORT SiS_ModeType;
USHORT SiS_IF_DEF_LVDS, SiS_IF_DEF_TRUMPION, SiS_IF_DEF_DSTN, SiS_IF_DEF_FSTN;
USHORT SiS_IF_DEF_CH70xx, SiS_IF_DEF_HiVision;
USHORT SiS_Backup70xx=0xff;
USHORT SiS_VBInfo, SiS_LCDResInfo, SiS_LCDTypeInfo, SiS_LCDInfo, SiS_VBType;
USHORT SiS_VBExtInfo, SiS_HiVision;
USHORT SiS_SelectCRT2Rate;
extern USHORT SiS_SetFlag;
extern USHORT SiS_DDC_Port;
extern USHORT Panel800x600, Panel1024x768, Panel1280x1024, Panel1600x1200;
extern USHORT Panel1280x960, Panel1400x1050, Panel320x480, Panel1152x768;
extern USHORT Panel1152x864, Panel1280x768, Panel1024x600, Panel640x480;
extern USHORT PanelMinLVDS, PanelMin301, PanelMax;
extern USHORT SiS_ChrontelInit;
void SiS_SetReg1(USHORT, USHORT, USHORT);
void SiS_SetReg2(USHORT, USHORT, USHORT);
void SiS_SetReg2(SiS_Private *, USHORT, USHORT, USHORT);
void SiS_SetReg3(USHORT, USHORT);
void SiS_SetReg4(USHORT, ULONG);
void SiS_SetReg5(USHORT, USHORT);
UCHAR SiS_GetReg1(USHORT, USHORT);
UCHAR SiS_GetReg2(USHORT);
ULONG SiS_GetReg3(USHORT);
void SiS_ClearDAC(ULONG);
void SiS_SetMemoryClock(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetDRAMModeRegister(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_SearchVBModeID(UCHAR *ROMAddr, USHORT *ModeNo);
void SiS_IsLowResolution(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
ULONG GetDRAMSize(PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetReg4(USHORT);
void SiS_ClearDAC(SiS_Private *SiS_Pr, ULONG);
void SiS_SetMemoryClock(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetDRAMModeRegister(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo);
void SiS_IsLowResolution(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
#ifdef SIS300
void InitTo300Pointer(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetDRAMSize_300(PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_ChkBUSWidth_300(ULONG FBAddress);
void SiS_SetDRAMSize_300(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_ChkBUSWidth_300(SiS_Private *SiS_Pr, ULONG FBAddress);
#endif
#ifdef SIS315H
void InitTo310Pointer(PSIS_HW_DEVICE_INFO HwDeviceExtension);
UCHAR SiS_Get310DRAMType(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_DDR_MRS(void);
void SiS_SDR_MRS(void);
void SiS_DisableRefresh(void);
void SiS_EnableRefresh(UCHAR *ROMAddr);
void SiS_SetDRAMSize_310(PSIS_HW_DEVICE_INFO);
void SiS_DisableChannelInterleaving(int index,USHORT SiS_DDRDRAM_TYPE[][5]);
void SiS_SetDRAMSizingType(int index,USHORT DRAMTYPE_TABLE[][5]);
void SiS_CheckBusWidth_310(UCHAR *ROMAddress,ULONG FBAddress,
UCHAR SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_DDR_MRS(SiS_Private *SiS_Pr);
void SiS_SDR_MRS(SiS_Private *SiS_Pr);
void SiS_DisableRefresh(SiS_Private *SiS_Pr);
void SiS_EnableRefresh(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
void SiS_SetDRAMSize_310(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
void SiS_DisableChannelInterleaving(SiS_Private *SiS_Pr, int index,USHORT SiS_DDRDRAM_TYPE[][5]);
void SiS_SetDRAMSizingType(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5]);
void SiS_CheckBusWidth_310(SiS_Private *SiS_Pr, UCHAR *ROMAddress,ULONG FBAddress,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
int SiS_SetRank(int index,UCHAR RankNo,UCHAR SiS_ChannelAB,USHORT DRAMTYPE_TABLE[][5]);
int SiS_SetDDRChannel(int index,UCHAR ChannelNo,UCHAR SiS_ChannelAB,
int SiS_SetRank(SiS_Private *SiS_Pr, int index,UCHAR RankNo,USHORT DRAMTYPE_TABLE[][5]);
int SiS_SetDDRChannel(SiS_Private *SiS_Pr, int index,UCHAR ChannelNo,
USHORT DRAMTYPE_TABLE[][5]);
int SiS_CheckColumn(int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckBanks(int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckRank(int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckDDRRank(int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckRanks(int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckDDRRanks(int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_SDRSizing(ULONG FBAddress);
int SiS_DDRSizing(ULONG FBAddress);
int Is315E(void);
void SiS_VerifyMclk(ULONG FBAddr);
int SiS_CheckColumn(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckBanks(SiS_Private *SiS_Pr, int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckDDRRank(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_CheckDDRRanks(SiS_Private *SiS_Pr, int RankNo,int index,USHORT DRAMTYPE_TABLE[][5],ULONG FBAddress);
int SiS_SDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress);
int SiS_DDRSizing(SiS_Private *SiS_Pr, ULONG FBAddress);
int Is315E(SiS_Private *SiS_Pr);
void SiS_VerifyMclk(SiS_Private *SiS_Pr, ULONG FBAddr);
#endif
void SetEnableDstn(void);
void SiS_Delay15us(ULONG);
BOOLEAN SiS_SearchModeID(UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
BOOLEAN SiS_CheckMemorySize(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
void SiS_HandleCRT1(SiS_Private *SiS_Pr);
void SiS_Handle301B_1400x1050(SiS_Private *SiS_Pr, USHORT ModeNo);
void SiS_SetEnableDstn(SiS_Private *SiS_Pr);
void SiS_Delay15us(SiS_Private *SiS_Pr);
BOOLEAN SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
BOOLEAN SiS_CheckMemorySize(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT ModeNo,USHORT ModeIdIndex);
UCHAR SiS_GetModePtr(UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
void SiS_SetSeqRegs(UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_SetMiscRegs(UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_SetCRTCRegs(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
void SiS_SetSeqRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_SetMiscRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_SetCRTCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT StandTableIndex);
void SiS_SetATTRegs(UCHAR *ROMAddr,USHORT StandTableIndex,USHORT ModeNo,
void SiS_SetATTRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGRCRegs(UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_ClearExt1Regs(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetSync(UCHAR *ROMAddr,USHORT RefreshRateTableIndex);
void SiS_SetCRT1CRTC(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_SetGRCRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT StandTableIndex);
void SiS_ClearExt1Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetSync(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT RefreshRateTableIndex);
void SiS_SetCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_ResetCRT1VCLK(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT1VCLK(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO,
BOOLEAN SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
void SiS_ResetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT1VCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO,
USHORT RefreshRateTableIndex);
void SiS_SetVCLKState(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO, USHORT ModeNo,
void SiS_SetVCLKState(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO, USHORT ModeNo,
USHORT RefreshRateTableIndex, USHORT ModeIdIndex);
void SiS_LoadDAC(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_DisplayOn(void);
void SiS_DisplayOff(void);
void SiS_SetCRT1ModeRegs(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO,USHORT ModeNo,
void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_WriteDAC(SiS_Private *SiS_Pr, USHORT, USHORT, USHORT, USHORT, USHORT, USHORT);
void SiS_DisplayOn(SiS_Private *SiS_Pr);
void SiS_DisplayOff(SiS_Private *SiS_Pr);
void SiS_SetCRT1ModeRegs(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO,USHORT ModeNo,
USHORT ModeIdIndex,USHORT RefreshRateTableIndex);
void SiS_WriteDAC(USHORT, USHORT, USHORT, USHORT);
void SiS_GetVBType(USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
USHORT SiS_ChkBUSWidth(UCHAR *ROMAddr);
USHORT SiS_GetModeIDLength(UCHAR *ROMAddr, USHORT);
USHORT SiS_GetRefindexLength(UCHAR *ROMAddr, USHORT);
void SiS_SetInterlace(UCHAR *ROMAddr,USHORT ModeNo,USHORT RefreshRateTableIndex);
USHORT SiS_CalcDelay2(UCHAR *ROMAddr, UCHAR);
USHORT SiS_CalcDelay(UCHAR *ROMAddr, USHORT);
void SiS_Set_LVDS_TRUMPION(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT1Offset(UCHAR *ROMAddr,USHORT,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
void SiS_GetVBType(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
USHORT SiS_ChkBUSWidth(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
USHORT SiS_GetModeIDLength(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT);
USHORT SiS_GetRefindexLength(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT);
void SiS_SetInterlace(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT RefreshRateTableIndex);
void SiS_Set_LVDS_TRUMPION(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT1Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
#ifdef SIS315H
void SiS_SetCRT1FIFO_310(UCHAR *ROMAddr,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
void SiS_SetCRT1FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT,USHORT,PSIS_HW_DEVICE_INFO);
#endif
#ifdef SIS300
void SiS_SetCRT1FIFO_300(UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
void SiS_SetCRT1FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
USHORT RefreshRateTableIndex);
void SiS_SetCRT1FIFO_630(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,PSIS_HW_DEVICE_INFO,
USHORT RefreshRateTableIndex);
USHORT SiS_CalcDelay(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT VCLK,
USHORT colordepth, USHORT MCLK);
USHORT SiS_DoCalcDelay(SiS_Private *SiS_Pr, USHORT MCLK, USHORT VCLK, USHORT colordepth, USHORT key);
USHORT SiS_CalcDelay2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, UCHAR,PSIS_HW_DEVICE_INFO HwDeviceExtension);
#endif
void SiS_ClearBuffer(PSIS_HW_DEVICE_INFO,USHORT ModeNo);
void SiS_SetCRT1Group(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
void SiS_ClearBuffer(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT ModeNo);
void SiS_SetCRT1Group(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT ModeNo,USHORT ModeIdIndex,USHORT BaseAddr);
void SiS_DetectMonitor(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
void SiS_GetSenseStatus(PSIS_HW_DEVICE_INFO HwDeviceExtension,UCHAR *ROMAddr);
USHORT SiS_TestMonitorType(UCHAR R_DAC,UCHAR G_DAC,UCHAR B_DAC);
USHORT SiS_SenseCHTV(VOID);
BOOLEAN SiS_Sense(USHORT Part4Port,USHORT tempbx,USHORT tempcx);
BOOLEAN SiS_GetPanelID(VOID);
BOOLEAN SiS_GetLCDDDCInfo(PSIS_HW_DEVICE_INFO);
USHORT SiS_SenseLCD(PSIS_HW_DEVICE_INFO);
void SiSRegInit(USHORT BaseAddr);
void SiSInitPtr(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiSSetLVDSetc(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo);
void SiSInitPCIetc(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_DetectMonitor(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
void SiS_GetSenseStatus(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,UCHAR *ROMAddr);
USHORT SiS_TestMonitorType(SiS_Private *SiS_Pr, UCHAR R_DAC,UCHAR G_DAC,UCHAR B_DAC);
USHORT SiS_SenseCHTV(SiS_Private *SiS_Pr);
BOOLEAN SiS_Sense(SiS_Private *SiS_Pr, USHORT tempbx,USHORT tempcx);
BOOLEAN SiS_GetPanelID(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
USHORT SiS_SenseLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO);
void SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr);
void SiSInitPtr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiSSetLVDSetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT ModeNo);
void SiSInitPCIetc(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiSDetermineROMUsage(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, UCHAR *ROMAddr);
#ifdef LINUX_XF86
USHORT SiS_CalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode);
USHORT SiS_CheckCalcModeIndex(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags);
void SiS_SetPitch(ScrnInfoPtr pScrn, UShort BaseAddr);
void SiS_SetPitchCRT1(ScrnInfoPtr pScrn, UShort BaseAddr);
void SiS_SetPitchCRT2(ScrnInfoPtr pScrn, UShort BaseAddr);
USHORT SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, int VBFlags);
void SiS_SetPitch(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
void SiS_SetPitchCRT1(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
void SiS_SetPitchCRT2(SiS_Private *SiS_Pr, ScrnInfoPtr pScrn, UShort BaseAddr);
unsigned char SiS_GetSetModeID(ScrnInfoPtr pScrn, unsigned char id);
unsigned char SiS_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value);
extern int SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
int *out_sbit, int *out_scale);
#endif
extern USHORT SiS_GetOffset(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
extern USHORT SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern USHORT SiS_GetColorDepth(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_DisableBridge(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_SetCRT2Group301(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
extern USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_PresetScratchregister(USHORT SiS_P3d4,
extern void SiS_PresetScratchregister(SiS_Private *SiS_Pr, USHORT SiS_P3d4,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_UnLockCRT2(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
extern void SiS_LockCRT2(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
extern BOOLEAN SiS_BridgeIsOn(USHORT BaseAddr);
extern BOOLEAN SiS_BridgeIsEnable(USHORT BaseAddr,PSIS_HW_DEVICE_INFO );
extern void SiS_SetTVSystem301(VOID);
extern BOOLEAN SiS_GetLCDDDCInfo301(PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_GetSenseStatus301(PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT BaseAddr,UCHAR *ROMAddr);
extern USHORT SiS_GetVCLKLen(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_SetCRT2Group302(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_GetVBInfo301(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_GetLCDResInfo301(UCHAR *ROMAddr,USHORT P3d4,USHORT ModeNo,
USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_SetHiVision(USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
/* extern USHORT SiS_VBInfo,LCDResInfo,LCDTypeInfo,LCDInfo; */ /* TW: redundant */
extern USHORT SiS_GetRatePtrCRT2(UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_LongWait(VOID);
extern void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
extern void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr);
extern BOOLEAN SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr);
extern BOOLEAN SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO );
extern void SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension, int chkcrt2mode);
extern BOOLEAN SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern USHORT SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern void SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo);
extern void SiS_LongWait(SiS_Private *SiS_Pr);
extern void SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR);
extern void SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND);
extern void SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR);
extern USHORT SiS_GetResInfo(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_SetCH700x(USHORT tempax);
extern USHORT SiS_GetCH700x(USHORT tempax);
extern void SiS_SetCH701x(USHORT tempax);
extern USHORT SiS_GetCH701x(USHORT tempax);
extern void SiS_SetCH70xx(USHORT tempax);
extern USHORT SiS_GetCH70xx(USHORT tempax);
extern BOOLEAN SiS_GetLVDSCRT1Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
USHORT *ResInfo,USHORT *DisplayType);
extern BOOLEAN SiS_GetLCDACRT1Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
extern USHORT SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
extern void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
extern void SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
extern USHORT SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
extern BOOLEAN SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
USHORT *ResInfo,USHORT *DisplayType);
extern USHORT SiS_GetVCLK2Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
extern USHORT SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_Is301B(USHORT BaseAddr);
extern BOOLEAN SiS_LowModeStuff(USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr);
extern BOOLEAN SiS_IsM650(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern BOOLEAN SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
extern USHORT SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
#ifdef LINUX_KERNEL
int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex);
int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex,
ULONG *left_margin, ULONG *right_margin,
ULONG *upper_margin, ULONG *lower_margin,
ULONG *hsync_len, ULONG *vsync_len,
ULONG *sync, ULONG *vmode);
#endif
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -24,9 +24,15 @@
#endif
#ifdef LINUX_KERNEL
#include <linux/config.h>
#include <linux/version.h>
#include <asm/io.h>
#include <linux/types.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/sisfb.h>
#else
#include <video/sisfb.h>
#endif
#endif
#ifdef WIN2000
......@@ -41,274 +47,306 @@
#include "sisv.h"
#endif
USHORT SiS_SetFlag;
USHORT SiS_RVBHCFACT,SiS_RVBHCMAX,SiS_RVBHRS;
USHORT SiS_VGAVT,SiS_VGAHT;
USHORT SiS_VT,SiS_HT;
USHORT SiS_VGAVDE,SiS_VGAHDE;
USHORT SiS_VDE,SiS_HDE;
USHORT SiS_NewFlickerMode,SiS_RY1COE,SiS_RY2COE,SiS_RY3COE,SiS_RY4COE;
USHORT SiS_LCDHDES,SiS_LCDVDES;
USHORT SiS_DDC_Port, SiS_DDC_Index,SiS_DDC_Data, SiS_DDC_Clk;
USHORT SiS_DDC_DataShift, SiS_DDC_DeviceAddr, SiS_DDC_Flag;
USHORT SiS_DDC_ReadAddr, SiS_DDC_Buffer;
USHORT Panel800x600, Panel1024x768, Panel1280x1024, Panel1600x1200;
USHORT Panel1280x960, Panel1400x1050, Panel320x480, Panel1152x768;
USHORT Panel1280x768, Panel1024x600, Panel640x480, Panel1152x864;
USHORT PanelMax, PanelMinLVDS, PanelMin301;
USHORT SiS_ChrontelInit;
extern USHORT SiS_CRT1Mode;
extern USHORT SiS_P3c4,SiS_P3d4;
extern USHORT SiS_P3ca;
extern USHORT SiS_P3c9;
extern USHORT SiS_P3da;
extern USHORT SiS_Part1Port,SiS_Part2Port;
extern USHORT SiS_Part3Port,SiS_Part4Port,SiS_Part5Port;
extern USHORT SiS_MDA_DAC[];
extern USHORT SiS_CGA_DAC[];
extern USHORT SiS_EGA_DAC[];
extern USHORT SiS_VGA_DAC[];
extern USHORT SiS_ModeType;
extern USHORT SiS_SelectCRT2Rate;
extern USHORT SiS_IF_DEF_LVDS;
extern USHORT SiS_IF_DEF_TRUMPION;
extern USHORT SiS_IF_DEF_CH70xx;
extern USHORT SiS_Backup70xx;
extern USHORT SiS_IF_DEF_HiVision;
extern USHORT SiS_IF_DEF_DSTN; /*add for dstn*/
extern USHORT SiS_IF_DEF_FSTN; /*add for fstn*/
extern USHORT SiS_VBInfo;
extern USHORT SiS_VBType;
extern USHORT SiS_VBExtInfo;
extern USHORT SiS_LCDResInfo;
extern USHORT SiS_LCDTypeInfo;
extern USHORT SiS_LCDInfo;
extern USHORT SiS_HiVision;
extern BOOLEAN SiS_SearchVBModeID(UCHAR *RomAddr, USHORT *);
#if 0
extern const USHORT SiS_MDA_DAC[];
extern const USHORT SiS_CGA_DAC[];
extern const USHORT SiS_EGA_DAC[];
extern const USHORT SiS_VGA_DAC[];
#endif
BOOLEAN SiS_Is301B(USHORT BaseAddr);
BOOLEAN SiS_IsDisableCRT2(USHORT BaseAddr);
BOOLEAN SiS_IsVAMode(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsDualEdge(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_CRT2IsLCD(USHORT BaseAddr);
extern BOOLEAN SiS_SearchVBModeID(SiS_Private *SiS_Pr, UCHAR *RomAddr, USHORT *);
void SiS_SetDefCRT2ExtRegs(USHORT BaseAddr);
USHORT SiS_GetRatePtrCRT2(UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
BOOLEAN SiS_AdjustCRT2Rate(UCHAR *ROMAddr,USHORT ModeNo,USHORT MODEIdIndex,USHORT RefreshRateTableIndex,USHORT *i);
void SiS_SaveCRT2Info(USHORT ModeNo);
void SiS_GetCRT2Data(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2DataLVDS(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2PtrA(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
USHORT *CRT2Index,USHORT *ResIndex);
void SiS_GetCRT2Part2Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index,
USHORT *ResIndex);
void SiS_GetCRT2Data301(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetResInfo(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_GetCRT2ResInfo(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetRAMDAC2DATA(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
BOOLEAN SiS_Is301B(SiS_Private *SiS_Pr, USHORT BaseAddr);
BOOLEAN SiS_IsNotM650or651(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsDisableCRT2(SiS_Private *SiS_Pr, USHORT BaseAddr);
BOOLEAN SiS_IsVAMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsDualEdge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_CRT2IsLCD(SiS_Private *SiS_Pr, USHORT BaseAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetDefCRT2ExtRegs(SiS_Private *SiS_Pr, USHORT BaseAddr);
USHORT SiS_GetRatePtrCRT2(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
USHORT *CRT2Index,USHORT *ResIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2ModeRegs(USHORT BaseAddr,USHORT ModeNo,USHORT ModeIdIndex, PSIS_HW_DEVICE_INFO );
void SiS_SetHiVision(USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesData(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
BOOLEAN SiS_AdjustCRT2Rate(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT MODEIdIndex,
USHORT RefreshRateTableIndex,USHORT *i,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SaveCRT2Info(SiS_Private *SiS_Pr, USHORT ModeNo);
void SiS_GetCRT2Data(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2PtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex);
void SiS_GetCRT2Part2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index, USHORT *ResIndex);
void SiS_GetCRT2Data301(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_GetCRT2ResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2Offset(USHORT Part1Port,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_GetRAMDAC2DATA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetCRT2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *CRT2Index,USHORT *ResIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2ModeRegs(SiS_Private *SiS_Pr, USHORT BaseAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO );
void SiS_SetHiVision(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesData(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2Offset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetOffset(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetColorDepth(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
USHORT SiS_GetMCLK(UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_CalcDelayVB(void);
USHORT SiS_GetVCLK2Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT SiS_GetOffset(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_GetColorDepth(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
USHORT SiS_GetMCLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
USHORT SiS_CalcDelayVB(SiS_Private *SiS_Pr);
USHORT SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2Sync(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2Sync(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetRegANDOR(USHORT Port,USHORT Index,USHORT DataAND,USHORT DataOR);
void SiS_SetRegOR(USHORT Port,USHORT Index,USHORT DataOR);
void SiS_SetRegAND(USHORT Port,USHORT Index,USHORT DataAND);
USHORT SiS_GetVGAHT2(void);
void SiS_SetGroup2(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT SiS_GetVGAHT2(SiS_Private *SiS_Pr);
void SiS_Set300Part2Regs(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT ModeIdIndex, USHORT RefreshRateTableIndex,
USHORT BaseAddr, USHORT ModeNo);
void SiS_SetGroup2(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup3(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_SetGroup3(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup4(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_SetGroup4(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup5(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_SetCRT2VCLK(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_EnableCRT2(void);
void SiS_LoadDAC2(UCHAR *ROMAddr,USHORT Part5Port,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_WriteDAC2(USHORT Pdata,USHORT dl, USHORT ah, USHORT al, USHORT dh);
void SiS_GetVBInfo301(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_GetLCDResInfo(UCHAR *ROMAddr,USHORT P3d4,USHORT ModeNo,USHORT ModeIdIndex);
BOOLEAN SiS_BridgeIsOn(USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_BridgeIsEnable(USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_BridgeInSlave(void);
void SiS_PresetScratchregister(USHORT SiS_P3d4,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetTVSystem(VOID);
void SiS_LongWait(VOID);
USHORT SiS_GetQueueConfig(VOID);
void SiS_VBLongWait(VOID);
USHORT SiS_GetVCLKLen(UCHAR *ROMAddr);
void SiS_WaitVBRetrace(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetrace1(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetrace2(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCRT2ECLK(UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
void SiS_SetGroup5(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex);
void SiS_FinalizeLCD(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesPtr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
USHORT *PanelIndex,USHORT *ResIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesPtrA(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
USHORT *PanelIndex,USHORT *ResIndex);
void SiS_SetTPData(VOID);
void SiS_ModCRT1CRTC(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiS_GetLVDSCRT1Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex,
USHORT *ResInfo,USHORT *DisplayType);
void SiS_SetCHTVReg(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex);
void SiS_GetCHTVRegPtr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,USHORT RefreshRateTableIndex);
void SiS_SetCH700x(USHORT tempax);
USHORT SiS_GetCH700x(USHORT tempax);
void SiS_SetCH701x(USHORT tempax);
USHORT SiS_GetCH701x(USHORT tempax);
void SiS_SetCH70xx(USHORT tempax);
USHORT SiS_GetCH70xx(USHORT tempax);
void SiS_SetCH70xxANDOR(USHORT tempax,USHORT tempbh);
void SiS_SetSwitchDDC2(void);
USHORT SiS_SetStart(void);
USHORT SiS_SetStop(void);
void SiS_DDC2Delay(USHORT delaytime);
USHORT SiS_SetSCLKLow(void);
USHORT SiS_SetSCLKHigh(void);
USHORT SiS_ReadDDC2Data(USHORT tempax);
USHORT SiS_WriteDDC2Data(USHORT tempax);
USHORT SiS_CheckACK(void);
void SiS_SetCRT2VCLK(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_EnableCRT2(SiS_Private *SiS_Pr);
void SiS_GetVBInfo(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension, int checkcrt2mode);
BOOLEAN SiS_BridgeIsOn(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_BridgeIsEnable(SiS_Private *SiS_Pr, USHORT BaseAddr,PSIS_HW_DEVICE_INFO);
BOOLEAN SiS_BridgeInSlave(SiS_Private *SiS_Pr);
void SiS_PresetScratchregister(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetTVSystem(SiS_Private *SiS_Pr);
void SiS_LongWait(SiS_Private *SiS_Pr);
USHORT SiS_GetQueueConfig(SiS_Private *SiS_Pr);
void SiS_VBLongWait(SiS_Private *SiS_Pr);
USHORT SiS_GetVCLKLen(SiS_Private *SiS_Pr, UCHAR *ROMAddr);
void SiS_WaitVBRetrace(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetrace1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetrace2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_WaitRetraceDDC(SiS_Private *SiS_Pr);
void SiS_SetCRT2ECLK(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_GetLVDSDesPtrA(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *PanelIndex,USHORT *ResIndex);
void SiS_SetTPData(SiS_Private *SiS_Pr);
void SiS_WhatIsThis(SiS_Private *SiS_Pr, USHORT myvbinfo);
void SiS_ModCRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetCHTVReg(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex);
void SiS_GetCHTVRegPtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex);
void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempax);
void SiS_SetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_GetCH70xx(SiS_Private *SiS_Pr, USHORT tempax);
#ifdef LINUX_XF86
USHORT SiS_I2C_GetByte(SiS_Private *SiS_Pr);
Bool SiS_I2C_PutByte(SiS_Private *SiS_Pr, USHORT data);
Bool SiS_I2C_Address(SiS_Private *SiS_Pr, USHORT addr);
void SiS_I2C_Stop(SiS_Private *SiS_Pr);
#endif
void SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
void SiS_SetSwitchDDC2(SiS_Private *SiS_Pr);
USHORT SiS_SetStart(SiS_Private *SiS_Pr);
USHORT SiS_SetStop(SiS_Private *SiS_Pr);
void SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
USHORT SiS_SetSCLKLow(SiS_Private *SiS_Pr);
USHORT SiS_SetSCLKHigh(SiS_Private *SiS_Pr);
USHORT SiS_ReadDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_WriteDDC2Data(SiS_Private *SiS_Pr, USHORT tempax);
USHORT SiS_CheckACK(SiS_Private *SiS_Pr);
USHORT SiS_ReadLCDDDC(SiS_Private *SiS_Pr, USHORT length, unsigned char *buffer);
#ifdef LINUX_XF86
USHORT SiS_SenseLCDDDC(SiS_Private *SiS_Pr, SISPtr pSiS);
USHORT SiS_SenseVGA2DDC(SiS_Private *SiS_Pr, SISPtr pSiS);
#endif
#ifdef SIS315H
void SiS_OEM310Setting(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
void SiS_OEM310Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SiS_OEMLCD(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
void SiS_OEMLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
#endif
#ifdef SIS300
void SiS_OEM300Setting(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
void SiS_OEM300Setting(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo);
#endif
USHORT GetRevisionID(PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_LowModeStuff(USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_LowModeStuff(SiS_Private *SiS_Pr, USHORT ModeNo,PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_GetLCDResInfo301(UCHAR *ROMAddr,USHORT SiS_P3d4, USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
/* void SiS_CHACRT1CRTC(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
BOOLEAN SiS_GetLCDResInfo(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo, USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
/* void SiS_CHACRT1CRTC(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex); */
BOOLEAN SiS_GetLCDACRT1Ptr(UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,
USHORT *DisplayType);
/* 310 series OEM */
USHORT GetLCDPtrIndex (void);
USHORT GetTVPtrIndex(void);
void SetDelayComp(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo);
void SetAntiFlicker(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetEdgeEnhance (PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetYFilter(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetPhaseIncr(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo);
/* 300 series OEM */
USHORT GetOEMLCDPtr(PSIS_HW_DEVICE_INFO HwDeviceExtension, int Flag);
USHORT GetOEMTVPtr(void);
void SetOEMTVDelay(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetOEMLCDDelay(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetOEMAntiFlicker(PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetOEMPhaseIncr(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
void SetOEMYFilter(PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT BaseAddr,
UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex);
extern void SiS_SetReg1(USHORT, USHORT, USHORT);
extern void SiS_SetReg3(USHORT, USHORT);
extern UCHAR SiS_GetReg1(USHORT, USHORT);
extern UCHAR SiS_GetReg2(USHORT);
extern BOOLEAN SiS_SearchModeID(UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
extern BOOLEAN SiS_GetRatePtr(ULONG, USHORT);
extern void SiS_SetReg4(USHORT, ULONG);
extern ULONG SiS_GetReg3(USHORT);
extern void SiS_DisplayOff(void);
extern void SiS_DisplayOn(void);
extern UCHAR SiS_GetModePtr(UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
#ifdef SIS315H
extern UCHAR SiS_Get310DRAMType(UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
#endif
BOOLEAN SiS_SetCRT2Group301(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
BOOLEAN SiS_SetCRT2Group301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SetGroup1(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_SetGroup1(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
void SiS_SetGroup1_LVDS(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_SetGroup1_LVDS(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
void SiS_SetGroup1_LCDA(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);/*301b*/
void SiS_SetGroup1_301(USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
void SiS_SetGroup1_LCDA(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
void SiS_SetGroup1_301(SiS_Private *SiS_Pr, USHORT BaseAddr,UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
PSIS_HW_DEVICE_INFO HwDeviceExtension,USHORT RefreshRateTableIndex);
#ifdef SIS300
void SiS_SetCRT2FIFO_300(UCHAR *ROMAddr,USHORT ModeNo,
void SiS_SetCRT2FIFO_300(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
#endif
#ifdef SIS315H
void SiS_SetCRT2FIFO_310(UCHAR *ROMAddr,USHORT ModeNo,
void SiS_SetCRT2FIFO_310(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,
PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_CRT2AutoThreshold(USHORT BaseAddr);
void SiS_CRT2AutoThreshold(SiS_Private *SiS_Pr, USHORT BaseAddr);
#endif
BOOLEAN SiS_GetLCDDDCInfo(PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_UnLockCRT2(PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_LockCRT2(PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_DisableBridge(PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_EnableBridge(PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_SetPanelDelay(UCHAR* ROMAddr,PSIS_HW_DEVICE_INFO,USHORT DelayTime);
void SiS_ShortDelay(USHORT delay);
void SiS_LongDelay(USHORT delay);
void SiS_GenericDelay(USHORT delay);
void SiS_VBWait(void);
BOOLEAN SiS_GetLCDDDCInfo(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_UnLockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_LockCRT2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_DisableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_EnableBridge(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO,USHORT BaseAddr);
void SiS_SetPanelDelay(SiS_Private *SiS_Pr, UCHAR* ROMAddr,PSIS_HW_DEVICE_INFO,USHORT DelayTime);
void SiS_SetPanelDelayLoop(SiS_Private *SiS_Pr, UCHAR *ROMAddr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT DelayTime, USHORT DelayLoop);
void SiS_ShortDelay(SiS_Private *SiS_Pr, USHORT delay);
void SiS_LongDelay(SiS_Private *SiS_Pr, USHORT delay);
void SiS_GenericDelay(SiS_Private *SiS_Pr, USHORT delay);
void SiS_VBWait(SiS_Private *SiS_Pr);
void SiS_SiS30xBLOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
void SiS_SiS30xBLOff(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
/* TW: New functions (with temporary names) */
void SiS_Chrontel701xOn(void);
void SiS_Chrontel701xOn2(PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT BaseAddr);
void SiS_Chrontel701xOff(void);
void SiS_Chrontel701xOff2(void);
void SiS_ChrontelFlip0x48(void);
void SiS_ChrontelDoSomething4(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething3(USHORT ModeNo, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething2(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething1(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_WeHaveBacklightCtrl(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
/* TW: New functions (with mostly temporary names) */
void SiS_Chrontel701xBLOn(SiS_Private *SiS_Pr);
void SiS_Chrontel701xOn(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
USHORT BaseAddr);
void SiS_Chrontel701xBLOff(SiS_Private *SiS_Pr);
void SiS_Chrontel701xOff(SiS_Private *SiS_Pr);
void SiS_ChrontelResetDB(SiS_Private *SiS_Pr);
void SiS_ChrontelDoSomething4(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething3(SiS_Private *SiS_Pr, USHORT ModeNo, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething2(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelDoSomething1(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_WeHaveBacklightCtrl(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
#if 0
BOOLEAN SiS_IsSomethingCR5F(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsSomethingCR5F(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
#endif
BOOLEAN SiS_IsYPbPr(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsTVOrSomething(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsLCDOrLCDA(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_SetCHTVForLCD(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_Chrontel19f2(void);
BOOLEAN SiS_CR36BIOSWord23b(PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_CR36BIOSWord23d(PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_IsSR13_CR30(PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_IsYPbPr(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsChScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsTVOrYPbPrOrScart(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
BOOLEAN SiS_IsLCDOrLCDA(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_SetCH701xForLCD(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT BaseAddr);
void SiS_ChrontelPowerSequencing(SiS_Private *SiS_Pr);
BOOLEAN SiS_CR36BIOSWord23b(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_CR36BIOSWord23d(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
BOOLEAN SiS_IsSR13_CR30(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
/* TW end */
extern void SiS_SetReg1(USHORT, USHORT, USHORT);
extern void SiS_SetReg3(USHORT, USHORT);
extern UCHAR SiS_GetReg1(USHORT, USHORT);
extern UCHAR SiS_GetReg2(USHORT);
extern BOOLEAN SiS_SearchModeID(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT *ModeNo,USHORT *ModeIdIndex);
extern BOOLEAN SiS_GetRatePtr(SiS_Private *SiS_Pr, ULONG, USHORT);
extern void SiS_SetReg4(USHORT, ULONG);
extern ULONG SiS_GetReg3(USHORT);
extern void SiS_SetReg5(USHORT, USHORT);
extern USHORT SiS_GetReg4(USHORT);
extern void SiS_DisplayOff(SiS_Private *SiS_Pr);
extern void SiS_DisplayOn(SiS_Private *SiS_Pr);
extern UCHAR SiS_GetModePtr(SiS_Private *SiS_Pr, UCHAR *ROMAddr, USHORT ModeNo,USHORT ModeIdIndex);
extern BOOLEAN SiS_GetLCDACRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
extern BOOLEAN SiS_GetLVDSCRT1Ptr(SiS_Private *SiS_Pr, UCHAR *ROMAddr,USHORT ModeNo,USHORT ModeIdIndex,
USHORT RefreshRateTableIndex,USHORT *ResInfo,USHORT *DisplayType);
extern void SiS_LoadDAC(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO, UCHAR *ROMAddr,USHORT ModeNo,
USHORT ModeIdIndex);
#ifdef SIS315H
extern UCHAR SiS_Get310DRAMType(SiS_Private *SiS_Pr, UCHAR *ROMAddr,PSIS_HW_DEVICE_INFO HwDeviceExtension);
#endif
#ifdef LINUX_XF86
/* DDC functions */
USHORT SiS_InitDDCRegs(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum, USHORT DDCdatatype, BOOLEAN checkcr32);
USHORT SiS_WriteDABDDC(SiS_Private *SiS_Pr);
USHORT SiS_PrepareReadDDC(SiS_Private *SiS_Pr);
USHORT SiS_PrepareDDC(SiS_Private *SiS_Pr);
void SiS_SendACK(SiS_Private *SiS_Pr, USHORT yesno);
USHORT SiS_DoProbeDDC(SiS_Private *SiS_Pr);
USHORT SiS_ProbeDDC(SiS_Private *SiS_Pr);
USHORT SiS_ReadDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT DDCdatatype, unsigned char *buffer);
USHORT SiS_HandleDDC(SiS_Private *SiS_Pr, SISPtr pSiS, USHORT adaptnum,
USHORT DDCdatatype, unsigned char *buffer);
#endif
const UCHAR SiS_HiVisionTable[3][64] = {
{
0x17, 0x1d, 0x03, 0x09, 0x05, 0x06, 0x0c, 0x0c,
0x94, 0x49, 0x01, 0x0a, 0x06, 0x0d, 0x04, 0x0a,
0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x1b,
0x0c, 0x50, 0x00, 0x97, 0x00, 0xd4, 0x4a, 0x17,
0x7d, 0x05, 0x4b, 0x00, 0x00, 0xe2, 0x00, 0x02,
0x03, 0x0a, 0x65, 0x9d, 0x08, 0x92, 0x8f, 0x40,
0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x14, 0x53,
0x00, 0x40, 0x44, 0x00, 0xdb, 0x02, 0x3b, 0x00
},
{
0x1d, 0x1d, 0x06, 0x09, 0x0b, 0x0c, 0x0c, 0x0c,
0x98, 0x0a, 0x01, 0x0d, 0x06, 0x0d, 0x04, 0x0a,
0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f,
0x0c, 0x50, 0xb2, 0x2e, 0x16, 0xb5, 0xf4, 0x03,
0x7d, 0x11, 0x7d, 0xea, 0x30, 0x36, 0x18, 0x96,
0x21, 0x0a, 0x58, 0xee, 0x42, 0x92, 0x0f, 0x40,
0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x04, 0xf3,
0x00, 0x40, 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00
},
{
0x13, 0x1d, 0xe8, 0x09, 0x09, 0xed, 0x0c, 0x0c,
0x98, 0x0a, 0x01, 0x0c, 0x06, 0x0d, 0x04, 0x0a,
0x06, 0x14, 0x0d, 0x04, 0x0a, 0x00, 0x85, 0x3f,
0xed, 0x50, 0x70, 0x9f, 0x16, 0x59, 0x2b, 0x13,
0x27, 0x0b, 0x27, 0xfc, 0x30, 0x27, 0x1c, 0xb0,
0x4b, 0x4b, 0x6f, 0x2f, 0x63, 0x92, 0x0f, 0x40,
0x60, 0x80, 0x14, 0x90, 0x8c, 0x60, 0x14, 0x2a,
0x00, 0x40, 0x11, 0x00, 0xfc, 0xff, 0x32, 0x00
}
};
const UCHAR SiS_HiTVGroup3_1[] = {
0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x13,
0xb1, 0x41, 0x62, 0x62, 0xff, 0xf4, 0x45, 0xa6,
0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
0xac, 0xda, 0x60, 0xfe, 0x6a, 0x9a, 0x06, 0x10,
0xd1, 0x04, 0x18, 0x0a, 0xff, 0x80, 0x00, 0x80,
0x3b, 0x77, 0x00, 0xef, 0xe0, 0x10, 0xb0, 0xe0,
0x10, 0x4f, 0x0f, 0x0f, 0x05, 0x0f, 0x08, 0x6e,
0x1a, 0x1f, 0x25, 0x2a, 0x4c, 0xaa, 0x01
};
const UCHAR SiS_HiTVGroup3_2[] = {
0x00, 0x14, 0x15, 0x25, 0x55, 0x15, 0x0b, 0x7a,
0x54, 0x41, 0xe7, 0xe7, 0xff, 0xf4, 0x45, 0xa6,
0x25, 0x2f, 0x67, 0xf6, 0xbf, 0xff, 0x8e, 0x20,
0xac, 0x6a, 0x60, 0x2b, 0x52, 0xcd, 0x61, 0x10,
0x51, 0x04, 0x18, 0x0a, 0x1f, 0x80, 0x00, 0x80,
0xff, 0xa4, 0x04, 0x2b, 0x94, 0x21, 0x72, 0x94,
0x26, 0x05, 0x01, 0x0f, 0xed, 0x0f, 0x0a, 0x64,
0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01
};
#endif
......@@ -15,8 +15,19 @@
#define VB_SIS302B 0x0004
#define VB_SIS301LV 0x0008
#define VB_SIS302LV 0x0010
#define VB_SIS30xLV VB_SIS301LV
#define VB_SIS30xNEW VB_SIS302LV
#define VB_NoLCD 0x8000
#define VB_SIS301BLV302BLV (VB_SIS301B|VB_SIS302B|VB_SIS301LV|VB_SIS302LV)
#define VB_SIS301B302B (VB_SIS301B|VB_SIS302B)
#define VB_SIS301LV302LV (VB_SIS301LV|VB_SIS302LV)
#define IS_SIS650740 ((HwDeviceExtension->jChipType >= SIS_650) && (HwDeviceExtension->jChipType < SIS_330))
#define IS_SIS650 (HwDeviceExtension->jChipType == SIS_650)
#define IS_SIS740 (HwDeviceExtension->jChipType == SIS_740)
#define IS_SIS330 (HwDeviceExtension->jChipType == SIS_330)
#define IS_SIS550 (HwDeviceExtension->jChipType == SIS_550)
#define CRT1Len 17
#define LVDSCRT1Len 15
......@@ -35,9 +46,9 @@
#define ModeInfoFlag 0x07
#define IsTextMode 0x07
#define DACInfoFlag 0x18
#define MemoryInfoFlag 0x1E0
#define MemorySizeShift 0x05
#define DACInfoFlag 0x0018
#define MemoryInfoFlag 0x01E0
#define MemorySizeShift 5
/* modeflag */
#define Charx8Dot 0x0200
......@@ -57,8 +68,9 @@
#define NoSupportHiVisionTV 0x0060
#define NoSupportLCD 0x0058
#define SupportCHTV 0x0800
#define SupportTV1024 0x0800 /*301b*/
#define SupportTV1024 0x0800
#define InterlaceMode 0x0080
#define SupportHiVisionTV2 0x1000
#define SyncPP 0x0000
#define SyncPN 0x4000
#define SyncNP 0x8000
......@@ -72,13 +84,13 @@
/* VBInfo */
#define SetSimuScanMode 0x0001 /* CR 30 */
#define SwitchToCRT2 0x0002
#define SetCRT2ToTV 0x009C
#define SetCRT2ToAVIDEO 0x0004
#define SetCRT2ToSVIDEO 0x0008
#define SetCRT2ToSCART 0x0010
#define SetCRT2ToLCD 0x0020
#define SetCRT2ToRAMDAC 0x0040
#define SetCRT2ToHiVisionTV 0x0080
#define SetCRT2ToTV 0x009C /* alias */
#define SetNTSCTV 0x0000 /* CR 31 */
#define SetPALTV 0x0100
#define SetInSlaveMode 0x0200
......@@ -92,6 +104,7 @@
#define DriverMode 0x4000
#define HotKeySwitch 0x8000 /* TW: ? */
#define SetCRT2ToLCDA 0x8000
#define PanelRGB18Bit 0x0100
#define PanelRGB24Bit 0x0000
......@@ -126,12 +139,12 @@
010 LVDS
011 LVDS + Chrontel 7019
All other combinations reserved
[4] LVDS: Expanding(0)/Non-expanding(1) LCD display
30x: SiS30x(0)/LCD monitor(1) scaling display
[4] LVDS: 0: Panel Link expands / 1: Panel Link does not expand
30x: 0: Bridge scales / 1: Bridge does not scale = Panel scales (if possible)
[5] LCD polarity select
0: VESA DMT Standard
1: EDID 2.x defined
[6] LCD honrizontal polarity select
[6] LCD horizontal polarity select
0: High active
1: Low active
[7] LCD vertical polarity select
......@@ -139,12 +152,37 @@
1: Low active
*/
#define EnableDualEdge 0x01 /* CR38 (310/325 series) */
/* #define PAL_NTSC 0x01 (only on 315PRO) */
#define SetToLCDA 0x02 /* TW: LCD channel A (302 only) */
#define SetYPbPr 0x10 /* TW: ? */
#define EnablePALMN 0x40
#define EnablePALN 0x80
/* CR37: LCDInfo */
#define LCDRGB18Bit 0x0001
#define LCDNonExpanding 0x0010
#define DontExpandLCD LCDNonExpanding
#define LCDNonExpandingShift 4
#define DontExpandLCDShift LCDNonExpandingShift
#define LCDSync 0x0020
#define LCDPass11 0x0100
#define LCDSyncBit 0x00e0
#define LCDSyncShift 6
/* CR38 (310/325 series) */
#define EnableDualEdge 0x01
#define SetToLCDA 0x02 /* LCD channel A (302B/LV and 650+LVDS only) */
#define EnableSiSHiVision 0x04 /* HiVision (HDTV) on SiS bridge */
#define EnableLVDSScart 0x04 /* Scart on Ch7019 (unofficial definition - TW) */
#define EnableLVDSHiVision 0x08 /* YPbPr color format (480i HDTV); only on 650/Ch7019 systems */
#define SiSHiVision1 0x10 /* See SetHiVision() */
#define SiSHiVision2 0x20
#define EnablePALM 0x40 /* 1 = Set PALM */
#define EnablePALN 0x80 /* 1 = Set PALN */
#define SetSCARTOutput 0x01
#define BoardTVType 0x02
#define EnablePALMN 0x40 /* Romflag: 1 = Allow PALM/PALN */
/* CR39 (650) */
#define LCDPass1_1 0x01 /* LVDS only; set by driver to pass 1:1 data to LVDS output */
#define Enable302LV_DualLink 0x04 /* 30xNEW (302LV) only; set by mode switching function */
/* CR79 (310/325 series only)
[3-0] Notify driver
......@@ -155,16 +193,15 @@
0101 Set Contrast event
0110 Set Mute event
0111 Set Volume Up/Down event
[4] Enable Backlight Control by BIOS/driver (set by driver)
[4] Enable Backlight Control by BIOS/driver
(set by driver; set means that the BIOS should
not touch the backlight registers because eg.
the driver already switched off the backlight)
[5] PAL/NTSC (set by BIOS)
[6] Expansion On/Off (set by BIOS)
[6] Expansion On/Off (set by BIOS; copied to CR32[4])
[7] TV UnderScan/OverScan (set by BIOS)
*/
#define SetSCARTOutput 0x01
#define BoardTVType 0x02
/* SetFlag */
#define ProgrammingCRT2 0x01
#define TVSimuMode 0x02
......@@ -173,8 +210,7 @@
#define EnableLVDSDDA 0x10
#define SetDispDevSwitchFlag 0x20
#define CheckWinDos 0x40
#define SetJDOSMode 0x80
#define CRT2IsVGA 0x80 /* TW: Not sure about this name... */
#define SetDOSMode 0x80
/* LCDResInfo */
#define Panel300_800x600 0x01 /* CR36 */
......@@ -184,7 +220,6 @@
#define Panel300_640x480 0x05
#define Panel300_1024x600 0x06
#define Panel300_1152x768 0x07
/* #define Panel300_1600x1200 0x06 OLD */
#define Panel300_320x480 0x08 /* fstn - TW: This is fake, can be any */
#define Panel310_800x600 0x01
......@@ -194,35 +229,40 @@
#define Panel310_1024x600 0x05
#define Panel310_1152x864 0x06
#define Panel310_1280x960 0x07
#define Panel310_1152x768 0x08
#define Panel310_1152x768 0x08 /* LVDS only */
#define Panel310_1400x1050 0x09
#define Panel310_1280x768 0x0a
#define Panel310_1280x768 0x0a /* LVDS only */
#define Panel310_1600x1200 0x0b
#define Panel310_320x480 0x0c /* fstn - TW: This is fake, can be any */
#define Panel310_320x480 0x0c /* fstn - TW: This is fake, can be any */
#define Panel_800x600 0x01 /* Unified values */
#define Panel_1024x768 0x02
#define Panel_1280x1024 0x03
#define Panel_640x480 0x04
#define Panel_1024x600 0x05
#define Panel_1152x864 0x06
#define Panel_1280x960 0x07
#define Panel_1152x768 0x08 /* LVDS only */
#define Panel_1400x1050 0x09
#define Panel_1280x768 0x0a /* LVDS only */
#define Panel_1600x1200 0x0b
#define Panel_320x480 0x0c /* fstn - TW: This is fake, can be any */
#define ExtChipType 0x0e
#define ExtChip301 0x02
#define ExtChipLVDS 0x04
#define ExtChipTrumpion 0x06
#define ExtChipCH7005 0x08
#define ExtChipMitacTV 0x0a /* TW: Incorrect, 0x0a = Chrontel 7005 only */
#define IsM650 0x80 /* TW: CR5F */
#define ExtChipMitacTV 0x0a /* TW: Incorrect, 0x0a = Chrontel 7005 only */
/* LCDInfo */
#define LCDRGB18Bit 0x01
#define LCDNonExpandingShift 0x04
#define LCDNonExpanding 0x10
#define LCDSync 0x20
/* TW: What is.. */ /* 0x100 */
#define LCDSyncBit 0xe0
#define LCDSyncShift 6
#define IsM650 0x80 /* TW: CR5F */
#define LCDDataLen 8
#define HiTVDataLen 12
#define TVDataLen 16
#define SetPALTV 0x0100
#define HalfDCLK 0x1000 /* modeflag */
#define NTSCHT 1716
#define NTSC2HT 1920
#define NTSCVT 525
......
/* OEM Data for 300 series */
UCHAR SiS300_OEMTVDelay301[8][4] =
const UCHAR SiS300_OEMTVDelay301[8][4] =
{
{0x08,0x08,0x08,0x08},
{0x08,0x08,0x08,0x08},
......@@ -13,7 +13,7 @@ UCHAR SiS300_OEMTVDelay301[8][4] =
{0x20,0x20,0x20,0x20}
};
UCHAR SiS300_OEMTVDelayLVDS[8][4] =
const UCHAR SiS300_OEMTVDelayLVDS[8][4] =
{
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -25,7 +25,7 @@ UCHAR SiS300_OEMTVDelayLVDS[8][4] =
{0x20,0x20,0x20,0x20}
};
UCHAR SiS300_OEMTVFlicker[8][4] =
const UCHAR SiS300_OEMTVFlicker[8][4] =
{
{0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00},
......@@ -38,7 +38,7 @@ UCHAR SiS300_OEMTVFlicker[8][4] =
};
#if 0 /* TW: Not used */
UCHAR SiS300_OEMLCDDelay1[12][4]={
const UCHAR SiS300_OEMLCDDelay1[12][4]={
{0x2c,0x2c,0x2c,0x2c},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -55,7 +55,7 @@ UCHAR SiS300_OEMLCDDelay1[12][4]={
#endif
/* TW: From 630/301B BIOS */
UCHAR SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */
const UCHAR SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */
{
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -123,9 +123,99 @@ UCHAR SiS300_OEMLCDDelay2[64][4] = /* for 301/301b/302b/301LV/302LV */
{0x20,0x20,0x20,0x20}
};
/* TW: From 300/301LV BIOS */
const UCHAR SiS300_OEMLCDDelay4[12][4] =
{
{0x2c,0x2c,0x2c,0x2c},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x2c,0x2c,0x2c,0x2c},
{0x2c,0x2c,0x2c,0x2c},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x24,0x24,0x24,0x24},
{0x24,0x24,0x24,0x24},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x24,0x24,0x24,0x24}
};
/* TW: From 300/301LV BIOS */
const UCHAR SiS300_OEMLCDDelay5[32][4] =
{
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
};
/* TW: Added for LVDS */
UCHAR SiS300_OEMLCDDelay3[32][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20}, /* --- Expanding panels */
const UCHAR SiS300_OEMLCDDelay3[64][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -137,11 +227,8 @@ UCHAR SiS300_OEMLCDDelay3[32][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x04,0x04,0x04,0x04}, /* Clevo 2202 (PanelType 12); Mitac needs 0x20! */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20}, /* Uniwill N241S2 (PanelType 14)*/
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20}, /* ---- NonExpanding panels */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
......@@ -153,13 +240,12 @@ UCHAR SiS300_OEMLCDDelay3[32][4] = { /* For LVDS */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x04,0x04,0x04,0x04}, /* Gericom 2200C (PanelType 28) */
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20},
{0x20,0x20,0x20,0x20}
};
UCHAR SiS300_Phase1[8][6][4] =
const UCHAR SiS300_Phase1[8][6][4] =
{
{
{0x21,0xed,0x00,0x08},
......@@ -228,7 +314,7 @@ UCHAR SiS300_Phase1[8][6][4] =
};
UCHAR SiS300_Phase2[8][6][4] =
const UCHAR SiS300_Phase2[8][6][4] =
{
{
{0x21,0xed,0x00,0x08},
......@@ -296,7 +382,7 @@ UCHAR SiS300_Phase2[8][6][4] =
}
};
UCHAR SiS300_Filter1[10][17][4] =
const UCHAR SiS300_Filter1[10][16][4] =
{
{
{0x00,0xf4,0x10,0x38},
......@@ -314,8 +400,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xff,0xff,0xff,0xff}
{0xeb,0x04,0x25,0x18}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -333,8 +418,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xff,0xff,0xff,0xff}
{0xf1,0xf7,0x1f,0x32}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -352,8 +436,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xff,0xff,0xff,0xff}
{0xf1,0xf7,0x1f,0x32}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -371,8 +454,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xff,0xff,0xff,0xff}
{0xf1,0xf7,0x1f,0x32}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -390,8 +472,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xff,0xff,0xff,0xff}
{0xeb,0x04,0x25,0x18}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -409,8 +490,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xff,0xff,0xff,0xff}
{0xf1,0xf7,0x1f,0x32}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -428,8 +508,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xff,0xff,0xff,0xff}
{0xf1,0xf7,0x1f,0x32}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -447,8 +526,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xf1,0xf7,0x1f,0x32},
{0xff,0xff,0xff,0xff}
{0xf1,0xf7,0x1f,0x32}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -466,8 +544,7 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xff,0xff,0xff,0xff}
{0xeb,0x04,0x25,0x18}
},
{
{0x00,0xf4,0x10,0x38},
......@@ -485,12 +562,11 @@ UCHAR SiS300_Filter1[10][17][4] =
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xff,0xff,0xff,0xff}
{0xeb,0x04,0x25,0x18}
},
};
UCHAR SiS300_Filter2[10][9][7] =
const UCHAR SiS300_Filter2[10][9][7] =
{
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
......@@ -604,3 +680,325 @@ UCHAR SiS300_Filter2[10][9][7] =
}
};
const UCHAR SiS300_LCDHData[24][11][5] = {
{
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x8e,0x18,0x28,0x78,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x4e,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x67,0x11,0x9a,0x56,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x67,0x91,0x84,0x5e,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x65,0xef,0x83,0x5c,0x00},
{0x8a,0x14,0x00,0x80,0x00},
{0x8a,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x67,0x91,0x84,0x5E,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x65,0xEF,0x83,0x5C,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
},
{
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x8E,0x18,0x28,0x78,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x4E,0x18,0x90,0x38,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x67,0x11,0x9A,0x56,0x00},
{0x8A,0x14,0x00,0x80,0x00},
{0x8A,0x14,0x00,0x80,0x00}
}
};
#if 0
const UCHAR SiS300_LCDVData[24][11][6] = {
{
{
},
};
#endif
/* OEM Data for 300 series */
/* OEM Data for 310/325/330 series */
UCHAR SiS310_CRT2DelayCompensation1 = 0x04; /* 301A */
const UCHAR SiS310_LCDDelayCompensation_301[] = /* 301 */
{
0x00,0x00,0x00, /* 800x600 */
0x0b,0x0b,0x0b, /* 1024x768 */
0x08,0x08,0x08, /* 1280x1024 */
0x00,0x00,0x00, /* 640x480 (unknown) */
0x00,0x00,0x00, /* 1024x600 (unknown) */
0x00,0x00,0x00, /* 1152x864 (unknown) */
0x08,0x08,0x08, /* 1280x960 (guessed) */
0x00,0x00,0x00, /* 1152x768 (unknown) */
0x08,0x08,0x08, /* 1400x1050 */
0x08,0x08,0x08, /* 1280x768 (guessed) */
0x00,0x00,0x00, /* 1600x1200 */
0x00,0x00,0x00, /* 320x480 (unknown) */
0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,0x00
};
/* This is contained in 650+301B BIOSes, but it is wrong - so we don't use it */
UCHAR SiS310_LCDDelayCompensation_650301B[] = /* 30xB,LV */
{
0x01,0x01,0x01, /* 800x600 */
0x01,0x01,0x01, /* 1024x768 */
0x01,0x01,0x01, /* 1280x1024 */
0x01,0x01,0x01, /* 640x480 (unknown) */
0x01,0x01,0x01, /* 1024x600 (unknown) */
0x01,0x01,0x01, /* 1152x864 (unknown) */
0x01,0x01,0x01, /* 1280x960 (guessed) */
0x01,0x01,0x01, /* 1152x768 (unknown) */
0x01,0x01,0x01, /* 1400x1050 */
0x01,0x01,0x01, /* 1280x768 (guessed) */
0x01,0x01,0x01, /* 1600x1200 */
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02
};
/* This data is correct, so we use it instead of the table above */
UCHAR SiS310_LCDDelayCompensation_3xx301B[] = /* 30xB,LV */
{
0x01,0x01,0x01, /* 800x600 */
0x0C,0x0C,0x0C, /* 1024x768 */
0x0C,0x0C,0x0C, /* 1280x1024 */
0x08,0x08,0x08, /* 640x480 */
0x0C,0x0C,0x0C, /* 1024x600 (guessed) */
0x0C,0x0C,0x0C, /* 1152x864 (guessed) */
0x0C,0x0C,0x0C, /* 1280x960 (guessed) */
0x0C,0x0C,0x0C, /* 1152x768 (guessed) */
0x0C,0x0C,0x0C, /* 1400x1050 (guessed) */
0x0C,0x0C,0x0C, /* 1280x768 (guessed) */
0x0C,0x0C,0x0C, /* 1600x1200 (guessed) */
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02,
0x02,0x02,0x02
};
UCHAR SiS310_LCDDelayCompensation1[] =
const UCHAR SiS310_LCDDelayCompensation_LVDS[] = /* LVDS */
{
0x00,0x00,0x00, /* 800x600 */
0x00,0x00,0x00, /* 1024x768 */
0x00,0x00,0x00, /* 1280x1024 */
0x00,0x00,0x00, /* 640x480 (unknown) */
0x00,0x00,0x00, /* 1024x600 (unknown) */
0x00,0x00,0x00, /* 1152x864 (unknown) */
0x00,0x00,0x00, /* 1280x960 (guessed) */
0x00,0x00,0x00, /* 1152x768 (unknown) */
0x00,0x00,0x00, /* 1400x1050 */
0x00,0x00,0x00, /* 1280x768 (guessed) */
0x00,0x00,0x00, /* 1600x1200 */
0x00,0x00,0x00,
0x0b,0x0b,0x0b,
0x08,0x08,0x08,
0x08,0x08,0x08,
0x00,0x00,0x00,
0x00,0x00,0x00,
0x00,0x00,0x00
};
UCHAR SiS310_TVDelayCompensation1[] =
const UCHAR SiS310_LCDDelayCompensation_651301LV[] = /* M650/651 301LV */
{
0x02,0x02, /* NTSC Enhanced, Standard */
0x02,0x02, /* PAL */
0x08,0x0b /* HiVision */
0x33,0x33,0x33, /* 800x600 (guessed) */
0x33,0x33,0x33, /* 1024x768 */
0x33,0x33,0x33, /* 1280x1024 */
0x33,0x33,0x33, /* 640x480 (unknown) */
0x33,0x33,0x33, /* 1024x600 (unknown) */
0x33,0x33,0x33, /* 1152x864 (unknown) */
0x33,0x33,0x33, /* 1280x960 (guessed) */
0x33,0x33,0x33, /* 1152x768 (unknown) */
0x33,0x33,0x33, /* 1400x1050 */
0x33,0x33,0x33, /* 1280x768 (guessed) */
0x33,0x33,0x33, /* 1600x1200 */
0x33,0x33,0x33,
0x33,0x33,0x33,
0x33,0x33,0x33,
0x33,0x33,0x33
};
UCHAR SiS310_CRT2DelayCompensation2 = 0x00; /* TW: From 650/301LV BIOS; was 0x0C; */ /* 301B */
const UCHAR SiS310_LCDDelayCompensation_651302LV[] = /* M650/651 302LV */
{
0x33,0x33,0x33, /* 800x600 (guessed) */
0x33,0x33,0x33, /* 1024x768 */
0x33,0x33,0x33, /* 1280x1024 */
0x33,0x33,0x33, /* 640x480 (unknown) */
0x33,0x33,0x33, /* 1024x600 (unknown) */
0x33,0x33,0x33, /* 1152x864 (unknown) */
0x33,0x33,0x33, /* 1280x960 (guessed) */
0x33,0x33,0x33, /* 1152x768 (unknown) */
0x33,0x33,0x33, /* 1400x1050 */
0x33,0x33,0x33, /* 1280x768 (guessed) */
0x33,0x33,0x33, /* 1600x1200 */
0x33,0x33,0x33,
0x33,0x33,0x33,
0x33,0x33,0x33,
0x33,0x33,0x33
};
const UCHAR SiS310_TVDelayCompensation_301[] = /* 301 */
{
0x02,0x02, /* NTSC Enhanced, Standard */
0x02,0x02, /* PAL */
0x08,0x0b /* HiVision */
};
UCHAR SiS310_LCDDelayCompensation2[] =
const UCHAR SiS310_TVDelayCompensation_301B[] = /* 30xB, 30xLV */
{
0x01,0x01,0x01, /* TW: From 650/301LV BIOS */
0x01,0x01,0x01,
0x01,0x01,0x01,
0x01,0x01,0x01,
0x01,0x01,0x01,
0x01,0x01,0x01,
0x01,0x01,0x01
#if 0
0x00,0x00,0x00, /* 800x600 VESA, non-VESA, non-expanding */
0x0C,0x0C,0x0C, /* 1024x768 */
0x0C,0x0C,0x0C, /* 1280x1024 */
0x08,0x08,0x08, /* 1280x960 */
0x00,0x00,0x00, /* 640x480 */
0x00,0x00,0x00, /* 1600x1200 */
0x00,0x00,0x00 /* 1920x1440 */
#endif
0x03,0x03,
0x03,0x03,
0x03,0x03
};
UCHAR SiS310_TVDelayCompensation2[] =
const UCHAR SiS310_TVDelayCompensation_740301B[] = /* 740 + 30xB (30xLV?) */
{
0x05,0x05, /* TW: From 650/301LV BIOS */
0x05,0x05,
0x05,0x05
#if 0
0x03,0x03, /* NTSC Enhanced, Standard */
0x03,0x03, /* PAL */
0x08,0x0b /* HiVision */
#endif
0x05,0x05,
0x05,0x05,
0x05,0x05
};
UCHAR SiS310_CRT2DelayCompensation3 = 0x00; /* LVDS */
const UCHAR SiS310_TVDelayCompensation_LVDS[] = /* LVDS */
{
0x0a,0x0a,
0x0a,0x0a,
0x0a,0x0a
};
UCHAR SiS310_LCDDelayCompensation3[] =
const UCHAR SiS310_TVDelayCompensation_651301LV[] = /* M650, 651, 301LV */
{
0x00,0x00,0x00, /* 800x600 */
0x00,0x00,0x00, /* 1024x768 */
0x00,0x00,0x00, /* 1280x1024 */
0x00,0x00,0x00, /* 1400x1050 */
0x00,0x00,0x00 /* 1600x1200 */
0x33,0x33,
0x33,0x33,
0x33,0x33
};
UCHAR SiS310_TVDelayCompensation3[] =
const UCHAR SiS310_TVDelayCompensation_651302LV[] = /* M650, 651, 302LV */
{
0x0a,0x0a,
0x0a,0x0a,
0x0a,0x0a
0x33,0x33,
0x33,0x33,
0x33,0x33
};
UCHAR SiS310_TVAntiFlick1[3][2] =
const UCHAR SiS310_TVAntiFlick1[3][2] =
{
{0x4,0x0},
{0x4,0x8},
{0x0,0x0}
};
UCHAR SiS310_TVEdge1[3][2] =
const UCHAR SiS310_TVEdge1[3][2] =
{
{0x0,0x4},
{0x0,0x4},
{0x0,0x0}
};
UCHAR SiS310_TVYFilter1[3][8][4] =
const UCHAR SiS310_TVYFilter1[3][8][4] =
{
{
{0x00,0xf4,0x10,0x38},
......@@ -121,7 +207,7 @@ UCHAR SiS310_TVYFilter1[3][8][4] =
}
};
UCHAR SiS310_TVYFilter2[3][9][7] =
const UCHAR SiS310_TVYFilter2[3][9][7] =
{
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
......@@ -135,7 +221,7 @@ UCHAR SiS310_TVYFilter2[3][9][7] =
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
},
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -157,7 +243,7 @@ UCHAR SiS310_TVYFilter2[3][9][7] =
}
};
UCHAR SiS310_PALMFilter[17][4] =
const UCHAR SiS310_PALMFilter[16][4] =
{
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38},
......@@ -174,11 +260,10 @@ UCHAR SiS310_PALMFilter[17][4] =
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xff,0xff,0xff,0xff}
{0xeb,0x04,0x25,0x18}
};
UCHAR SiS310_PALNFilter[17][4] =
const UCHAR SiS310_PALNFilter[16][4] =
{
{0x00,0xf4,0x10,0x38},
{0x00,0xf4,0x10,0x38},
......@@ -195,12 +280,11 @@ UCHAR SiS310_PALNFilter[17][4] =
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xeb,0x04,0x25,0x18},
{0xff,0xff,0xff,0xff}
{0xeb,0x04,0x25,0x18}
};
UCHAR SiS310_PALMFilter2[9][7] =
const UCHAR SiS310_PALMFilter2[9][7] =
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -213,7 +297,7 @@ UCHAR SiS310_PALMFilter2[9][7] =
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
};
UCHAR SiS310_PALNFilter2[9][7] =
const UCHAR SiS310_PALNFilter2[9][7] =
{
{0xFF,0x03,0x02,0xF6,0xFC,0x27,0x46},
{0x01,0x02,0xFE,0xF7,0x03,0x27,0x3C},
......@@ -226,7 +310,7 @@ UCHAR SiS310_PALNFilter2[9][7] =
{0xFF,0xFF,0xFC,0x00,0x0F,0x22,0x28}
};
UCHAR SiS310_TVPhaseIncr1[3][2][4]=
const UCHAR SiS310_TVPhaseIncr1[3][2][4] =
{
{
{0x21,0xed,0xba,0x08},
......@@ -242,15 +326,15 @@ UCHAR SiS310_TVPhaseIncr1[3][2][4]=
}
};
UCHAR SiS310_TVPhaseIncr2[3][2][4]=
const UCHAR SiS310_TVPhaseIncr2[3][2][4] =
{
{
{0x21,0xF1,0x37,0x56},
{0x21,0xF1,0x37,0x56}
{0x21,0xf0,0x7b,0xd6}, /* 1.10.7w; 1.10.6s: {0x1e,0x8b,0xda,0xa7}, old: {0x21,0xF1,0x37,0x56} */
{0x21,0xf0,0x7b,0xd6} /* 1.10.7w; 1.10.6s: {0x1e,0x8b,0xda,0xa7} old: {0x21,0xF1,0x37,0x56} */
},
{
{0x2a,0x09,0x86,0xe9},
{0x2a,0x09,0x86,0xe9}
{0x2a,0x0a,0x41,0xe9}, /* 1.10.7w, 1.10.6s. old: {0x2a,0x09,0x86,0xe9}, */
{0x2a,0x0a,0x41,0xe9} /* 1.10.7w, 1.10.6s. old: {0x2a,0x09,0x86,0xe9} */
},
{
{0x2a,0x05,0xd3,0x00},
......
......@@ -7,6 +7,7 @@
/**********************************************************************/
#ifdef LINUX_KERNEL
#include <linux/config.h>
#include <linux/version.h>
#ifdef CONFIG_FB_SIS_300
#define SIS300
#endif
......@@ -14,6 +15,12 @@
#ifdef CONFIG_FB_SIS_315
#define SIS315H
#endif
#if 1
#define SISFBACCEL /* Include 2D acceleration */
#endif
#if 1
#define SISFB_PAN /* Include Y-Panning code */
#endif
#else
/* #define SIS300*/
#define SIS315H
......@@ -122,6 +129,10 @@
#define InPortLong(p) inl((CARD16)(p))
#endif
/**********************************************************************/
/* LINUX KERNEL */
/**********************************************************************/
#ifdef LINUX_KERNEL
#define OutPortByte(p,v) outb((u8)(v),(u16)(p))
#define OutPortWord(p,v) outw((u16)(v),(u16)(p))
......@@ -146,7 +157,7 @@
/**********************************************************************/
/* WIN CE */
/* WIN CE */
/**********************************************************************/
#ifdef WINCE_HEADER
......
#ifndef _SIS_H
#define _SIS_H
#if 1
#define TWDEBUG(x)
#else
#define TWDEBUG(x) printk(KERN_INFO x "\n");
#endif
#endif
......@@ -37,13 +37,21 @@
#include <linux/agp_backend.h>
#include <linux/types.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <linux/sisfb.h>
#else
#include <video/sisfb.h>
#endif
#include <asm/io.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#include <video/fbcon.h>
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33)
#include <video/fbcon-cfb8.h>
#include <video/fbcon-cfb16.h>
#include <video/fbcon-cfb24.h>
......@@ -54,9 +62,11 @@
#include "vgatypes.h"
#include "vstruct.h"
#include "sis_accel.h"
#include "sis.h"
extern struct video_info ivideo;
extern VGA_ENGINE sisvga_engine;
extern int sisfb_accel;
static const int sisALUConv[] =
{
......@@ -228,15 +238,38 @@ SiS310SubsequentScreenToScreenCopy(int src_x, int src_y, int dst_x, int dst_y,
int width, int height)
{
long srcbase, dstbase;
int mymin, mymax;
srcbase = dstbase = 0;
if (src_y >= 2048) {
srcbase = ivideo.video_linelength * src_y;
src_y = 0;
}
if (dst_y >= 2048) {
dstbase = ivideo.video_linelength * dst_y;
dst_y = 0;
mymin = min(src_y, dst_y);
mymax = max(src_y, dst_y);
/* Although the chip knows the direction to use
* if the source and destination areas overlap,
* that logic fails if we fiddle with the bitmap
* addresses. Therefore, we check if the source
* and destination blitting areas overlap and
* adapt the bitmap addresses synchronously
* if the coordinates exceed the valid range.
* The the areas do not overlap, we do our
* normal check.
*/
if((mymax - mymin) < height) {
if((src_y >= 2048) || (dst_y >= 2048)) {
srcbase = ivideo.video_linelength * mymin;
dstbase = ivideo.video_linelength * mymin;
src_y -= mymin;
dst_y -= mymin;
}
} else {
if(src_y >= 2048) {
srcbase = ivideo.video_linelength * src_y;
src_y = 0;
}
if(dst_y >= 2048) {
dstbase = ivideo.video_linelength * dst_y;
dst_y = 0;
}
}
SiS310SetupSRCBase(srcbase);
......@@ -286,25 +319,62 @@ int sisfb_initaccel(void)
return(0);
}
void sisfb_syncaccel(void)
{
if(sisvga_engine == SIS_300_VGA) {
SiS300Sync();
} else {
SiS310Sync();
}
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34) /* --- KERNEL 2.5.34 and later --- */
void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
int sisfb_sync(struct fb_info *info)
{
if(!sisfb_accel) return 0;
CRITFLAGS
if(sisvga_engine == SIS_300_VGA) {
SiS300Sync();
} else {
SiS310Sync();
}
CRITEND
return 0;
}
void sisfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
{
int col=0;
CRITFLAGS
TWDEBUG("Inside sisfb_fillrect");
if(!rect->width || !rect->height)
return;
if(!sisfb_accel) {
cfb_fillrect(info, rect);
return;
}
switch(info->var.bits_per_pixel) {
case 8: col = rect->color;
break;
case 16: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
case 32: col = ((u32 *)(info->pseudo_palette))[rect->color];
break;
}
if(sisvga_engine == SIS_300_VGA) {
CRITBEGIN
SiS300SetupForSolidFill(rect->color, myrops[rect->rop], 0);
SiS300SetupForSolidFill(col, myrops[rect->rop], 0);
SiS300SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
CRITEND
SiS300Sync();
} else {
CRITBEGIN
SiS310SetupForSolidFill(rect->color, myrops[rect->rop], 0);
SiS310SetupForSolidFill(col, myrops[rect->rop], 0);
SiS310SubsequentSolidFillRect(rect->dx, rect->dy, rect->width, rect->height);
CRITEND
SiS310Sync();
......@@ -312,11 +382,17 @@ void fbcon_sis_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
}
void fbcon_sis_copyarea(struct fb_info *info, const struct fb_copyarea *area)
void sisfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
{
int xdir, ydir;
CRITFLAGS
TWDEBUG("Inside sis_copyarea");
if(!sisfb_accel) {
cfb_copyarea(info, area);
return;
}
if(!area->width || !area->height)
return;
......@@ -350,6 +426,27 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
int xdir, ydir;
CRITFLAGS
if(!ivideo.accel) {
switch(ivideo.video_bpp) {
case 8:
#ifdef FBCON_HAS_CFB8
fbcon_cfb8_bmove(p, srcy, srcx, dsty, dstx, height, width);
#endif
break;
case 16:
#ifdef FBCON_HAS_CFB16
fbcon_cfb16_bmove(p, srcy, srcx, dsty, dstx, height, width);
#endif
break;
case 32:
#ifdef FBCON_HAS_CFB32
fbcon_cfb32_bmove(p, srcy, srcx, dsty, dstx, height, width);
#endif
break;
}
return;
}
srcx *= fontwidth(p);
srcy *= fontheight(p);
dstx *= fontwidth(p);
......@@ -357,7 +454,6 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
width *= fontwidth(p);
height *= fontheight(p);
if(srcx < dstx) xdir = 0;
else xdir = 1;
if(srcy < dsty) ydir = 0;
......@@ -375,6 +471,10 @@ void fbcon_sis_bmove(struct display *p, int srcy, int srcx,
SiS310SubsequentScreenToScreenCopy(srcx, srcy, dstx, dsty, width, height);
CRITEND
SiS310Sync();
#if 0
printk(KERN_INFO "sis_bmove sx %d sy %d dx %d dy %d w %d h %d\n",
srcx, srcy, dstx, dsty, width, height);
#endif
}
}
......@@ -409,6 +509,13 @@ void fbcon_sis_clear8(struct vc_data *conp, struct display *p,
{
u32 bgx;
if(!ivideo.accel) {
#ifdef FBCON_HAS_CFB8
fbcon_cfb8_clear(conp, p, srcy, srcx, height, width);
#endif
return;
}
bgx = attr_bgcol_ec(p, conp);
fbcon_sis_clear(conp, p, srcy, srcx, height, width, bgx);
}
......@@ -417,6 +524,12 @@ void fbcon_sis_clear16(struct vc_data *conp, struct display *p,
int srcy, int srcx, int height, int width)
{
u32 bgx;
if(!ivideo.accel) {
#ifdef FBCON_HAS_CFB16
fbcon_cfb16_clear(conp, p, srcy, srcx, height, width);
#endif
return;
}
bgx = ((u_int16_t*)p->dispsw_data)[attr_bgcol_ec(p, conp)];
fbcon_sis_clear(conp, p, srcy, srcx, height, width, bgx);
......@@ -427,6 +540,13 @@ void fbcon_sis_clear32(struct vc_data *conp, struct display *p,
{
u32 bgx;
if(!ivideo.accel) {
#ifdef FBCON_HAS_CFB32
fbcon_cfb32_clear(conp, p, srcy, srcx, height, width);
#endif
return;
}
bgx = ((u_int32_t*)p->dispsw_data)[attr_bgcol_ec(p, conp)];
fbcon_sis_clear(conp, p, srcy, srcx, height, width, bgx);
}
......@@ -435,6 +555,22 @@ void fbcon_sis_revc(struct display *p, int srcx, int srcy)
{
CRITFLAGS
if(!ivideo.accel) {
switch(ivideo.video_bpp) {
case 16:
#ifdef FBCON_HAS_CFB16
fbcon_cfb16_revc(p, srcx, srcy);
#endif
break;
case 32:
#ifdef FBCON_HAS_CFB32
fbcon_cfb32_revc(p, srcx, srcy);
#endif
break;
}
return;
}
srcx *= fontwidth(p);
srcy *= fontheight(p);
......
/*
* SiS 300/630/730/540/315/550/650/740 frame buffer driver
* for Linux kernels 2.4.x and 2.5.x
*
* 2D acceleration part
*
* Based on the X driver's sis300_accel.h which is
* Copyright Xavier Ducoin <x.ducoin@lectra.com>
* Copyright 2002 by Thomas Winischhofer, Vienna, Austria
* and sis310_accel.h which is
* Copyright 2002 by Thomas Winischhofer, Vienna, Austria
*
* Author: Thomas Winischhofer <thomas@winischhofer.net>:
* (see http://www.winischhofer.net/
* for more information and updates)
*/
#ifndef _SISFB_ACCEL_H
#define _SISFB_ACCEL_H
/* Guard accelerator accesses with spin_lock_irqsave? Works well without. */
#undef SISFB_USE_SPINLOCKS
#ifdef SISFB_USE_SPINLOCKS
#include <linux/spinlock.h>
#define CRITBEGIN spin_lock_irqsave(&ivideo.lockaccel), critflags);
#define CRITEND spin_unlock_irqrestore(&ivideo.lockaccel), critflags);
#define CRITFLAGS unsigned long critflags;
#else
#define CRITBEGIN
#define CRITEND
#define CRITFLAGS
#endif
/* Definitions for the SIS engine communication. */
#define PATREGSIZE 384 /* Pattern register size. 384 bytes @ 0x8300 */
#define BR(x) (0x8200 | (x) << 2)
#define PBR(x) (0x8300 | (x) << 2)
/* SiS300 engine commands */
#define BITBLT 0x00000000 /* Blit */
#define COLOREXP 0x00000001 /* Color expand */
#define ENCOLOREXP 0x00000002 /* Enhanced color expand */
#define MULTIPLE_SCANLINE 0x00000003 /* ? */
#define LINE 0x00000004 /* Draw line */
#define TRAPAZOID_FILL 0x00000005 /* Fill trapezoid */
#define TRANSPARENT_BITBLT 0x00000006 /* Transparent Blit */
/* Additional engine commands for 310/325 */
#define ALPHA_BLEND 0x00000007 /* Alpha blend ? */
#define A3D_FUNCTION 0x00000008 /* 3D command ? */
#define CLEAR_Z_BUFFER 0x00000009 /* ? */
#define GRADIENT_FILL 0x0000000A /* Gradient fill */
#define STRETCH_BITBLT 0x0000000B /* Stretched Blit */
/* source select */
#define SRCVIDEO 0x00000000 /* source is video RAM */
#define SRCSYSTEM 0x00000010 /* source is system memory */
#define SRCCPUBLITBUF SRCSYSTEM /* source is CPU-driven BitBuffer (for color expand) */
#define SRCAGP 0x00000020 /* source is AGP memory (?) */
/* Pattern flags */
#define PATFG 0x00000000 /* foreground color */
#define PATPATREG 0x00000040 /* pattern in pattern buffer (0x8300) */
#define PATMONO 0x00000080 /* mono pattern */
/* blitting direction (300 series only) */
#define X_INC 0x00010000
#define X_DEC 0x00000000
#define Y_INC 0x00020000
#define Y_DEC 0x00000000
/* Clipping flags */
#define NOCLIP 0x00000000
#define NOMERGECLIP 0x04000000
#define CLIPENABLE 0x00040000
#define CLIPWITHOUTMERGE 0x04040000
/* Transparency */
#define OPAQUE 0x00000000
#define TRANSPARENT 0x00100000
/* ? */
#define DSTAGP 0x02000000
#define DSTVIDEO 0x02000000
/* Line */
#define LINE_STYLE 0x00800000
#define NO_RESET_COUNTER 0x00400000
#define NO_LAST_PIXEL 0x00200000
/* Subfunctions for Color/Enhanced Color Expansion (310/325 only) */
#define COLOR_TO_MONO 0x00100000
#define AA_TEXT 0x00200000
/* Some general registers for 310/325 series */
#define SRC_ADDR 0x8200
#define SRC_PITCH 0x8204
#define AGP_BASE 0x8206 /* color-depth dependent value */
#define SRC_Y 0x8208
#define SRC_X 0x820A
#define DST_Y 0x820C
#define DST_X 0x820E
#define DST_ADDR 0x8210
#define DST_PITCH 0x8214
#define DST_HEIGHT 0x8216
#define RECT_WIDTH 0x8218
#define RECT_HEIGHT 0x821A
#define PAT_FGCOLOR 0x821C
#define PAT_BGCOLOR 0x8220
#define SRC_FGCOLOR 0x8224
#define SRC_BGCOLOR 0x8228
#define MONO_MASK 0x822C
#define LEFT_CLIP 0x8234
#define TOP_CLIP 0x8236
#define RIGHT_CLIP 0x8238
#define BOTTOM_CLIP 0x823A
#define COMMAND_READY 0x823C
#define FIRE_TRIGGER 0x8240
#define PATTERN_REG 0x8300 /* 384 bytes pattern buffer */
/* Line registers */
#define LINE_X0 SRC_Y
#define LINE_X1 DST_Y
#define LINE_Y0 SRC_X
#define LINE_Y1 DST_X
#define LINE_COUNT RECT_WIDTH
#define LINE_STYLE_PERIOD RECT_HEIGHT
#define LINE_STYLE_0 MONO_MASK
#define LINE_STYLE_1 0x8230
#define LINE_XN PATTERN_REG
#define LINE_YN PATTERN_REG+2
/* Transparent bitblit registers */
#define TRANS_DST_KEY_HIGH PAT_FGCOLOR
#define TRANS_DST_KEY_LOW PAT_BGCOLOR
#define TRANS_SRC_KEY_HIGH SRC_FGCOLOR
#define TRANS_SRC_KEY_LOW SRC_BGCOLOR
/* Queue */
#define Q_BASE_ADDR 0x85C0 /* Base address of software queue (?) */
#define Q_WRITE_PTR 0x85C4 /* Current write pointer (?) */
#define Q_READ_PTR 0x85C8 /* Current read pointer (?) */
#define Q_STATUS 0x85CC /* queue status */
#define MMIO_IN8(base, offset) \
*(volatile u8 *)(((u8*)(base)) + (offset))
#define MMIO_IN16(base, offset) \
*(volatile u16 *)(void *)(((u8*)(base)) + (offset))
#define MMIO_IN32(base, offset) \
*(volatile u32 *)(void *)(((u8*)(base)) + (offset))
#define MMIO_OUT8(base, offset, val) \
*(volatile u8 *)(((u8*)(base)) + (offset)) = (val)
#define MMIO_OUT16(base, offset, val) \
*(volatile u16 *)(void *)(((u8*)(base)) + (offset)) = (val)
#define MMIO_OUT32(base, offset, val) \
*(volatile u32 *)(void *)(((u8*)(base)) + (offset)) = (val)
/* ------------- SiS 300 series -------------- */
/* Macros to do useful things with the SIS BitBLT engine */
/* BR(16) (0x8420):
bit 31 2D engine: 1 is idle,
bit 30 3D engine: 1 is idle,
bit 29 Command queue: 1 is empty
bits 28:24: Current CPU driven BitBlt buffer stage bit[4:0]
bits 15:0: Current command queue length
*/
/* TW: BR(16)+2 = 0x8242 */
int CmdQueLen;
#define SiS300Idle \
{ \
while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
while( (MMIO_IN16(ivideo.mmio_vbase, BR(16)+2) & 0xE000) != 0xE000){}; \
CmdQueLen=MMIO_IN16(ivideo.mmio_vbase, 0x8240); \
}
/* TW: (do three times, because 2D engine seems quite unsure about whether or not it's idle) */
#define SiS300SetupSRCBase(base) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(0), base);\
CmdQueLen --;
#define SiS300SetupSRCPitch(pitch) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(1), pitch);\
CmdQueLen --;
#define SiS300SetupSRCXY(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(2), (x)<<16 | (y) );\
CmdQueLen --;
#define SiS300SetupDSTBase(base) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(4), base);\
CmdQueLen --;
#define SiS300SetupDSTXY(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(3), (x)<<16 | (y) );\
CmdQueLen --;
#define SiS300SetupDSTRect(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(5), (y)<<16 | (x) );\
CmdQueLen --;
#define SiS300SetupDSTColorDepth(bpp) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(1)+2, bpp);\
CmdQueLen --;
#define SiS300SetupRect(w,h) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(6), (h)<<16 | (w) );\
CmdQueLen --;
#define SiS300SetupPATFG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(7), color);\
CmdQueLen --;
#define SiS300SetupPATBG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(8), color);\
CmdQueLen --;
#define SiS300SetupSRCFG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(9), color);\
CmdQueLen --;
#define SiS300SetupSRCBG(color) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(10), color);\
CmdQueLen --;
/* 0x8224 src colorkey high */
/* 0x8228 src colorkey low */
/* 0x821c dest colorkey high */
/* 0x8220 dest colorkey low */
#define SiS300SetupSRCTrans(color) \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, 0x8224, color);\
MMIO_OUT32(ivideo.mmio_vbase, 0x8228, color);\
CmdQueLen -= 2;
#define SiS300SetupDSTTrans(color) \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, 0x821C, color); \
MMIO_OUT32(ivideo.mmio_vbase, 0x8220, color); \
CmdQueLen -= 2;
#define SiS300SetupMONOPAT(p0,p1) \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(11), p0);\
MMIO_OUT32(ivideo.mmio_vbase, BR(12), p1);\
CmdQueLen -= 2;
#define SiS300SetupClipLT(left,top) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(13), ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
#define SiS300SetupClipRB(right,bottom) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(14), ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
/* General */
#define SiS300SetupROP(rop) \
ivideo.CommandReg = (rop) << 8;
#define SiS300SetupCMDFlag(flags) \
ivideo.CommandReg |= (flags);
#define SiS300DoCMD \
if (CmdQueLen <= 1) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(15), ivideo.CommandReg); \
MMIO_OUT32(ivideo.mmio_vbase, BR(16), 0);\
CmdQueLen -= 2;
/* Line */
#define SiS300SetupX0Y0(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(2), (y)<<16 | (x) );\
CmdQueLen--;
#define SiS300SetupX1Y1(x,y) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(3), (y)<<16 | (x) );\
CmdQueLen--;
#define SiS300SetupLineCount(c) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(6), c);\
CmdQueLen--;
#define SiS300SetupStylePeriod(p) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT16(ivideo.mmio_vbase, BR(6)+2, p);\
CmdQueLen--;
#define SiS300SetupStyleLow(ls) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(11), ls);\
CmdQueLen--;
#define SiS300SetupStyleHigh(ls) \
if (CmdQueLen <= 0) SiS300Idle;\
MMIO_OUT32(ivideo.mmio_vbase, BR(12), ls);\
CmdQueLen--;
/* ----------- SiS 310/325 series --------------- */
/* Q_STATUS:
bit 31 = 1: All engines idle and all queues empty
bit 30 = 1: Hardware Queue (=HW CQ, 2D queue, 3D queue) empty
bit 29 = 1: 2D engine is idle
bit 28 = 1: 3D engine is idle
bit 27 = 1: HW command queue empty
bit 26 = 1: 2D queue empty
bit 25 = 1: 3D queue empty
bit 24 = 1: SW command queue empty
bits 23:16: 2D counter 3
bits 15:8: 2D counter 2
bits 7:0: 2D counter 1
Where is the command queue length (current amount of commands the queue
can accept) on the 310/325 series? (The current implementation is taken
from 300 series and certainly wrong...)
*/
/* TW: FIXME: CmdQueLen is... where....? */
#define SiS310Idle \
{ \
while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
while( (MMIO_IN16(ivideo.mmio_vbase, Q_STATUS+2) & 0x8000) != 0x8000){}; \
CmdQueLen=MMIO_IN16(ivideo.mmio_vbase, Q_STATUS); \
}
#define SiS310SetupSRCBase(base) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_ADDR, base);\
CmdQueLen--;
#define SiS310SetupSRCPitch(pitch) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, SRC_PITCH, pitch);\
CmdQueLen--;
#define SiS310SetupSRCXY(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_Y, (x)<<16 | (y) );\
CmdQueLen--;
#define SiS310SetupDSTBase(base) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, DST_ADDR, base);\
CmdQueLen--;
#define SiS310SetupDSTXY(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, DST_Y, (x)<<16 | (y) );\
CmdQueLen--;
#define SiS310SetupDSTRect(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, DST_PITCH, (y)<<16 | (x) );\
CmdQueLen--;
#define SiS310SetupDSTColorDepth(bpp) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, AGP_BASE, bpp);\
CmdQueLen--;
#define SiS310SetupRect(w,h) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, RECT_WIDTH, (h)<<16 | (w) );\
CmdQueLen--;
#define SiS310SetupPATFG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, PAT_FGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupPATBG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, PAT_BGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupSRCFG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_FGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupSRCBG(color) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, SRC_BGCOLOR, color);\
CmdQueLen--;
#define SiS310SetupSRCTrans(color) \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, TRANS_SRC_KEY_HIGH, color);\
MMIO_OUT32(ivideo.mmio_vbase, TRANS_SRC_KEY_LOW, color);\
CmdQueLen -= 2;
#define SiS310SetupDSTTrans(color) \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, TRANS_DST_KEY_HIGH, color); \
MMIO_OUT32(ivideo.mmio_vbase, TRANS_DST_KEY_LOW, color); \
CmdQueLen -= 2;
#define SiS310SetupMONOPAT(p0,p1) \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, MONO_MASK, p0);\
MMIO_OUT32(ivideo.mmio_vbase, MONO_MASK+4, p1);\
CmdQueLen -= 2;
#define SiS310SetupClipLT(left,top) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LEFT_CLIP, ((left) & 0xFFFF) | (top)<<16 );\
CmdQueLen--;
#define SiS310SetupClipRB(right,bottom) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, RIGHT_CLIP, ((right) & 0xFFFF) | (bottom)<<16 );\
CmdQueLen--;
#define SiS310SetupROP(rop) \
ivideo.CommandReg = (rop) << 8;
#define SiS310SetupCMDFlag(flags) \
ivideo.CommandReg |= (flags);
#define SiS310DoCMD \
if (CmdQueLen <= 1) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, COMMAND_READY, ivideo.CommandReg); \
MMIO_OUT32(ivideo.mmio_vbase, FIRE_TRIGGER, 0); \
CmdQueLen -= 2;
#define SiS310SetupX0Y0(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_X0, (y)<<16 | (x) );\
CmdQueLen--;
#define SiS310SetupX1Y1(x,y) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_X1, (y)<<16 | (x) );\
CmdQueLen--;
#define SiS310SetupLineCount(c) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, LINE_COUNT, c);\
CmdQueLen--;
#define SiS310SetupStylePeriod(p) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT16(ivideo.mmio_vbase, LINE_STYLE_PERIOD, p);\
CmdQueLen--;
#define SiS310SetupStyleLow(ls) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_STYLE_0, ls);\
CmdQueLen--;
#define SiS310SetupStyleHigh(ls) \
if (CmdQueLen <= 0) SiS310Idle;\
MMIO_OUT32(ivideo.mmio_vbase, LINE_STYLE_1, ls);\
CmdQueLen--;
int sisfb_initaccel(void);
void sisfb_syncaccel(void);
extern struct video_info ivideo;
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,33)
void fbcon_sis_bmove(struct display *p, int srcy, int srcx, int dsty,
int dstx, int height, int width);
void fbcon_sis_revc(struct display *p, int srcy, int srcx);
void fbcon_sis_clear8(struct vc_data *conp, struct display *p, int srcy,
int srcx, int height, int width);
void fbcon_sis_clear16(struct vc_data *conp, struct display *p, int srcy,
int srcx, int height, int width);
void fbcon_sis_clear32(struct vc_data *conp, struct display *p, int srcy,
int srcx, int height, int width);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,34)
extern int sisfb_accel;
void sisfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect);
void sisfb_copyarea(struct fb_info *info, const struct fb_copyarea *area);
#endif
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
#ifndef _SISFB_MAIN
#define _SISFB_MAIN
/* Comments and changes marked with "TW" by Thomas Winischhofer <tw@webit.com> */
/* Comments and changes marked with "TW" by Thomas Winischhofer <thomas@winischhofer.net> */
#include "vstruct.h"
/* ------------------- Constant Definitions ------------------------- */
#undef LINUXBIOS /* turn on when use LINUXBIOS */
#undef LINUXBIOS /* turn this on when compiling for LINUXBIOS */
#define AGPOFF /* default is turn off AGP */
#define SISFAIL(x) do { printk(x "\n"); return -EINVAL; } while(0)
#define VER_MAJOR 1
#define VER_MINOR 4
#define VER_LEVEL 1
#define VER_MINOR 6
#define VER_LEVEL 0
#include "sis.h"
/* TW: To be included in pci_ids.h */
#ifndef PCI_DEVICE_ID_SI_650_VGA
......@@ -19,14 +25,28 @@
#ifndef PCI_DEVICE_ID_SI_650
#define PCI_DEVICE_ID_SI_650 0x0650
#endif
/* TW end */
#ifndef PCI_DEVICE_ID_SI_740
#define PCI_DEVICE_ID_SI_740 0x0740
#endif
#ifndef PCI_DEVICE_ID_SI_330
#define PCI_DEVICE_ID_SI_330 0x0330
#endif
/* To be included in fb.h */
#ifndef FB_ACCEL_SIS_GLAMOUR_2
#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
#endif
#ifndef FB_ACCEL_SIS_XABRE
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
#endif
#define MAX_ROM_SCAN 0x10000
#define TURBO_QUEUE_CAP 0x80
#define HW_CURSOR_CAP 0x40
#define AGP_CMD_QUEUE_CAP 0x80
#define VM_CMD_QUEUE_CAP 0x20
#define HW_CURSOR_CAP 0x80
#define TURBO_QUEUE_CAP 0x40
#define AGP_CMD_QUEUE_CAP 0x20
#define VM_CMD_QUEUE_CAP 0x10
#define MMIO_CMD_QUEUE_CAP 0x08
/* For 300 series */
#ifdef CONFIG_FB_SIS_300
......@@ -63,6 +83,20 @@
#define VB_PART4_ADR (0x14-0x30)
#define VB_PART4_DATA (0x15-0x30)
#define SISSR SiS_Pr.SiS_P3c4
#define SISCR SiS_Pr.SiS_P3d4
#define SISDACA SiS_Pr.SiS_P3c8
#define SISDACD SiS_Pr.SiS_P3c9
#define SISPART1 SiS_Pr.SiS_Part1Port
#define SISPART2 SiS_Pr.SiS_Part2Port
#define SISPART3 SiS_Pr.SiS_Part3Port
#define SISPART4 SiS_Pr.SiS_Part4Port
#define SISPART5 SiS_Pr.SiS_Part5Port
#define SISDAC2A SISPART5
#define SISDAC2D (SISPART5 + 1)
#define SISMISCR (SiS_Pr.RelIO + 0x1c)
#define SISINPSTAT (SiS_Pr.RelIO + 0x2a)
#define IND_SIS_PASSWORD 0x05 /* SRs */
#define IND_SIS_COLOR_MODE 0x06
#define IND_SIS_RAMDAC_CONTROL 0x07
......@@ -93,10 +127,8 @@
#define MMIO_QUEUE_WRITEPORT 0x85C4
#define MMIO_QUEUE_READPORT 0x85C8
/* Eden Chen; TW */
#define IND_SIS_CRT2_WRITE_ENABLE_300 0x24
#define IND_SIS_CRT2_WRITE_ENABLE_315 0x2F
/* ~Eden Chen; TW */
#define SIS_PASSWORD 0x86 /* SR05 */
#define SIS_INTERLACED_MODE 0x20 /* SR06 */
......@@ -104,7 +136,7 @@
#define SIS_15BPP_COLOR_MODE 0x1
#define SIS_16BPP_COLOR_MODE 0x2
#define SIS_32BPP_COLOR_MODE 0x4
#define SIS_DRAM_SIZE_MASK 0x3F /* SR14 */
#define SIS_DRAM_SIZE_MASK 0x3F /* 300/630/730 SR14 */
#define SIS_DRAM_SIZE_1MB 0x00
#define SIS_DRAM_SIZE_2MB 0x01
#define SIS_DRAM_SIZE_4MB 0x03
......@@ -204,23 +236,55 @@
#define BRI_DRAM_SIZE_32MB 0x04
#define BRI_DRAM_SIZE_64MB 0x05
// Eden Chen
#define HW_DEVICE_EXTENSION SIS_HW_DEVICE_INFO
#define PHW_DEVICE_EXTENSION PSIS_HW_DEVICE_INFO
#define SR_BUFFER_SIZE 5
#define CR_BUFFER_SIZE 5
// ~Eden Chen
/* Useful macros */
#define inSISREG(base) inb(base)
#define outSISREG(base,val) outb(val,base)
#define orSISREG(base,val) do { \
unsigned char __Temp = inb(base); \
outSISREG(base, __Temp | (val)); \
} while (0)
#define andSISREG(base,val) do { \
unsigned char __Temp = inb(base); \
outSISREG(base, __Temp & (val)); \
} while (0)
#define inSISIDXREG(base,idx,var) do { \
outb(idx,base); var=inb((base)+1); \
} while (0)
#define outSISIDXREG(base,idx,val) do { \
outb(idx,base); outb((val),(base)+1); \
} while (0)
#define orSISIDXREG(base,idx,val) do { \
unsigned char __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)|(val); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define andSISIDXREG(base,idx,and) do { \
unsigned char __Temp; \
outb(idx,base); \
__Temp = inb((base)+1)&(and); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
#define setSISIDXREG(base,idx,and,or) do { \
unsigned char __Temp; \
outb(idx,base); \
__Temp = (inb((base)+1)&(and))|(or); \
outSISIDXREG(base,idx,__Temp); \
} while (0)
/* ------------------- Global Variables ----------------------------- */
/* Fbcon variables */
static struct fb_info fb_info;
static struct display disp;
static int video_type = FB_TYPE_PACKED_PIXELS;
static int video_linelength;
static int video_cmap_len;
static struct display_switch sisfb_sw;
static struct fb_info sis_fb_info;
static int video_type = FB_TYPE_PACKED_PIXELS;
static struct fb_var_screeninfo default_var = {
xres: 0,
yres: 0,
......@@ -248,51 +312,79 @@ static struct fb_var_screeninfo default_var = {
vsync_len: 0,
sync: 0,
vmode: FB_VMODE_NONINTERLACED,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
reserved: {0, 0, 0, 0, 0, 0}
#endif
};
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static struct fb_fix_screeninfo sisfb_fix = {
id: "SiS",
type: FB_TYPE_PACKED_PIXELS,
xpanstep: 1,
ypanstep: 1,
};
static char myid[20];
static u32 pseudo_palette[17];
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static struct display sis_disp;
static struct display_switch sisfb_sw;
static struct {
u16 blue, green, red, pad;
} palette[256];
} sis_palette[256];
static union {
#ifdef FBCON_HAS_CFB16
u16 cfb16[16];
#endif
#ifdef FBCON_HAS_CFB24
u32 cfb24[16];
#endif
#ifdef FBCON_HAS_CFB32
u32 cfb32[16];
#endif
} fbcon_cmap;
} sis_fbcon_cmap;
static int sisfb_inverse = 0;
#endif
/* display status */
static int sisfb_off = 0;
static int sisfb_crt1off = 0;
static int sisfb_forcecrt1 = -1;
static int sisfb_inverse = 0;
static int sisvga_enabled = 0;
static int sisfb_userom = 1;
static int sisfb_useoem = -1;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static int currcon = 0;
#endif
/* global flags */
static int sisfb_registered;
static int sisfb_tvmode = 0;
static int sisfb_mem = 0;
static int sisfb_pdc = 0;
static int enable_dstn = 0;
static int sisfb_ypan = -1;
static enum _VGA_ENGINE {
UNKNOWN_VGA = 0,
SIS_300_VGA,
SIS_315_VGA,
} sisvga_engine = UNKNOWN_VGA;
VGA_ENGINE sisvga_engine = UNKNOWN_VGA;
int sisfb_accel = -1;
/* TW: These are to adapted according to VGA_ENGINE type */
static int sisfb_hwcursor_size = 0;
static int sisfb_CRT2_write_enable = 0;
int sisfb_crt2type = -1; /* TW: CRT2 type (for overriding autodetection) */
int sisfb_crt2type = -1; /* TW: CRT2 type (for overriding autodetection) */
int sisfb_tvplug = -1; /* PR: Tv plug type (for overriding autodetection) */
int sisfb_queuemode = -1; /* TW: Use MMIO queue mode by default (310/325 series only) */
int sisfb_queuemode = -1; /* TW: Use MMIO queue mode by default (310 series only) */
unsigned char sisfb_detectedpdc = 0;
/* data for sis components*/
unsigned char sisfb_detectedlcda = 0xff;
/* data for sis components */
struct video_info ivideo;
/* TW: For ioctl SISFB_GET_INFO */
......@@ -300,16 +392,19 @@ sisfb_info sisfbinfo;
/* TW: Hardware extension; contains data on hardware */
HW_DEVICE_EXTENSION sishw_ext = {
NULL, NULL, NULL, NULL,
NULL, NULL, FALSE, NULL, NULL,
0, 0, 0, 0, 0, 0, 0, 0, 0,
NULL, NULL, NULL, NULL,
{0, 0, 0, 0},
0
};
/* TW: SiS private structure */
SiS_Private SiS_Pr;
/* card parameters */
static unsigned long sisfb_mmio_size = 0;
static u8 sisfb_caps = 0;
static u8 sisfb_caps = 0;
typedef enum _SIS_CMDTYPE {
MMIO_CMD = 0,
......@@ -323,138 +418,157 @@ static struct board {
const char *name;
} sisdev_list[] = {
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_300, "SIS 300"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, "SIS 540"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, "SIS 630/730"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_540_VGA, "SIS 540 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_630_VGA, "SIS 630/730 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315H, "SIS 315H"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315, "SIS 315"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_315PRO, "SIS 315PRO"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, "SIS 550"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 650/M650/740 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_550_VGA, "SIS 550 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_650_VGA, "SIS 650/M650/651/740 VGA"},
{PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_330, "SIS 330"},
{0, 0, NULL}
};
#define MD_SIS300 1
#define MD_SIS315 2
/* mode table */
/* NOT const - will be patched for 1280x960 mode number chaos reasons */
struct _sisbios_mode {
char name[15];
u8 mode_no;
u16 vesa_mode_no_1; /* "SiS defined" VESA mode number */
u16 vesa_mode_no_2; /* Real VESA mode numbers */
u16 xres;
u16 yres;
u16 bpp;
u16 rate_idx;
u16 cols;
u16 rows;
u8 chipset;
} sisbios_mode[] = {
#define MODE_INDEX_NONE 0 /* TW: index for mode=none */
{"none", 0xFF, 0, 0, 0, 0, 0, 0}, /* TW: for mode "none" */
{"320x240x16", 0x56, 320, 240, 16, 1, 40, 15},
{"320x480x8", 0x5A, 320, 480, 8, 1, 40, 30}, /* TW: FSTN */
{"320x480x16", 0x5B, 320, 480, 16, 1, 40, 30}, /* TW: FSTN */
{"640x480x8", 0x2E, 640, 480, 8, 1, 80, 30},
{"640x480x16", 0x44, 640, 480, 16, 1, 80, 30},
{"640x480x24", 0x62, 640, 480, 32, 1, 80, 30}, /* TW: That's for people who mix up color- and fb depth */
{"640x480x32", 0x62, 640, 480, 32, 1, 80, 30},
{"720x480x8", 0x31, 720, 480, 8, 1, 90, 30},
{"720x480x16", 0x33, 720, 480, 16, 1, 90, 30},
{"720x480x24", 0x35, 720, 480, 32, 1, 90, 30},
{"720x480x32", 0x35, 720, 480, 32, 1, 90, 30},
{"720x576x8", 0x32, 720, 576, 8, 1, 90, 36},
{"720x576x16", 0x34, 720, 576, 16, 1, 90, 36},
{"720x576x24", 0x36, 720, 576, 32, 1, 90, 36},
{"720x576x32", 0x36, 720, 576, 32, 1, 90, 36},
{"800x480x8", 0x70, 800, 480, 8, 1, 100, 30}, /* TW: 310/325 series only */
{"800x480x16", 0x7a, 800, 480, 16, 1, 100, 30},
{"800x480x24", 0x76, 800, 480, 32, 1, 100, 30},
{"800x480x32", 0x76, 800, 480, 32, 1, 100, 30},
{"none", 0xFF, 0x0000, 0x0000, 0, 0, 0, 0, 0, 0, MD_SIS300|MD_SIS315}, /* TW: for mode "none" */
{"320x240x16", 0x56, 0x0000, 0x0000, 320, 240, 16, 1, 40, 15, MD_SIS315},
{"320x480x8", 0x5A, 0x0000, 0x0000, 320, 480, 8, 1, 40, 30, MD_SIS315}, /* TW: FSTN */
{"320x480x16", 0x5B, 0x0000, 0x0000, 320, 480, 16, 1, 40, 30, MD_SIS315}, /* TW: FSTN */
{"640x480x8", 0x2E, 0x0101, 0x0101, 640, 480, 8, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x16", 0x44, 0x0111, 0x0111, 640, 480, 16, 1, 80, 30, MD_SIS300|MD_SIS315},
{"640x480x24", 0x62, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315}, /* TW: That's for people who mix up color- and fb depth */
{"640x480x32", 0x62, 0x013a, 0x0112, 640, 480, 32, 1, 80, 30, MD_SIS300|MD_SIS315},
{"720x480x8", 0x31, 0x0000, 0x0000, 720, 480, 8, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x16", 0x33, 0x0000, 0x0000, 720, 480, 16, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x24", 0x35, 0x0000, 0x0000, 720, 480, 32, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x480x32", 0x35, 0x0000, 0x0000, 720, 480, 32, 1, 90, 30, MD_SIS300|MD_SIS315},
{"720x576x8", 0x32, 0x0000, 0x0000, 720, 576, 8, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x16", 0x34, 0x0000, 0x0000, 720, 576, 16, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x24", 0x36, 0x0000, 0x0000, 720, 576, 32, 1, 90, 36, MD_SIS300|MD_SIS315},
{"720x576x32", 0x36, 0x0000, 0x0000, 720, 576, 32, 1, 90, 36, MD_SIS300|MD_SIS315},
{"800x480x8", 0x70, 0x0000, 0x0000, 800, 480, 8, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x16", 0x7a, 0x0000, 0x0000, 800, 480, 16, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x24", 0x76, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
{"800x480x32", 0x76, 0x0000, 0x0000, 800, 480, 32, 1, 100, 30, MD_SIS300|MD_SIS315},
#define DEFAULT_MODE 20 /* TW: index for 800x600x8 */
#define DEFAULT_LCDMODE 20 /* TW: index for 800x600x8 */
#define DEFAULT_TVMODE 20 /* TW: index for 800x600x8 */
{"800x600x8", 0x30, 800, 600, 8, 2, 100, 37},
{"800x600x16", 0x47, 800, 600, 16, 2, 100, 37},
{"800x600x24", 0x63, 800, 600, 32, 2, 100, 37},
{"800x600x32", 0x63, 800, 600, 32, 2, 100, 37},
{"1024x576x8", 0x71, 1024, 576, 8, 1, 128, 36}, /* TW: 310/325 series only */
{"1024x576x16", 0x74, 1024, 576, 16, 1, 128, 36},
{"1024x576x24", 0x77, 1024, 576, 32, 1, 128, 36},
{"1024x576x32", 0x77, 1024, 576, 32, 1, 128, 36},
{"1024x600x8", 0x20, 1024, 600, 8, 1, 128, 37}, /* TW: 300 series only */
{"1024x600x16", 0x21, 1024, 600, 16, 1, 128, 37},
{"1024x600x24", 0x22, 1024, 600, 32, 1, 128, 37},
{"1024x600x32", 0x22, 1024, 600, 32, 1, 128, 37},
{"1024x768x8", 0x38, 1024, 768, 8, 2, 128, 48},
{"1024x768x16", 0x4A, 1024, 768, 16, 2, 128, 48},
{"1024x768x24", 0x64, 1024, 768, 32, 2, 128, 48},
{"1024x768x32", 0x64, 1024, 768, 32, 2, 128, 48},
{"1152x768x8", 0x23, 1152, 768, 8, 1, 144, 48}, /* TW: 300 series only */
{"1152x768x16", 0x24, 1152, 768, 16, 1, 144, 48},
{"1152x768x24", 0x25, 1152, 768, 32, 1, 144, 48},
{"1152x768x32", 0x25, 1152, 768, 32, 1, 144, 48},
{"1280x720x8", 0x79, 1280, 720, 8, 1, 160, 45}, /* TW: 310/325 series only */
{"1280x720x16", 0x75, 1280, 720, 16, 1, 160, 45},
{"1280x720x24", 0x78, 1280, 720, 32, 1, 160, 45},
{"1280x720x32", 0x78, 1280, 720, 32, 1, 160, 45},
{"1280x768x8", 0x23, 1280, 768, 8, 1, 160, 48}, /* TW: 3107325 series only */
{"1280x768x16", 0x24, 1280, 768, 16, 1, 160, 48},
{"1280x768x24", 0x25, 1280, 768, 32, 1, 160, 48},
{"1280x768x32", 0x25, 1280, 768, 32, 1, 160, 48},
{"800x600x8", 0x30, 0x0103, 0x0103, 800, 600, 8, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x16", 0x47, 0x0114, 0x0114, 800, 600, 16, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x24", 0x63, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
{"800x600x32", 0x63, 0x013b, 0x0115, 800, 600, 32, 2, 100, 37, MD_SIS300|MD_SIS315},
{"1024x576x8", 0x71, 0x0000, 0x0000, 1024, 576, 8, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x16", 0x74, 0x0000, 0x0000, 1024, 576, 16, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x24", 0x77, 0x0000, 0x0000, 1024, 576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x576x32", 0x77, 0x0000, 0x0000, 1024, 576, 32, 1, 128, 36, MD_SIS300|MD_SIS315},
{"1024x600x8", 0x20, 0x0000, 0x0000, 1024, 600, 8, 1, 128, 37, MD_SIS300 }, /* TW: 300 series only */
{"1024x600x16", 0x21, 0x0000, 0x0000, 1024, 600, 16, 1, 128, 37, MD_SIS300 },
{"1024x600x24", 0x22, 0x0000, 0x0000, 1024, 600, 32, 1, 128, 37, MD_SIS300 },
{"1024x600x32", 0x22, 0x0000, 0x0000, 1024, 600, 32, 1, 128, 37, MD_SIS300 },
{"1024x768x8", 0x38, 0x0105, 0x0105, 1024, 768, 8, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x16", 0x4A, 0x0117, 0x0117, 1024, 768, 16, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x24", 0x64, 0x013c, 0x0118, 1024, 768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1024x768x32", 0x64, 0x013c, 0x0118, 1024, 768, 32, 2, 128, 48, MD_SIS300|MD_SIS315},
{"1152x768x8", 0x23, 0x0000, 0x0000, 1152, 768, 8, 1, 144, 48, MD_SIS300 }, /* TW: 300 series only */
{"1152x768x16", 0x24, 0x0000, 0x0000, 1152, 768, 16, 1, 144, 48, MD_SIS300 },
{"1152x768x24", 0x25, 0x0000, 0x0000, 1152, 768, 32, 1, 144, 48, MD_SIS300 },
{"1152x768x32", 0x25, 0x0000, 0x0000, 1152, 768, 32, 1, 144, 48, MD_SIS300 },
{"1280x720x8", 0x79, 0x0000, 0x0000, 1280, 720, 8, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x16", 0x75, 0x0000, 0x0000, 1280, 720, 16, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x24", 0x78, 0x0000, 0x0000, 1280, 720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x720x32", 0x78, 0x0000, 0x0000, 1280, 720, 32, 1, 160, 45, MD_SIS300|MD_SIS315},
{"1280x768x8", 0x23, 0x0000, 0x0000, 1280, 768, 8, 1, 160, 48, MD_SIS315}, /* TW: 310/325 series only */
{"1280x768x16", 0x24, 0x0000, 0x0000, 1280, 768, 16, 1, 160, 48, MD_SIS315},
{"1280x768x24", 0x25, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS315},
{"1280x768x32", 0x25, 0x0000, 0x0000, 1280, 768, 32, 1, 160, 48, MD_SIS315},
#define MODEINDEX_1280x960 48
{"1280x960x8", 0x7C, 1280, 960, 8, 1, 160, 60}, /* TW: Modenumbers being patched */
{"1280x960x16", 0x7D, 1280, 960, 16, 1, 160, 60},
{"1280x960x24", 0x7E, 1280, 960, 32, 1, 160, 60},
{"1280x960x32", 0x7E, 1280, 960, 32, 1, 160, 60},
{"1280x1024x8", 0x3A, 1280, 1024, 8, 2, 160, 64},
{"1280x1024x16", 0x4D, 1280, 1024, 16, 2, 160, 64},
{"1280x1024x24", 0x65, 1280, 1024, 32, 2, 160, 64},
{"1280x1024x32", 0x65, 1280, 1024, 32, 2, 160, 64},
{"1400x1050x8", 0x26, 1400, 1050, 8, 1, 175, 65}, /* TW: 310/325 series only */
{"1400x1050x16", 0x27, 1400, 1050, 16, 1, 175, 65},
{"1400x1050x24", 0x28, 1400, 1050, 32, 1, 175, 65},
{"1400x1050x32", 0x28, 1400, 1050, 32, 1, 175, 65},
{"1600x1200x8", 0x3C, 1600, 1200, 8, 1, 200, 75},
{"1600x1200x16", 0x3D, 1600, 1200, 16, 1, 200, 75},
{"1600x1200x24", 0x66, 1600, 1200, 32, 1, 200, 75},
{"1600x1200x32", 0x66, 1600, 1200, 32, 1, 200, 75},
{"1920x1440x8", 0x68, 1920, 1440, 8, 1, 240, 75},
{"1920x1440x16", 0x69, 1920, 1440, 16, 1, 240, 75},
{"1920x1440x24", 0x6B, 1920, 1440, 32, 1, 240, 75},
{"1920x1440x32", 0x6B, 1920, 1440, 32, 1, 240, 75},
{"2048x1536x8", 0x6c, 2048, 1536, 8, 1, 256, 96}, /* TW: 310/325 series only */
{"2048x1536x16", 0x6d, 2048, 1536, 16, 1, 256, 96},
{"2048x1536x24", 0x6e, 2048, 1536, 32, 1, 256, 96},
{"2048x1536x32", 0x6e, 2048, 1536, 32, 1, 256, 96},
{"\0", 0x00, 0, 0, 0, 0, 0, 0}
{"1280x960x8", 0x7C, 0x0000, 0x0000, 1280, 960, 8, 1, 160, 60, MD_SIS300|MD_SIS315}, /* TW: Modenumbers being patched */
{"1280x960x16", 0x7D, 0x0000, 0x0000, 1280, 960, 16, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x24", 0x7E, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x960x32", 0x7E, 0x0000, 0x0000, 1280, 960, 32, 1, 160, 60, MD_SIS300|MD_SIS315},
{"1280x1024x8", 0x3A, 0x0107, 0x0107, 1280, 1024, 8, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x16", 0x4D, 0x011a, 0x011a, 1280, 1024, 16, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x24", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1280x1024x32", 0x65, 0x013d, 0x011b, 1280, 1024, 32, 2, 160, 64, MD_SIS300|MD_SIS315},
{"1400x1050x8", 0x26, 0x0000, 0x0000, 1400, 1050, 8, 1, 175, 65, MD_SIS315}, /* TW: 310/325 series only */
{"1400x1050x16", 0x27, 0x0000, 0x0000, 1400, 1050, 16, 1, 175, 65, MD_SIS315},
{"1400x1050x24", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315},
{"1400x1050x32", 0x28, 0x0000, 0x0000, 1400, 1050, 32, 1, 175, 65, MD_SIS315},
{"1600x1200x8", 0x3C, 0x0130, 0x011c, 1600, 1200, 8, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x16", 0x3D, 0x0131, 0x011e, 1600, 1200, 16, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x24", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1600x1200x32", 0x66, 0x013e, 0x011f, 1600, 1200, 32, 1, 200, 75, MD_SIS300|MD_SIS315},
{"1920x1440x8", 0x68, 0x013f, 0x0000, 1920, 1440, 8, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x16", 0x69, 0x0140, 0x0000, 1920, 1440, 16, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x24", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"1920x1440x32", 0x6B, 0x0141, 0x0000, 1920, 1440, 32, 1, 240, 75, MD_SIS300|MD_SIS315},
{"2048x1536x8", 0x6c, 0x0000, 0x0000, 2048, 1536, 8, 1, 256, 96, MD_SIS315}, /* TW: 310/325 series only */
{"2048x1536x16", 0x6d, 0x0000, 0x0000, 2048, 1536, 16, 1, 256, 96, MD_SIS315},
{"2048x1536x24", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315},
{"2048x1536x32", 0x6e, 0x0000, 0x0000, 2048, 1536, 32, 1, 256, 96, MD_SIS315},
{"\0", 0x00, 0, 0, 0, 0, 0, 0, 0}
};
/* mode-related variables */
int sisfb_mode_idx = MODE_INDEX_NONE;
u8 sisfb_mode_no = 0;
#ifdef MODULE
int sisfb_mode_idx = MODE_INDEX_NONE; /* Don't use a mode by default if we are a module */
#else
int sisfb_mode_idx = -1; /* Use a default mode if we are inside the kernel */
#endif
u8 sisfb_mode_no = 0;
u8 sisfb_rate_idx = 0;
/* TW: CR36 evaluation */
USHORT sis300paneltype[] =
const USHORT sis300paneltype[] =
{ LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
LCD_1280x960, LCD_640x480, LCD_1024x600, LCD_1152x768,
LCD_320x480, LCD_1024x768, LCD_1024x768, LCD_1024x768,
LCD_1024x768, LCD_1024x768, LCD_1024x768, LCD_1024x768 };
USHORT sis310paneltype[] =
const USHORT sis310paneltype[] =
{ LCD_UNKNOWN, LCD_800x600, LCD_1024x768, LCD_1280x1024,
LCD_640x480, LCD_1024x600, LCD_1152x864, LCD_1280x960,
LCD_1152x768, LCD_1400x1050,LCD_1280x768, LCD_1600x1200,
LCD_320x480, LCD_1024x768, LCD_1024x768, LCD_1024x768 };
static const struct _sis_crt2type {
char name[6];
char name[10];
int type_no;
int tvplug_no;
} sis_crt2type[] = {
{"NONE", 0},
{"LCD", DISPTYPE_LCD},
{"TV", DISPTYPE_TV},
{"VGA", DISPTYPE_CRT2},
{"none", 0}, /* TW: make it fool-proof */
{"lcd", DISPTYPE_LCD},
{"tv", DISPTYPE_TV},
{"vga", DISPTYPE_CRT2},
{"\0", -1}
{"NONE", 0, -1},
{"LCD", DISPTYPE_LCD, -1},
{"TV", DISPTYPE_TV, -1},
{"VGA", DISPTYPE_CRT2, -1},
{"SVIDEO", DISPTYPE_TV, TVPLUG_SVIDEO},
{"COMPOSITE", DISPTYPE_TV, TVPLUG_COMPOSITE},
{"SCART", DISPTYPE_TV, TVPLUG_SCART},
{"none", 0, -1},
{"lcd", DISPTYPE_LCD, -1},
{"tv", DISPTYPE_TV, -1},
{"vga", DISPTYPE_CRT2, -1},
{"svideo", DISPTYPE_TV, TVPLUG_SVIDEO},
{"composite", DISPTYPE_TV, TVPLUG_COMPOSITE},
{"scart", DISPTYPE_TV, TVPLUG_SCART},
{"\0", -1, -1}
};
/* Queue mode selection for 310 series */
......@@ -462,16 +576,28 @@ static const struct _sis_queuemode {
char name[6];
int type_no;
} sis_queuemode[] = {
{"AGP", AGP_CMD_QUEUE},
{"VRAM", VM_CMD_QUEUE},
{"MMIO", MMIO_CMD},
{"agp", AGP_CMD_QUEUE},
{"vram", VM_CMD_QUEUE},
{"mmio", MMIO_CMD},
{"\0", -1}
{"AGP", AGP_CMD_QUEUE},
{"VRAM", VM_CMD_QUEUE},
{"MMIO", MMIO_CMD},
{"agp", AGP_CMD_QUEUE},
{"vram", VM_CMD_QUEUE},
{"mmio", MMIO_CMD},
{"\0", -1}
};
/* TV standard */
static const struct _sis_tvtype {
char name[6];
int type_no;
} sis_tvtype[] = {
{"PAL", 1},
{"NTSC", 2},
{"pal", 1},
{"ntsc", 2},
{"\0", -1}
};
static struct _sis_vrate {
static const struct _sis_vrate {
u16 idx;
u16 xres;
u16 yres;
......@@ -486,25 +612,34 @@ static struct _sis_vrate {
{5, 800, 600, 85}, {6, 800, 600, 100}, {7, 800, 600, 120}, {8, 800, 600, 160},
{1, 1024, 768, 43}, {2, 1024, 768, 60}, {3, 1024, 768, 70}, {4, 1024, 768, 75},
{5, 1024, 768, 85}, {6, 1024, 768, 100}, {7, 1024, 768, 120},
{1, 1024, 576, 60}, {2, 1024, 576, 65}, {3, 1024, 576, 75},
{1, 1024, 576, 60}, {2, 1024, 576, 75}, {3, 1024, 576, 85},
{1, 1024, 600, 60},
{1, 1152, 768, 60},
{1, 1280, 720, 60}, {2, 1280, 720, 75}, {3, 1280, 720, 85},
{1, 1280, 768, 60},
{1, 1280, 1024, 43}, {2, 1280, 1024, 60}, {3, 1280, 1024, 75}, {4, 1280, 1024, 85},
{1, 1280, 960, 60},
{1, 1280, 960, 70},
{1, 1400, 1050, 60},
{1, 1600, 1200, 60}, {2, 1600, 1200, 65}, {3, 1600, 1200, 70}, {4, 1600, 1200, 75},
{5, 1600, 1200, 85}, {6, 1600, 1200, 100}, {7, 1600, 1200, 120},
/* TW: Clock values for 1920x1440 guessed (except for the first one) */
{1, 1920, 1440, 60}, {2, 1920, 1440, 70}, {3, 1920, 1440, 75}, {4, 1920, 1440, 85},
{5, 1920, 1440,100}, {6, 1920, 1440, 120},
/* TW: Clock values for 2048x1536 guessed */
{1, 2048, 1536, 60}, {2, 2048, 1536, 70}, {3, 2048, 1536, 75}, {4, 2048, 1536, 85},
{5, 2048, 1536,100},
{1, 1920, 1440, 60}, {2, 1920, 1440, 65}, {3, 1920, 1440, 70}, {4, 1920, 1440, 75},
{5, 1920, 1440, 85}, {6, 1920, 1440, 100},
{1, 2048, 1536, 60}, {2, 2048, 1536, 65}, {3, 2048, 1536, 70}, {4, 2048, 1536, 75},
{5, 2048, 1536, 85},
{0, 0, 0, 0}
};
static const struct _chswtable {
int subsysVendor;
int subsysCard;
char *vendorName;
char *cardName;
} mychswtable[] = {
{ 0x1631, 0x1002, "Mitachi", "0x1002" },
{ 0, 0, "" , "" }
};
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
/* Offscreen layout */
typedef struct _SIS_GLYINFO {
unsigned char ch;
......@@ -513,6 +648,7 @@ typedef struct _SIS_GLYINFO {
u8 gmask[72];
int ngmask;
} SIS_GLYINFO;
#endif
typedef struct _SIS_OH {
struct _SIS_OH *poh_next;
......@@ -539,10 +675,10 @@ static unsigned long sisfb_hwcursor_vbase;
static unsigned long sisfb_heap_start;
static unsigned long sisfb_heap_end;
static unsigned long sisfb_heap_size;
static SIS_HEAP sisfb_heap;
static SIS_HEAP sisfb_heap;
// Eden Chen
static struct _sis_TV_filter {
static const struct _sis_TV_filter {
u8 filter[9][4];
} sis_TV_filter[] = {
{ {{0x00,0x00,0x00,0x40}, /* NTSCFilter_0 */
......@@ -691,114 +827,172 @@ static struct _sis_TV_filter {
{0xFF,0xFF,0xFF,0xFF} }}
};
static int filter = -1;
static int filter = -1;
static unsigned char filter_tb;
//~Eden Chen
/* ---------------------- Routine Prototype ------------------------- */
/* ---------------------- Routine prototypes ------------------------- */
/* Interface used by the world */
int sisfb_setup(char *options);
static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info);
static int sisfb_get_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
static int sisfb_set_var(struct fb_var_screeninfo *var, int con,
struct fb_info *info);
static int sisfb_get_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
static int sisfb_set_cmap(struct fb_cmap *cmap, int kspc, int con,
struct fb_info *info);
static int sisfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg, int con,
struct fb_info *info);
#ifndef MODULE
int sisfb_setup(char *options);
#endif
/* Interface to the low level console driver */
int sisfb_init(void);
static int sisfb_update_var(int con, struct fb_info *info);
static int sisfb_switch(int con, struct fb_info *info);
static void sisfb_blank(int blank, struct fb_info *info);
/* hardware access routines */
void sisfb_set_reg1(u16 port, u16 index, u16 data);
void sisfb_set_reg3(u16 port, u16 data);
void sisfb_set_reg4(u16 port, unsigned long data);
u8 sisfb_get_reg1(u16 port, u16 index);
u8 sisfb_get_reg2(u16 port);
u32 sisfb_get_reg3(u16 port);
/* Internal routines */
static void sisfb_search_mode(const char *name);
static void sisfb_validate_mode(void);
static u8 sisfb_search_refresh_rate(unsigned int rate);
static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green,
unsigned *blue, unsigned *transp,
struct fb_info *fb_info);
static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *fb_info);
static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
struct fb_info *info);
static void sisfb_set_disp(int con, struct fb_var_screeninfo *var);
static void sisfb_do_install_cmap(int con, struct fb_info *info);
/* Chip-dependent Routines */
int sisfb_init(void);
/* fbdev routines */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
static int sisfb_get_fix(struct fb_fix_screeninfo *fix,
int con,
struct fb_info *info);
static int sisfb_get_var(struct fb_var_screeninfo *var,
int con,
struct fb_info *info);
static int sisfb_set_var(struct fb_var_screeninfo *var,
int con,
struct fb_info *info);
static void sisfb_crtc_to_var(struct fb_var_screeninfo *var);
static int sisfb_get_cmap(struct fb_cmap *cmap,
int kspc,
int con,
struct fb_info *info);
static int sisfb_set_cmap(struct fb_cmap *cmap,
int kspc,
int con,
struct fb_info *info);
static int sisfb_update_var(int con,
struct fb_info *info);
static int sisfb_switch(int con,
struct fb_info *info);
static void sisfb_blank(int blank,
struct fb_info *info);
static void sisfb_set_disp(int con,
struct fb_var_screeninfo *var,
struct fb_info *info);
static int sis_getcolreg(unsigned regno, unsigned *red, unsigned *green,
unsigned *blue, unsigned *transp,
struct fb_info *fb_info);
static void sisfb_do_install_cmap(int con,
struct fb_info *info);
static void sis_get_glyph(struct fb_info *info,
SIS_GLYINFO *gly);
static int sisfb_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma);
static int sisfb_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg, int con,
struct fb_info *info);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
static int sisfb_set_par(struct fb_info *info);
static int sisfb_blank(int blank,
struct fb_info *info);
static int sisfb_mmap(struct fb_info *info, struct file *file,
struct vm_area_struct *vma);
extern void sisfb_fillrect(struct fb_info *info,
const struct fb_fillrect *rect);
extern void sisfb_copyarea(struct fb_info *info,
const struct fb_copyarea *area);
extern int sisfb_sync(struct fb_info *info);
static int sisfb_ioctl(struct inode *inode,
struct file *file,
unsigned int cmd,
unsigned long arg,
struct fb_info *info);
extern int sisfb_mode_rate_to_dclock(SiS_Private *SiS_Pr,
PSIS_HW_DEVICE_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex);
extern int sisfb_mode_rate_to_ddata(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension,
unsigned char modeno, unsigned char rateindex,
unsigned int *left_margin, unsigned int *right_margin,
unsigned int *upper_margin, unsigned int *lower_margin,
unsigned int *hsync_len, unsigned int *vsync_len,
unsigned int *sync, unsigned int *vmode);
#endif
static int sisfb_get_fix(struct fb_fix_screeninfo *fix, int con,
struct fb_info *info);
/* Internal 2D accelerator functions */
extern int sisfb_initaccel(void);
extern void sisfb_syncaccel(void);
/* Internal general routines */
static void sisfb_search_mode(const char *name);
static int sisfb_validate_mode(int modeindex);
static u8 sisfb_search_refresh_rate(unsigned int rate);
static int sisfb_setcolreg(unsigned regno, unsigned red, unsigned green,
unsigned blue, unsigned transp,
struct fb_info *fb_info);
static int sisfb_do_set_var(struct fb_var_screeninfo *var, int isactive,
struct fb_info *info);
static void sisfb_pre_setmode(void);
static void sisfb_post_setmode(void);
static char * sis_find_rom(void);
static BOOLEAN sisfb_CheckVBRetrace(void);
static BOOLEAN sisfbcheckvretracecrt2(void);
static BOOLEAN sisfbcheckvretracecrt1(void);
static BOOLEAN sisfb_bridgeisslave(void);
/* SiS-specific Export functions */
void sis_dispinfo(struct ap_data *rec);
void sis_malloc(struct sis_memreq *req);
void sis_free(unsigned long base);
/* Internal hardware access routines */
void sisfb_set_reg4(u16 port, unsigned long data);
u32 sisfb_get_reg3(u16 port);
/* Chipset-dependent internal routines */
#ifdef CONFIG_FB_SIS_300
static int sisfb_get_dram_size_300(void);
static void sisfb_detect_VB_connect_300(void);
static void sisfb_get_VB_type_300(void);
static int sisfb_has_VB_300(void);
static int sisfb_get_dram_size_300(void);
static void sisfb_detect_VB_connect_300(void);
static void sisfb_get_VB_type_300(void);
static int sisfb_has_VB_300(void);
#endif
#ifdef CONFIG_FB_SIS_315
static int sisfb_get_dram_size_315(void);
static void sisfb_detect_VB_connect_315(void);
static void sisfb_get_VB_type_315(void);
static int sisfb_has_VB_315(void);
static int sisfb_get_dram_size_315(void);
static void sisfb_detect_VB_connect_315(void);
static void sisfb_get_VB_type_315(void);
static int sisfb_has_VB_315(void);
#endif
/* Routines from init.c/init301.c */
/* Internal heap routines */
static int sisfb_heap_init(void);
static SIS_OH *sisfb_poh_new_node(void);
static SIS_OH *sisfb_poh_allocate(unsigned long size);
static void sisfb_delete_node(SIS_OH *poh);
static void sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh);
static SIS_OH *sisfb_poh_free(unsigned long base);
static void sisfb_free_node(SIS_OH *poh);
extern void SiSRegInit(USHORT BaseAddr);
extern BOOLEAN SiSInit(PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiSSetMode(PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo);
extern void SetEnableDstn(void);
/* Internal routines to access PCI configuration space */
BOOLEAN sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext,
unsigned long offset, unsigned long set, unsigned long *value);
BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext,
unsigned long offset, unsigned long set, unsigned long *value);
/* TW: Chrontel TV functions */
extern USHORT SiS_IF_DEF_CH70xx;
extern USHORT SiS_GetCH700x(USHORT tempbx);
extern void SiS_SetCH700x(USHORT tempbx);
extern USHORT SiS_GetCH701x(USHORT tempbx);
extern void SiS_SetCH701x(USHORT tempbx);
extern void SiS_SetCH70xxANDOR(USHORT tempax,USHORT tempbh);
extern void SiS_DDC2Delay(USHORT delaytime);
static void sisfb_pre_setmode(void);
static void sisfb_post_setmode(void);
static void sisfb_crtc_to_var(struct fb_var_screeninfo *var);
/* Export functions */
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,23)
static void sis_get_glyph(SIS_GLYINFO *gly);
#else
static void sis_get_glyph(struct fb_info *info, SIS_GLYINFO *gly);
#endif
void sis_dispinfo(struct ap_data *rec);
void sis_malloc(struct sis_memreq *req);
void sis_free(unsigned long base);
/* heap routines */
static int sisfb_heap_init(void);
static SIS_OH *sisfb_poh_new_node(void);
static SIS_OH *sisfb_poh_allocate(unsigned long size);
static void sisfb_delete_node(SIS_OH *poh);
static void sisfb_insert_node(SIS_OH *pohList, SIS_OH *poh);
static SIS_OH *sisfb_poh_free(unsigned long base);
static void sisfb_free_node(SIS_OH *poh);
/* routines to access PCI configuration space */
BOOLEAN sisfb_query_VGA_config_space(PSIS_HW_DEVICE_INFO psishw_ext,
unsigned long offset, unsigned long set, unsigned long *value);
BOOLEAN sisfb_query_north_bridge_space(PSIS_HW_DEVICE_INFO psishw_ext,
unsigned long offset, unsigned long set, unsigned long *value);
/* Routines from init.c/init301.c */
extern void SiSRegInit(SiS_Private *SiS_Pr, USHORT BaseAddr);
extern BOOLEAN SiSInit(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension);
extern BOOLEAN SiSSetMode(SiS_Private *SiS_Pr, PSIS_HW_DEVICE_INFO HwDeviceExtension, USHORT ModeNo);
extern void SiS_SetEnableDstn(SiS_Private *SiS_Pr);
extern void SiS_LongWait(SiS_Private *SiS_Pr);
/* TW: Chrontel TV functions */
extern USHORT SiS_GetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
extern void SiS_SetCH700x(SiS_Private *SiS_Pr, USHORT tempbx);
extern USHORT SiS_GetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
extern void SiS_SetCH701x(SiS_Private *SiS_Pr, USHORT tempbx);
extern void SiS_SetCH70xxANDOR(SiS_Private *SiS_Pr, USHORT tempax,USHORT tempbh);
extern void SiS_DDC2Delay(SiS_Private *SiS_Pr, USHORT delaytime);
/* TW: Sensing routines */
void SiS_Sense30x(void);
int SISDoSense(int tempbl, int tempbh, int tempcl, int tempch);
void SiS_SenseCh(void);
#endif
......@@ -99,9 +99,8 @@ typedef enum _SIS_CHIP_TYPE {
SIS_315,
SIS_315PRO, /* SiS 325 */
SIS_550,
SIS_640,
SIS_740,
SIS_650,
SIS_740,
SIS_330,
MAX_SIS_CHIP
} SIS_CHIP_TYPE;
......@@ -119,7 +118,6 @@ typedef enum _SIS_VB_CHIP_TYPE {
VB_CHIP_302,
VB_CHIP_302B,
VB_CHIP_302LV,
VB_CHIP_303,
VB_CHIP_UNKNOWN, /* other video bridge or no video bridge */
MAX_VB_CHIP
} SIS_VB_CHIP_TYPE;
......@@ -174,6 +172,7 @@ struct _SIS_HW_DEVICE_INFO
/* if NULL, then read from pjROMImage; */
/* Note:ROM image file is the file of VBIOS ROM */
BOOLEAN UseROM; /* TW: Use the ROM image if provided */
UCHAR *pjCustomizedROMImage;/* base virtual address of ROM image file. */
/* wincE:ROM image file is the file for OEM */
......@@ -208,6 +207,7 @@ struct _SIS_HW_DEVICE_INFO
/* 011:Trumpion LVDS Scaling Chip */
/* 100:LVDS(LCD-out)+Chrontel 7005 */
/* 101:Single Chrontel 7005 */
/* TW: This has changed on 310/325 series! */
ULONG ulCRT2LCDType; /* defined in the data structure type */
/* "SIS_LCD_TYPE" */
......@@ -234,13 +234,17 @@ struct _SIS_HW_DEVICE_INFO
UCHAR szVBIOSVer[VBIOS_VER_MAX_LENGTH];
UCHAR pdc; /* TW: PanelDelayCompensation */
#ifdef LINUX_KERNEL
BOOLEAN Is301BDH;
#endif
#ifdef LINUX_XF86
PCITAG PciTag; /* PCI Tag for Linux XF86 */
#endif
};
#endif
#endif /*~ mark by Paul ,Move definition to sisv.h */
#endif
/* TW: Addtional IOCTL for communication sisfb <> X driver */
......@@ -268,7 +272,19 @@ struct _SISFB_INFO {
unsigned char sisfb_revision;
unsigned char sisfb_patchlevel;
char reserved[253]; /* for future use */
unsigned char sisfb_caps; /* sisfb's capabilities */
int sisfb_tqlen; /* turbo queue length (in KB) */
unsigned int sisfb_pcibus; /* The card's PCI ID */
unsigned int sisfb_pcislot;
unsigned int sisfb_pcifunc;
unsigned char sisfb_lcdpdc;
unsigned char sisfb_lcda;
char reserved[235]; /* for future use */
};
#endif
......
......@@ -4,9 +4,12 @@
#define EXTERN extern
#endif /* _INIT_ */
#ifndef _VSTRUCT_
#define _VSTRUCT_
typedef struct _SiS_PanelDelayTblStruct
{
UCHAR timer[2];
UCHAR timer[2];
} SiS_PanelDelayTblStruct;
typedef struct _SiS_LCDDataStruct
......@@ -28,12 +31,12 @@ typedef struct _SiS_TVDataStruct
USHORT TVHDE;
USHORT TVVDE;
USHORT RVBHRS;
UCHAR FlickerMode;
UCHAR FlickerMode;
USHORT HALFRVBHRS;
UCHAR RY1COE;
UCHAR RY2COE;
UCHAR RY3COE;
UCHAR RY4COE;
UCHAR RY1COE;
UCHAR RY2COE;
UCHAR RY3COE;
UCHAR RY4COE;
} SiS_TVDataStruct;
typedef struct _SiS_LVDSDataStruct
......@@ -52,30 +55,30 @@ typedef struct _SiS_LVDSDesStruct
typedef struct _SiS_LVDSCRT1DataStruct
{
UCHAR CR[15];
UCHAR CR[15];
} SiS_LVDSCRT1DataStruct;
/*add for LCDA*/
typedef struct _SiS_LCDACRT1DataStruct
{
UCHAR CR[17];
UCHAR CR[17];
} SiS_LCDACRT1DataStruct;
typedef struct _SiS_CHTVRegDataStruct
{
UCHAR Reg[16];
UCHAR Reg[16];
} SiS_CHTVRegDataStruct;
typedef struct _SiS_StStruct
{
UCHAR St_ModeID;
UCHAR St_ModeID;
USHORT St_ModeFlag;
UCHAR St_StTableIndex;
UCHAR St_CRT2CRTC;
UCHAR St_ResInfo;
UCHAR VB_StTVFlickerIndex;
UCHAR VB_StTVEdgeIndex;
UCHAR VB_StTVYFilterIndex;
UCHAR St_StTableIndex;
UCHAR St_CRT2CRTC;
UCHAR St_ResInfo;
UCHAR VB_StTVFlickerIndex;
UCHAR VB_StTVEdgeIndex;
UCHAR VB_StTVYFilterIndex;
} SiS_StStruct;
typedef struct _SiS_VBModeStruct
......@@ -92,38 +95,38 @@ typedef struct _SiS_VBModeStruct
typedef struct _SiS_StandTableStruct
{
UCHAR CRT_COLS;
UCHAR ROWS;
UCHAR CHAR_HEIGHT;
UCHAR CRT_COLS;
UCHAR ROWS;
UCHAR CHAR_HEIGHT;
USHORT CRT_LEN;
UCHAR SR[4];
UCHAR MISC;
UCHAR CRTC[0x19];
UCHAR ATTR[0x14];
UCHAR GRC[9];
UCHAR SR[4];
UCHAR MISC;
UCHAR CRTC[0x19];
UCHAR ATTR[0x14];
UCHAR GRC[9];
} SiS_StandTableStruct;
typedef struct _SiS_ExtStruct
{
UCHAR Ext_ModeID;
UCHAR Ext_ModeID;
USHORT Ext_ModeFlag;
USHORT Ext_ModeInfo;
USHORT Ext_Point;
USHORT Ext_VESAID;
UCHAR Ext_VESAMEMSize;
UCHAR Ext_RESINFO;
UCHAR VB_ExtTVFlickerIndex;
UCHAR VB_ExtTVEdgeIndex;
UCHAR VB_ExtTVYFilterIndex;
UCHAR REFindex;
UCHAR Ext_VESAMEMSize;
UCHAR Ext_RESINFO;
UCHAR VB_ExtTVFlickerIndex;
UCHAR VB_ExtTVEdgeIndex;
UCHAR VB_ExtTVYFilterIndex;
UCHAR REFindex;
} SiS_ExtStruct;
typedef struct _SiS_Ext2Struct
{
USHORT Ext_InfoFlag;
UCHAR Ext_CRT1CRTC;
UCHAR Ext_CRTVCLK;
UCHAR Ext_CRT2CRTC;
UCHAR Ext_CRT1CRTC;
UCHAR Ext_CRTVCLK;
UCHAR Ext_CRT2CRTC;
UCHAR ModeID;
USHORT XRes;
USHORT YRes;
......@@ -132,35 +135,35 @@ typedef struct _SiS_Ext2Struct
typedef struct _SiS_Part2PortTblStruct
{
UCHAR CR[12];
UCHAR CR[12];
} SiS_Part2PortTblStruct;
typedef struct _SiS_CRT1TableStruct
{
UCHAR CR[17];
UCHAR CR[17];
} SiS_CRT1TableStruct;
typedef struct _SiS_MCLKDataStruct
{
UCHAR SR28,SR29,SR2A;
UCHAR SR28,SR29,SR2A;
USHORT CLOCK;
} SiS_MCLKDataStruct;
typedef struct _SiS_ECLKDataStruct
{
UCHAR SR2E,SR2F,SR30;
UCHAR SR2E,SR2F,SR30;
USHORT CLOCK;
} SiS_ECLKDataStruct;
typedef struct _SiS_VCLKDataStruct
{
UCHAR SR2B,SR2C;
UCHAR SR2B,SR2C;
USHORT CLOCK;
} SiS_VCLKDataStruct;
typedef struct _SiS_VBVCLKDataStruct
{
UCHAR Part4_A,Part4_B;
UCHAR Part4_A,Part4_B;
USHORT CLOCK;
} SiS_VBVCLKDataStruct;
......@@ -178,213 +181,401 @@ typedef struct _SiS_ModeResInfoStruct
UCHAR YChar;
} SiS_ModeResInfoStruct;
EXTERN SiS_StStruct *SiS_SModeIDTable;
EXTERN SiS_StandTableStruct *SiS_StandTable;
EXTERN SiS_ExtStruct *SiS_EModeIDTable;
EXTERN SiS_Ext2Struct *SiS_RefIndex;
EXTERN SiS_VBModeStruct *SiS_VBModeIDTable;
EXTERN SiS_CRT1TableStruct *SiS_CRT1Table;
EXTERN SiS_MCLKDataStruct *SiS_MCLKData_0;
EXTERN SiS_MCLKDataStruct *SiS_MCLKData_1;
EXTERN SiS_ECLKDataStruct *SiS_ECLKData;
EXTERN SiS_VCLKDataStruct *SiS_VCLKData;
EXTERN SiS_VBVCLKDataStruct *SiS_VBVCLKData;
EXTERN SiS_StResInfoStruct *SiS_StResInfo;
EXTERN SiS_ModeResInfoStruct *SiS_ModeResInfo;
EXTERN UCHAR *SiS_ScreenOffset;
EXTERN UCHAR *pSiS_OutputSelect;
EXTERN UCHAR *pSiS_SoftSetting;
EXTERN UCHAR *pSiS_SR07;
typedef UCHAR DRAM4Type[4];
EXTERN DRAM4Type *SiS_SR15; /* pointer : point to array */
EXTERN DRAM4Type *SiS_CR40; /* pointer : point to array */
EXTERN UCHAR *SiS_CR49;
EXTERN UCHAR *SiS_SR25;
EXTERN UCHAR *pSiS_SR1F;
EXTERN UCHAR *pSiS_SR21;
EXTERN UCHAR *pSiS_SR22;
EXTERN UCHAR *pSiS_SR23;
EXTERN UCHAR *pSiS_SR24;
EXTERN UCHAR *pSiS_SR31;
EXTERN UCHAR *pSiS_SR32;
EXTERN UCHAR *pSiS_SR33;
EXTERN UCHAR *pSiS_CRT2Data_1_2;
EXTERN UCHAR *pSiS_CRT2Data_4_D;
EXTERN UCHAR *pSiS_CRT2Data_4_E;
EXTERN UCHAR *pSiS_CRT2Data_4_10;
EXTERN USHORT *pSiS_RGBSenseData;
EXTERN USHORT *pSiS_VideoSenseData;
EXTERN USHORT *pSiS_YCSenseData;
EXTERN USHORT *pSiS_RGBSenseData2; /*301b*/
EXTERN USHORT *pSiS_VideoSenseData2;
EXTERN USHORT *pSiS_YCSenseData2;
EXTERN UCHAR *SiS_NTSCPhase;
EXTERN UCHAR *SiS_PALPhase;
EXTERN UCHAR *SiS_NTSCPhase2;
EXTERN UCHAR *SiS_PALPhase2;
EXTERN UCHAR *SiS_PALMPhase;
EXTERN UCHAR *SiS_PALNPhase;
EXTERN UCHAR *SiS_PALMPhase2;
EXTERN UCHAR *SiS_PALNPhase2;
EXTERN SiS_LCDDataStruct *SiS_StLCD1024x768Data;
EXTERN SiS_LCDDataStruct *SiS_ExtLCD1024x768Data;
EXTERN SiS_LCDDataStruct *SiS_St2LCD1024x768Data;
EXTERN SiS_LCDDataStruct *SiS_StLCD1280x1024Data;
EXTERN SiS_LCDDataStruct *SiS_ExtLCD1280x1024Data;
EXTERN SiS_LCDDataStruct *SiS_St2LCD1280x1024Data;
EXTERN SiS_LCDDataStruct *SiS_NoScaleData1024x768;
EXTERN SiS_LCDDataStruct *SiS_NoScaleData1280x1024;
EXTERN SiS_LCDDataStruct *SiS_LCD1280x960Data;
EXTERN SiS_TVDataStruct *SiS_StPALData;
EXTERN SiS_TVDataStruct *SiS_ExtPALData;
EXTERN SiS_TVDataStruct *SiS_StNTSCData;
EXTERN SiS_TVDataStruct *SiS_ExtNTSCData;
EXTERN SiS_TVDataStruct *SiS_St1HiTVData;
EXTERN SiS_TVDataStruct *SiS_St2HiTVData;
EXTERN SiS_TVDataStruct *SiS_ExtHiTVData;
EXTERN UCHAR *SiS_NTSCTiming;
EXTERN UCHAR *SiS_PALTiming;
EXTERN UCHAR *SiS_HiTVExtTiming;
EXTERN UCHAR *SiS_HiTVSt1Timing;
EXTERN UCHAR *SiS_HiTVSt2Timing;
EXTERN UCHAR *SiS_HiTVTextTiming;
EXTERN UCHAR *SiS_HiTVGroup3Data;
EXTERN UCHAR *SiS_HiTVGroup3Simu;
EXTERN UCHAR *SiS_HiTVGroup3Text;
EXTERN SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
EXTERN SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
EXTERN SiS_LVDSDataStruct *SiS_LVDS800x600Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS800x600Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1024x768Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1024x768Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1280x1024Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1280x1024Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1280x960Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1280x960Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1400x1050Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1400x1050Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1024x600Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1024x600Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1152x768Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS1152x768Data_2;
EXTERN SiS_LVDSDataStruct *SiS_LVDS640x480Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDS320x480Data_1;
EXTERN SiS_LVDSDataStruct *SiS_LVDSXXXxXXXData_1;
EXTERN SiS_LVDSDataStruct *SiS_CHTVUNTSCData;
EXTERN SiS_LVDSDataStruct *SiS_CHTVONTSCData;
EXTERN SiS_LVDSDataStruct *SiS_CHTVUPALData;
EXTERN SiS_LVDSDataStruct *SiS_CHTVOPALData;
EXTERN SiS_LVDSDesStruct *SiS_PanelType00_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType01_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType02_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType03_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType04_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType05_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType06_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType07_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType08_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType09_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0a_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0b_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0c_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0d_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0e_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0f_1;
EXTERN SiS_LVDSDesStruct *SiS_PanelType00_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType01_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType02_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType03_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType04_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType05_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType06_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType07_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType08_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType09_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0a_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0b_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0c_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0d_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0e_2;
EXTERN SiS_LVDSDesStruct *SiS_PanelType0f_2;
EXTERN SiS_LVDSDesStruct *LVDS1024x768Des_1;
EXTERN SiS_LVDSDesStruct *LVDS1280x1024Des_1;
EXTERN SiS_LVDSDesStruct *LVDS1280x960Des_1;
EXTERN SiS_LVDSDesStruct *LVDS1024x768Des_2;
EXTERN SiS_LVDSDesStruct *LVDS1280x1024Des_2;
EXTERN SiS_LVDSDesStruct *LVDS1280x960Des_2;
EXTERN SiS_LVDSDesStruct *SiS_CHTVUNTSCDesData;
EXTERN SiS_LVDSDesStruct *SiS_CHTVONTSCDesData;
EXTERN SiS_LVDSDesStruct *SiS_CHTVUPALDesData;
EXTERN SiS_LVDSDesStruct *SiS_CHTVOPALDesData;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_2;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_2;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_2;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_2;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_2;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_2;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_2_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_2_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_2_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_2_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_2_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_2_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1XXXxXXX_1;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1XXXxXXX_1_H;
EXTERN SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UNTSC;
EXTERN SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1ONTSC;
EXTERN SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UPAL;
EXTERN SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1OPAL;
EXTERN SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1320x480_1;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_1;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_1;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_1;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_1_H;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_1_H;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_1_H;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_2;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_2;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_2_H;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_2_H;
EXTERN SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2_H;
/* TW: New from 650/301LV BIOS */
EXTERN SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
EXTERN SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
EXTERN SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_2;
EXTERN SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_2;
EXTERN SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_3;
EXTERN SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_3;
EXTERN SiS_CHTVRegDataStruct *SiS_CHTVReg_UNTSC;
EXTERN SiS_CHTVRegDataStruct *SiS_CHTVReg_ONTSC;
EXTERN SiS_CHTVRegDataStruct *SiS_CHTVReg_UPAL;
EXTERN SiS_CHTVRegDataStruct *SiS_CHTVReg_OPAL;
EXTERN UCHAR *SiS_CHTVVCLKUNTSC;
EXTERN UCHAR *SiS_CHTVVCLKONTSC;
EXTERN UCHAR *SiS_CHTVVCLKUPAL;
EXTERN UCHAR *SiS_CHTVVCLKOPAL;
typedef struct _SiS_Private
{
#ifdef LINUX_KERNEL
USHORT RelIO;
#endif
USHORT SiS_P3c4;
USHORT SiS_P3d4;
USHORT SiS_P3c0;
USHORT SiS_P3ce;
USHORT SiS_P3c2;
USHORT SiS_P3ca;
USHORT SiS_P3c6;
USHORT SiS_P3c7;
USHORT SiS_P3c8;
USHORT SiS_P3c9;
USHORT SiS_P3da;
USHORT SiS_Part1Port;
USHORT SiS_Part2Port;
USHORT SiS_Part3Port;
USHORT SiS_Part4Port;
USHORT SiS_Part5Port;
USHORT SiS_IF_DEF_LVDS;
USHORT SiS_IF_DEF_TRUMPION;
USHORT SiS_IF_DEF_DSTN;
USHORT SiS_IF_DEF_FSTN;
USHORT SiS_IF_DEF_CH70xx;
USHORT SiS_IF_DEF_HiVision;
UCHAR SiS_VGAINFO;
BOOLEAN SiS_UseROM;
int SiS_CHOverScan;
BOOLEAN SiS_CHSOverScan;
BOOLEAN SiS_ChSW;
BOOLEAN SiS_UseLCDA;
int SiS_UseOEM;
USHORT SiS_Backup70xx;
USHORT SiS_CRT1Mode;
USHORT SiS_flag_clearbuffer;
int SiS_RAMType;
UCHAR SiS_ChannelAB;
UCHAR SiS_DataBusWidth;
USHORT SiS_ModeType;
USHORT SiS_VBInfo;
USHORT SiS_LCDResInfo;
USHORT SiS_LCDTypeInfo;
USHORT SiS_LCDInfo;
USHORT SiS_VBType;
USHORT SiS_VBExtInfo;
USHORT SiS_HiVision;
USHORT SiS_SelectCRT2Rate;
USHORT SiS_SetFlag;
USHORT SiS_RVBHCFACT;
USHORT SiS_RVBHCMAX;
USHORT SiS_RVBHRS;
USHORT SiS_VGAVT;
USHORT SiS_VGAHT;
USHORT SiS_VT;
USHORT SiS_HT;
USHORT SiS_VGAVDE;
USHORT SiS_VGAHDE;
USHORT SiS_VDE;
USHORT SiS_HDE;
USHORT SiS_NewFlickerMode;
USHORT SiS_RY1COE;
USHORT SiS_RY2COE;
USHORT SiS_RY3COE;
USHORT SiS_RY4COE;
USHORT SiS_LCDHDES;
USHORT SiS_LCDVDES;
USHORT SiS_DDC_Port;
USHORT SiS_DDC_Index;
USHORT SiS_DDC_Data;
USHORT SiS_DDC_Clk;
USHORT SiS_DDC_DataShift;
USHORT SiS_DDC_DeviceAddr;
USHORT SiS_DDC_ReadAddr;
USHORT SiS_DDC_SecAddr;
USHORT SiS_Panel800x600;
USHORT SiS_Panel1024x768;
USHORT SiS_Panel1280x1024;
USHORT SiS_Panel1600x1200;
USHORT SiS_Panel1280x960;
USHORT SiS_Panel1400x1050;
USHORT SiS_Panel320x480;
USHORT SiS_Panel1152x768;
USHORT SiS_Panel1280x768;
USHORT SiS_Panel1024x600;
USHORT SiS_Panel640x480;
USHORT SiS_Panel1152x864;
USHORT SiS_PanelMax;
USHORT SiS_PanelMinLVDS;
USHORT SiS_PanelMin301;
USHORT SiS_ChrontelInit;
/* Pointers: */
const SiS_StStruct *SiS_SModeIDTable;
const SiS_StandTableStruct *SiS_StandTable;
const SiS_ExtStruct *SiS_EModeIDTable;
const SiS_Ext2Struct *SiS_RefIndex;
const SiS_VBModeStruct *SiS_VBModeIDTable;
const SiS_CRT1TableStruct *SiS_CRT1Table;
const SiS_MCLKDataStruct *SiS_MCLKData_0;
const SiS_MCLKDataStruct *SiS_MCLKData_1;
const SiS_ECLKDataStruct *SiS_ECLKData;
const SiS_VCLKDataStruct *SiS_VCLKData;
const SiS_VBVCLKDataStruct *SiS_VBVCLKData;
const SiS_StResInfoStruct *SiS_StResInfo;
const SiS_ModeResInfoStruct *SiS_ModeResInfo;
const UCHAR *SiS_ScreenOffset;
const UCHAR *pSiS_OutputSelect;
const UCHAR *pSiS_SoftSetting;
const DRAM4Type *SiS_SR15; /* pointer : point to array */
#ifndef LINUX_XF86
UCHAR *pSiS_SR07;
const DRAM4Type *SiS_CR40; /* pointer : point to array */
UCHAR *SiS_CR49;
UCHAR *SiS_SR25;
UCHAR *pSiS_SR1F;
UCHAR *pSiS_SR21;
UCHAR *pSiS_SR22;
UCHAR *pSiS_SR23;
UCHAR *pSiS_SR24;
UCHAR *pSiS_SR31;
UCHAR *pSiS_SR32;
UCHAR *pSiS_SR33;
UCHAR *pSiS_CRT2Data_1_2;
UCHAR *pSiS_CRT2Data_4_D;
UCHAR *pSiS_CRT2Data_4_E;
UCHAR *pSiS_CRT2Data_4_10;
const USHORT *pSiS_RGBSenseData;
const USHORT *pSiS_VideoSenseData;
const USHORT *pSiS_YCSenseData;
const USHORT *pSiS_RGBSenseData2; /*301b*/
const USHORT *pSiS_VideoSenseData2;
const USHORT *pSiS_YCSenseData2;
#endif
const UCHAR *SiS_NTSCPhase;
const UCHAR *SiS_PALPhase;
const UCHAR *SiS_NTSCPhase2;
const UCHAR *SiS_PALPhase2;
const UCHAR *SiS_PALMPhase;
const UCHAR *SiS_PALNPhase;
const UCHAR *SiS_PALMPhase2;
const UCHAR *SiS_PALNPhase2;
const UCHAR *SiS_SpecialPhase;
const SiS_LCDDataStruct *SiS_StLCD1024x768Data;
const SiS_LCDDataStruct *SiS_ExtLCD1024x768Data;
const SiS_LCDDataStruct *SiS_St2LCD1024x768Data;
const SiS_LCDDataStruct *SiS_StLCD1280x1024Data;
const SiS_LCDDataStruct *SiS_ExtLCD1280x1024Data;
const SiS_LCDDataStruct *SiS_St2LCD1280x1024Data;
const SiS_LCDDataStruct *SiS_NoScaleData1024x768;
const SiS_LCDDataStruct *SiS_NoScaleData1280x1024;
const SiS_LCDDataStruct *SiS_LCD1280x960Data;
const SiS_LCDDataStruct *SiS_NoScaleData1400x1050;
const SiS_LCDDataStruct *SiS_NoScaleData1600x1200;
const SiS_LCDDataStruct *SiS_StLCD1400x1050Data;
const SiS_LCDDataStruct *SiS_StLCD1600x1200Data;
const SiS_LCDDataStruct *SiS_ExtLCD1400x1050Data;
const SiS_LCDDataStruct *SiS_ExtLCD1600x1200Data;
const SiS_TVDataStruct *SiS_StPALData;
const SiS_TVDataStruct *SiS_ExtPALData;
const SiS_TVDataStruct *SiS_StNTSCData;
const SiS_TVDataStruct *SiS_ExtNTSCData;
/* const SiS_TVDataStruct *SiS_St1HiTVData; */
const SiS_TVDataStruct *SiS_St2HiTVData;
const SiS_TVDataStruct *SiS_ExtHiTVData;
const UCHAR *SiS_NTSCTiming;
const UCHAR *SiS_PALTiming;
const UCHAR *SiS_HiTVExtTiming;
const UCHAR *SiS_HiTVSt1Timing;
const UCHAR *SiS_HiTVSt2Timing;
const UCHAR *SiS_HiTVTextTiming;
const UCHAR *SiS_HiTVGroup3Data;
const UCHAR *SiS_HiTVGroup3Simu;
const UCHAR *SiS_HiTVGroup3Text;
const SiS_PanelDelayTblStruct *SiS_PanelDelayTbl;
const SiS_PanelDelayTblStruct *SiS_PanelDelayTblLVDS;
const SiS_LVDSDataStruct *SiS_LVDS800x600Data_1;
const SiS_LVDSDataStruct *SiS_LVDS800x600Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1024x768Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1024x768Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1280x1024Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1280x1024Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1280x960Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1280x960Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1400x1050Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1400x1050Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1280x768Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1280x768Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1024x600Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1024x600Data_2;
const SiS_LVDSDataStruct *SiS_LVDS1152x768Data_1;
const SiS_LVDSDataStruct *SiS_LVDS1152x768Data_2;
const SiS_LVDSDataStruct *SiS_LVDS640x480Data_1;
const SiS_LVDSDataStruct *SiS_LVDS320x480Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1400x1050Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1400x1050Data_2;
const SiS_LVDSDataStruct *SiS_LCDA1600x1200Data_1;
const SiS_LVDSDataStruct *SiS_LCDA1600x1200Data_2;
const SiS_LVDSDataStruct *SiS_LVDSXXXxXXXData_1;
const SiS_LVDSDataStruct *SiS_CHTVUNTSCData;
const SiS_LVDSDataStruct *SiS_CHTVONTSCData;
const SiS_LVDSDataStruct *SiS_CHTVUPALData;
const SiS_LVDSDataStruct *SiS_CHTVOPALData;
const SiS_LVDSDataStruct *SiS_CHTVUPALMData;
const SiS_LVDSDataStruct *SiS_CHTVOPALMData;
const SiS_LVDSDataStruct *SiS_CHTVUPALNData;
const SiS_LVDSDataStruct *SiS_CHTVOPALNData;
const SiS_LVDSDataStruct *SiS_CHTVSOPALData;
const SiS_LVDSDesStruct *SiS_PanelType00_1;
const SiS_LVDSDesStruct *SiS_PanelType01_1;
const SiS_LVDSDesStruct *SiS_PanelType02_1;
const SiS_LVDSDesStruct *SiS_PanelType03_1;
const SiS_LVDSDesStruct *SiS_PanelType04_1;
const SiS_LVDSDesStruct *SiS_PanelType05_1;
const SiS_LVDSDesStruct *SiS_PanelType06_1;
const SiS_LVDSDesStruct *SiS_PanelType07_1;
const SiS_LVDSDesStruct *SiS_PanelType08_1;
const SiS_LVDSDesStruct *SiS_PanelType09_1;
const SiS_LVDSDesStruct *SiS_PanelType0a_1;
const SiS_LVDSDesStruct *SiS_PanelType0b_1;
const SiS_LVDSDesStruct *SiS_PanelType0c_1;
const SiS_LVDSDesStruct *SiS_PanelType0d_1;
const SiS_LVDSDesStruct *SiS_PanelType0e_1;
const SiS_LVDSDesStruct *SiS_PanelType0f_1;
const SiS_LVDSDesStruct *SiS_PanelType00_2;
const SiS_LVDSDesStruct *SiS_PanelType01_2;
const SiS_LVDSDesStruct *SiS_PanelType02_2;
const SiS_LVDSDesStruct *SiS_PanelType03_2;
const SiS_LVDSDesStruct *SiS_PanelType04_2;
const SiS_LVDSDesStruct *SiS_PanelType05_2;
const SiS_LVDSDesStruct *SiS_PanelType06_2;
const SiS_LVDSDesStruct *SiS_PanelType07_2;
const SiS_LVDSDesStruct *SiS_PanelType08_2;
const SiS_LVDSDesStruct *SiS_PanelType09_2;
const SiS_LVDSDesStruct *SiS_PanelType0a_2;
const SiS_LVDSDesStruct *SiS_PanelType0b_2;
const SiS_LVDSDesStruct *SiS_PanelType0c_2;
const SiS_LVDSDesStruct *SiS_PanelType0d_2;
const SiS_LVDSDesStruct *SiS_PanelType0e_2;
const SiS_LVDSDesStruct *SiS_PanelType0f_2;
const SiS_LVDSDesStruct *LVDS1024x768Des_1;
const SiS_LVDSDesStruct *LVDS1280x1024Des_1;
const SiS_LVDSDesStruct *LVDS1400x1050Des_1;
const SiS_LVDSDesStruct *LVDS1600x1200Des_1;
const SiS_LVDSDesStruct *LVDS1024x768Des_2;
const SiS_LVDSDesStruct *LVDS1280x1024Des_2;
const SiS_LVDSDesStruct *LVDS1400x1050Des_2;
const SiS_LVDSDesStruct *LVDS1600x1200Des_2;
const SiS_LVDSDesStruct *SiS_CHTVUNTSCDesData;
const SiS_LVDSDesStruct *SiS_CHTVONTSCDesData;
const SiS_LVDSDesStruct *SiS_CHTVUPALDesData;
const SiS_LVDSDesStruct *SiS_CHTVOPALDesData;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x768_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11600x1200_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x768_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11600x1200_1_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x768_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11600x1200_2;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1800x600_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x768_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x1024_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11400x1050_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11280x768_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11024x600_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11152x768_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT11600x1200_2_H;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1XXXxXXX_1;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1XXXxXXX_1_H;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UNTSC;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1ONTSC;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1UPAL;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1OPAL;
const SiS_LVDSCRT1DataStruct *SiS_CHTVCRT1SOPAL;
const SiS_LVDSCRT1DataStruct *SiS_LVDSCRT1320x480_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_1;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_1_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_2;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT1800x600_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11024x768_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11280x1024_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11400x1050_2_H;
const SiS_LCDACRT1DataStruct *SiS_LCDACRT11600x1200_2_H;
/* TW: New for 650/301LV */
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_1;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_2;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1024x768_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1280x1024_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1400x1050_3;
const SiS_Part2PortTblStruct *SiS_CRT2Part2_1600x1200_3;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UNTSC;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_ONTSC;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPAL;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_OPAL;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPALM;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_OPALM;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_UPALN;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_OPALN;
const SiS_CHTVRegDataStruct *SiS_CHTVReg_SOPAL;
const UCHAR *SiS_CHTVVCLKUNTSC;
const UCHAR *SiS_CHTVVCLKONTSC;
const UCHAR *SiS_CHTVVCLKUPAL;
const UCHAR *SiS_CHTVVCLKOPAL;
const UCHAR *SiS_CHTVVCLKUPALM;
const UCHAR *SiS_CHTVVCLKOPALM;
const UCHAR *SiS_CHTVVCLKUPALN;
const UCHAR *SiS_CHTVVCLKOPALN;
const UCHAR *SiS_CHTVVCLKSOPAL;
BOOLEAN UseCustomMode;
BOOLEAN CRT1UsesCustomMode;
USHORT CHDisplay;
USHORT CHSyncStart;
USHORT CHSyncEnd;
USHORT CHTotal;
USHORT CHBlankStart;
USHORT CHBlankEnd;
USHORT CVDisplay;
USHORT CVSyncStart;
USHORT CVSyncEnd;
USHORT CVTotal;
USHORT CVBlankStart;
USHORT CVBlankEnd;
ULONG CDClock;
ULONG CFlags;
UCHAR CCRT1CRTC[17];
UCHAR CSR2B;
UCHAR CSR2C;
USHORT CSRClock;
USHORT CModeFlag;
USHORT CInfoFlag;
BOOLEAN SiS_CHPALM;
BOOLEAN SiS_CHPALN;
BOOLEAN Backup;
UCHAR Backup_Mode;
UCHAR Backup_14;
UCHAR Backup_15;
UCHAR Backup_16;
UCHAR Backup_17;
UCHAR Backup_18;
UCHAR Backup_19;
UCHAR Backup_1a;
UCHAR Backup_1b;
UCHAR Backup_1c;
UCHAR Backup_1d;
int UsePanelScaler;
} SiS_Private;
#endif
......@@ -98,6 +98,8 @@
#define FB_ACCEL_3DLABS_PERMEDIA3 37 /* 3Dlabs Permedia 3 */
#define FB_ACCEL_ATI_RADEON 38 /* ATI Radeon family */
#define FB_ACCEL_I810 39 /* Intel 810/815 */
#define FB_ACCEL_SIS_GLAMOUR_2 40 /* SiS 315, 650, 740 */
#define FB_ACCEL_SIS_XABRE 41 /* SiS 330 ("Xabre") */
#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
......@@ -345,7 +347,6 @@ struct fb_pixmap {
#ifdef __KERNEL__
#include <linux/fs.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/devfs_fs_kernel.h>
......@@ -386,8 +387,6 @@ struct fb_ops {
int (*fb_cursor)(struct fb_info *info, struct fb_cursor *cursor);
/* Rotates the display */
void (*fb_rotate)(struct fb_info *info, int angle);
/* perform polling on fb device */
int (*fb_poll)(struct fb_info *info, poll_table *wait);
/* wait for blit idle, optional */
int (*fb_sync)(struct fb_info *info);
/* perform fb specific ioctl (optional) */
......
......@@ -34,11 +34,10 @@ typedef enum _SIS_CHIP_TYPE {
SIS_730,
SIS_315H,
SIS_315,
SIS_550,
SIS_315PRO,
SIS_640,
SIS_740,
SIS_550,
SIS_650,
SIS_740,
SIS_330,
MAX_SIS_CHIP
} SIS_CHIP_TYPE;
......@@ -129,7 +128,16 @@ struct video_info {
spinlock_t lockaccel;
char reserved[256];
unsigned int pcibus;
unsigned int pcislot;
unsigned int pcifunc;
int accel;
unsigned short subsysvendor;
unsigned short subsysdevice;
char reserved[236];
};
......@@ -137,7 +145,9 @@ struct video_info {
/* If changing this, vgatypes.h must also be changed (for X driver) */
/* TW: ioctl for identifying and giving some info (esp. memory heap start) */
#define SISFB_GET_INFO _IOR('n',0xF8,sizeof(__u32))
#define SISFB_GET_INFO _IOR('n',0xF8,sizeof(__u32))
#define SISFB_GET_VBRSTATUS _IOR('n',0xF9,sizeof(__u32))
/* TW: Structure argument for SISFB_GET_INFO ioctl */
typedef struct _SISFB_INFO sisfb_info, *psisfb_info;
......@@ -156,7 +166,19 @@ struct _SISFB_INFO {
unsigned char sisfb_revision;
unsigned char sisfb_patchlevel;
char reserved[253]; /* for future use */
unsigned char sisfb_caps; /* Sisfb capabilities */
int sisfb_tqlen; /* turbo queue length (in KB) */
unsigned int sisfb_pcibus; /* The card's PCI ID */
unsigned int sisfb_pcislot;
unsigned int sisfb_pcifunc;
unsigned char sisfb_lcdpdc; /* PanelDelayCompensation */
unsigned char sisfb_lcda; /* Detected status of LCDA for low res/text modes */
char reserved[235]; /* for future use */
};
#ifdef __KERNEL__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment