diff options
author | Thomas Winischhofer <thomas@winischhofer.net> | 2004-08-10 21:57:20 +0000 |
---|---|---|
committer | Thomas Winischhofer <thomas@winischhofer.net> | 2004-08-10 21:57:20 +0000 |
commit | 1a5d711d1ef175bcda964ee37829b6ca63a3c8d7 (patch) | |
tree | 85d4381a8794f8c0cb63f6bc28ac33b3e8032657 | |
parent | 079bf141c47ddcf7226807ef1b60670c2e9b843e (diff) |
SiS driver:
- update timing for 1280x800, 1280x720 and 1280x768 panels
- allow more modes for LCD (just don't scale them if we can't)
- cleanup
-rw-r--r-- | src/300vtbl.h | 86 | ||||
-rw-r--r-- | src/310vtbl.h | 12 | ||||
-rw-r--r-- | src/init.c | 163 | ||||
-rw-r--r-- | src/init.h | 235 | ||||
-rw-r--r-- | src/init301.c | 451 | ||||
-rw-r--r-- | src/init301.h | 24 | ||||
-rw-r--r-- | src/initdef.h | 5 | ||||
-rw-r--r-- | src/sis310_accel.c | 2 |
8 files changed, 478 insertions, 500 deletions
diff --git a/src/300vtbl.h b/src/300vtbl.h index d8c81bb..ace772f 100644 --- a/src/300vtbl.h +++ b/src/300vtbl.h @@ -80,12 +80,12 @@ static const SiS_ExtStruct SiS300_EModeIDTable[] = {0x2e,0x0a1b,0x0101,SIS_RI_640x480, 0x00,0x00,0x00,0x00,0x08,-1}, {0x2f,0x021b,0x0100,SIS_RI_640x400, 0x00,0x00,0x00,0x00,0x10,-1}, /* 640x400x8 */ {0x30,0x2a1b,0x0103,SIS_RI_800x600, 0x00,0x00,0x00,0x00,0x00,-1}, - {0x31,0x0a1b,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x8 */ - {0x32,0x2a1b,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x8 */ - {0x33,0x0a1d,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x16 */ - {0x34,0x2a1d,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x16 */ - {0x35,0x0a1f,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x32 */ - {0x36,0x2a1f,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x32 */ + {0x31,0x4a1b,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x8 */ + {0x32,0x6a1b,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x8 */ + {0x33,0x4a1d,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x16 */ + {0x34,0x6a1d,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x16 */ + {0x35,0x4a1f,0x0000,SIS_RI_720x480, 0x00,0x00,0x00,0x00,0x11,-1}, /* 720x480x32 */ + {0x36,0x6a1f,0x0000,SIS_RI_720x576, 0x00,0x00,0x00,0x00,0x12,-1}, /* 720x576x32 */ {0x37,0x0212,0x0104,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, /* 1024x768x? */ {0x38,0x0a1b,0x0105,SIS_RI_1024x768, 0x00,0x00,0x00,0x00,0x13,-1}, /* 1024x768x8 */ {0x3a,0x0e3b,0x0107,SIS_RI_1280x1024,0x00,0x00,0x00,0x00,0x1a,-1}, /* 1280x1024x8 */ @@ -121,48 +121,48 @@ static const SiS_ExtStruct SiS300_EModeIDTable[] = {0x6b,0x07ff,0x0000,SIS_RI_1920x1440,0x00,0x00,0x00,0x00,0x27,-1}, {0x6c,0x067b,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1}, /* 2048x1536x8 - not in BIOS! */ {0x6d,0x06fd,0x0000,SIS_RI_2048x1536,0x00,0x00,0x00,0x00,0x28,-1}, /* 2048x1536x16 - not in BIOS! */ - {0x70,0x2a1b,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x8 */ - {0x71,0x0a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x8 */ - {0x74,0x0a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x16 */ + {0x70,0x6a1b,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x8 */ + {0x71,0x4a1b,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x8 */ + {0x74,0x4a1d,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x16 */ {0x75,0x0e3d,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x16 */ - {0x76,0x2a1f,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x32 */ - {0x77,0x0a3f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x32 */ + {0x76,0x6a1f,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x32 */ + {0x77,0x4a3f,0x0000,SIS_RI_1024x576, 0x00,0x00,0x00,0x00,0x30,-1}, /* 1024x576x32 */ {0x78,0x0eff,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x32 */ {0x79,0x0e3b,0x0000,SIS_RI_1280x720, 0x00,0x00,0x00,0x00,0x33,-1}, /* 1280x720x8 */ - {0x7a,0x2a1d,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x16 */ + {0x7a,0x6a1d,0x0000,SIS_RI_800x480, 0x00,0x00,0x07,0x00,0x2d,-1}, /* 800x480x16 */ {0x7c,0x0a3b,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x8 */ {0x7d,0x0a7d,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x16 */ {0x7e,0x0aff,0x0000,SIS_RI_1280x960, 0x00,0x00,0x00,0x00,0x29,-1}, /* 1280x960x32 */ - {0x20,0x0a1b,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, /* 1024x600 */ - {0x21,0x0a3d,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, - {0x22,0x0a7f,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, - {0x23,0x0a1b,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, /* 1152x768 */ - {0x24,0x0a3d,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, - {0x25,0x0a7f,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, - {0x29,0x0e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, /* 1152x864 */ - {0x2a,0x0e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, - {0x2b,0x0e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, - {0x39,0x2a1b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, /* 848x480 */ - {0x3b,0x2a3d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, - {0x3e,0x2a7f,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, - {0x3f,0x2a1b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, /* 856x480 */ - {0x42,0x2a3d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, - {0x45,0x2a7f,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, - {0x48,0x223b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, /* 1360x768 */ - {0x4b,0x227d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, - {0x4e,0x22ff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, + {0x20,0x4a1b,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, /* 1024x600 */ + {0x21,0x4a3d,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, + {0x22,0x4a7f,0x0000,SIS_RI_1024x600, 0x00,0x00,0x00,0x00,0x2b,-1}, + {0x23,0x4a1b,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, /* 1152x768 */ + {0x24,0x4a3d,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, + {0x25,0x4a7f,0x0000,SIS_RI_1152x768, 0x00,0x00,0x00,0x00,0x2c,-1}, + {0x29,0x4e1b,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, /* 1152x864 */ + {0x2a,0x4e3d,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, + {0x2b,0x4e7f,0x0000,SIS_RI_1152x864, 0x00,0x00,0x00,0x00,0x36,-1}, + {0x39,0x6a1b,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, /* 848x480 */ + {0x3b,0x6a3d,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, + {0x3e,0x6a7f,0x0000,SIS_RI_848x480, 0x00,0x00,0x00,0x00,0x38,-1}, + {0x3f,0x6a1b,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, /* 856x480 */ + {0x42,0x6a3d,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, + {0x45,0x6a7f,0x0000,SIS_RI_856x480, 0x00,0x00,0x00,0x00,0x3a,-1}, + {0x48,0x6a3b,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, /* 1360x768 */ + {0x4b,0x6a7d,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, + {0x4e,0x6aff,0x0000,SIS_RI_1360x768, 0x00,0x00,0x00,0x00,0x3c,-1}, {0x4f,0x921f,0x0000,SIS_RI_320x200, 0x00,0x00,0x00,0x00,0x23,-1}, /* 320x200x32 */ {0x53,0x921f,0x0000,SIS_RI_320x240, 0x00,0x00,0x00,0x00,0x24,-1}, /* 320x240x32 */ {0x54,0xb21f,0x0000,SIS_RI_400x300, 0x00,0x00,0x00,0x00,0x25,-1}, /* 400x300x32 */ {0x55,0x2e3b,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1}, /* 1280x768 */ {0x5a,0x2e7d,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1}, {0x5b,0x2eff,0x0000,SIS_RI_1280x768, 0x00,0x00,0x00,0x00,0x3d,-1}, - {0x5f,0x2a1b,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x8 */ - {0x60,0x2a1d,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x16 */ - {0x61,0x2a1f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x32 */ - {0x67,0x2e3b,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x8 (BARCO) */ - {0x6f,0x2e7d,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x16 (BARCO) */ - {0x72,0x2eff,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x32 (BARCO) */ + {0x5f,0x6a1b,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x8 */ + {0x60,0x6a1d,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x16 */ + {0x61,0x6a1f,0x0000,SIS_RI_768x576, 0x00,0x00,0x00,0x00,0x3e,-1}, /* 768x576x32 */ + {0x67,0x6e3b,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x8 (BARCO) */ + {0x6f,0x6e7d,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x16 (BARCO) */ + {0x72,0x6eff,0x0000,SIS_RI_1360x1024,0x00,0x00,0x00,0x00,0x3f,-1}, /* 1360x1024x32 (BARCO) */ {0xff,0x0000,0xffff,0, 0x00,0x00,0x00,0x00,0x00} }; @@ -185,8 +185,8 @@ static const SiS_Ext2Struct SiS300_RefIndex[] = {0xc047,0x0b,0x0a,0x00,0x00,0x2e, 640, 480, 0}, /* 0e */ {0xc047,0x0c,0x10,0x00,0x00,0x2e, 640, 480, 0}, /* 0f */ {0x487f,0x04,0x00,0x00,0x00,0x2f, 640, 400, 0}, /* 10 */ - {0xc04f,0x31,0x01,0x06,0x00,0x31, 720, 480, 0}, /* 11 */ - {0x004f,0x32,0x03,0x06,0x00,0x32, 720, 576, 0}, /* 12 */ + {0xc06f,0x31,0x01,0x06,0x00,0x31, 720, 480, 0}, /* 11 */ + {0x006f,0x32,0x03,0x06,0x00,0x32, 720, 576, 0}, /* 12 */ {0x0187,0x15,0x05,0x00,0x00,0x37,1024, 768, 0}, /* 13 */ {0xc877,0x16,0x09,0x06,0x06,0x37,1024, 768, 0}, /* 14 */ {0xc067,0x17,0x0b,0x49,0x06,0x37,1024, 768, 0}, /* 15 - CRT1CRTC was 0x97 */ @@ -213,16 +213,16 @@ static const SiS_Ext2Struct SiS300_RefIndex[] = {0x0027,0x45,0x3c,0x08,0x0a,0x6e,1280, 960, 0}, /* 2a - 1280x960-85 */ {0xc077,0x33,0x09,0x06,0x00,0x20,1024, 600, 0}, /* 2b */ {0xc077,0x34,0x0b,0x06,0x00,0x23,1152, 768, 0}, /* 2c */ /* VCLK 0x09 */ - {0x0057,0x35,0x27,0x08,0x00,0x70, 800, 480, 0}, /* 2d */ + {0x0077,0x35,0x27,0x08,0x00,0x70, 800, 480, 0}, /* 2d */ {0x0047,0x36,0x37,0x08,0x00,0x70, 800, 480, 0}, /* 2e */ {0x0047,0x37,0x08,0x08,0x00,0x70, 800, 480, 0}, /* 2f */ - {0x0057,0x38,0x09,0x09,0x00,0x71,1024, 576, 0}, /* 30 */ + {0x0077,0x38,0x09,0x09,0x00,0x71,1024, 576, 0}, /* 30 */ {0x0047,0x39,0x38,0x09,0x00,0x71,1024, 576, 0}, /* 31 */ {0x0047,0x3a,0x11,0x09,0x00,0x71,1024, 576, 0}, /* 32 */ - {0x0057,0x3b,0x39,0x0a,0x00,0x75,1280, 720, 0}, /* 33 */ + {0x0077,0x3b,0x39,0x0a,0x00,0x75,1280, 720, 0}, /* 33 */ {0x0047,0x3c,0x3a,0x0a,0x00,0x75,1280, 720, 0}, /* 34 */ {0x0007,0x3d,0x3b,0x0a,0x00,0x75,1280, 720, 0}, /* 35 */ - {0x0047,0x3e,0x34,0x06,0x00,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */ + {0x0067,0x3e,0x34,0x06,0x00,0x29,1152, 864, 0}, /* 36 1152x864-75Hz */ {0x0047,0x44,0x3a,0x06,0x00,0x29,1152, 864, 0}, /* 37 1152x864-85Hz */ {0x00c7,0x3f,0x28,0x00,0x00,0x39, 848, 480, 0}, /* 38 848x480-38Hzi */ {0xc067,0x40,0x3d,0x0b,0x0b,0x39, 848, 480, 0}, /* 39 848x480-60Hz */ @@ -230,7 +230,7 @@ static const SiS_Ext2Struct SiS300_RefIndex[] = {0xc047,0x42,0x28,0x00,0x00,0x3f, 856, 480, 0}, /* 3b 856x480-60Hz */ {0x0067,0x43,0x3e,0x0c,0x0b,0x48,1360, 768, 0}, /* 3c 1360x768-60Hz */ {0x0077,0x46,0x3f,0x08,0x00,0x55,1280, 768, 0}, /* 3d 1280x768-60Hz */ - {0x004f,0x47,0x03,0x06,0x00,0x5f, 768, 576, 0}, /* 3e 768x576 */ + {0x006f,0x47,0x03,0x06,0x00,0x5f, 768, 576, 0}, /* 3e 768x576 */ {0x0027,0x48,0x13,0x08,0x08,0x67,1360,1024, 0}, /* 3f 1360x1024-59Hz (BARCO1366 only) */ {0xffff, 0, 0, 0, 0, 0, 0, 0, 0} }; diff --git a/src/310vtbl.h b/src/310vtbl.h index ca306e1..b6b47fb 100644 --- a/src/310vtbl.h +++ b/src/310vtbl.h @@ -845,15 +845,15 @@ static SiS_VBVCLKDataStruct SiS310_VBVCLKData[]= { 0x30,0x23, 88}, /* 0x58 1360x768-62 (is 60Hz!) TEMP, UNUSED */ { 0x52,0x07,149}, /* 0x59 1280x960-85 */ { 0x56,0x07,156}, /* 0x5a 1400x1050-75 */ - { 0x70,0x29, 81}, /* 0x5b 1280x768 LCD */ - { 0x45,0x25, 83}, /* 0x5c 1280x800 LCD - (was 0x9c,0x62, 69 - wrong?) */ + { 0x70,0x29, 81}, /* 0x5b 1280x768 LCD (TMDS) */ + { 0xCE,0x1E, 73}, /* 0x5c 1280x800 LCD - (CRT1: 45 25 83) */ { 0xbe,0x44,121}, /* 0x5d 1680x1050 LCD */ { 0x70,0x24,162}, /* 0x5e 1600x1200 LCD */ - { 0x52,0x27, 75}, /* 0x5f 1280x720 LCD TMDS + HDTV (correct) */ - { 0x63,0x46, 68}, /* 0x60 1280x768_2 */ - { 0x31,0x42, 79}, /* 0x61 1280x768_3 - temp */ + { 0x52,0x27, 75}, /* 0x5f 1280x720 (TMDS + HDTV) (correct) */ + { 0xC8,0x48, 77}, /* 0x60 1280x768_2 (LVDS) */ + { 0x31,0x42, 79}, /* 0x61 1280x768_3 (LVDS) - temp */ { 0, 0, 0}, /* 0x62 - custom (will be filled out at run-time) */ - { 0x5a,0x64, 65}, /* 0x63 1280x720 (LCD LVDS) */ + { 0x5a,0x64, 65}, /* 0x63 1280x720 (LVDS) */ { 0x70,0x28, 90}, /* 0x64 1152x864@60 */ { 0x41,0xc4, 32}, /* 0x65 848x480@60 */ { 0x5c,0xc6, 32}, /* 0x66 856x480@60 */ @@ -638,10 +638,14 @@ SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, } break; case 400: - if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; + if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 800) && (LCDwidth >= 600))) { + if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; + } break; case 512: - if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; + if((!(VBFlags & CRT1_LCDA)) || ((LCDwidth >= 1024) && (LCDwidth >= 768))) { + if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; + } break; case 640: if(VDisplay == 480) ModeIndex = ModeIndex_640x480[Depth]; @@ -670,63 +674,53 @@ SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, } break; case 1024: - if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth]; - else if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth]; - else if((!(VBFlags & CRT1_LCDA)) && (VGAEngine == SIS_300_VGA)) { - if(VDisplay == 600) ModeIndex = ModeIndex_1024x600[Depth]; + if(VDisplay == 576) ModeIndex = ModeIndex_1024x576[Depth]; + else if(VDisplay == 768) ModeIndex = ModeIndex_1024x768[Depth]; + else if(VGAEngine == SIS_300_VGA) { + if(VDisplay == 600) ModeIndex = ModeIndex_1024x600[Depth]; } break; case 1152: if(VDisplay == 864) ModeIndex = ModeIndex_1152x864[Depth]; - if((!(VBFlags & CRT1_LCDA)) && (VGAEngine == SIS_300_VGA)) { + if(VGAEngine == SIS_300_VGA) { if(VDisplay == 768) ModeIndex = ModeIndex_1152x768[Depth]; } break; case 1280: - if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth]; - else if(VDisplay == 800) { - if(VGAEngine == SIS_315_VGA) { - if((VBFlags & CRT1_LCDA) && (LCDwidth == 1280) && (LCDheight == 800)) { - ModeIndex = ModeIndex_1280x800[Depth]; - } else if(!(VBFlags & CRT1_LCDA)) { - ModeIndex = ModeIndex_1280x800[Depth]; - } - } - } else if(VDisplay == 720) { - if((VBFlags & CRT1_LCDA) && (LCDwidth == 1280) && (LCDheight == 720)) { - ModeIndex = ModeIndex_1280x720[Depth]; - } else if(!(VBFlags & CRT1_LCDA)) { - ModeIndex = ModeIndex_1280x720[Depth]; + switch(VDisplay) { + case 720: + ModeIndex = ModeIndex_1280x720[Depth]; + break; + case 768: + if(VGAEngine == SIS_300_VGA) { + ModeIndex = ModeIndex_300_1280x768[Depth]; + } else { + ModeIndex = ModeIndex_310_1280x768[Depth]; } - } else if(!(VBFlags & CRT1_LCDA)) { - if(VDisplay == 960) ModeIndex = ModeIndex_1280x960[Depth]; - else if(VDisplay == 768) { - if(VGAEngine == SIS_300_VGA) { - ModeIndex = ModeIndex_300_1280x768[Depth]; - } else { - ModeIndex = ModeIndex_310_1280x768[Depth]; - } + break; + case 800: + if(VGAEngine == SIS_315_VGA) { + ModeIndex = ModeIndex_1280x800[Depth]; } + break; + case 960: + ModeIndex = ModeIndex_1280x960[Depth]; + break; + case 1024: + ModeIndex = ModeIndex_1280x1024[Depth]; + break; } break; case 1360: - if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth]; - if(!(VBFlags & CRT1_LCDA)) { - if(VGAEngine == SIS_300_VGA) { - if(VDisplay == 1024) ModeIndex = ModeIndex_300_1360x1024[Depth]; - } - } + if(VDisplay == 768) ModeIndex = ModeIndex_1360x768[Depth]; + if(VGAEngine == SIS_300_VGA) { + if(VDisplay == 1024) ModeIndex = ModeIndex_300_1360x1024[Depth]; + } break; case 1400: if(VGAEngine == SIS_315_VGA) { if(VDisplay == 1050) { - if((VBFlags & CRT1_LCDA) && - (((LCDwidth == 1400) && (LCDheight == 1050)) || - ((LCDwidth == 1600) && (LCDheight == 1200)))) { - ModeIndex = ModeIndex_1400x1050[Depth]; - } else if(!(VBFlags & CRT1_LCDA)) { - ModeIndex = ModeIndex_1400x1050[Depth]; - } + ModeIndex = ModeIndex_1400x1050[Depth]; } } break; @@ -739,22 +733,18 @@ SiS_GetModeID(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, } break; case 1920: - if(!(VBFlags & CRT1_LCDA)) { - if(VGAEngine == SIS_315_VGA) { - if(VDisplay == 1080) ModeIndex = ModeIndex_1920x1080[Depth]; - } - if(VDisplay == 1440) ModeIndex = ModeIndex_1920x1440[Depth]; + if(VDisplay == 1440) ModeIndex = ModeIndex_1920x1440[Depth]; + else if(VGAEngine == SIS_315_VGA) { + if(VDisplay == 1080) ModeIndex = ModeIndex_1920x1080[Depth]; } break; case 2048: - if(!(VBFlags & CRT1_LCDA)) { - if(VDisplay == 1536) { - if(VGAEngine == SIS_300_VGA) { - ModeIndex = ModeIndex_300_2048x1536[Depth]; - } else { - ModeIndex = ModeIndex_310_2048x1536[Depth]; - } - } + if(VDisplay == 1536) { + if(VGAEngine == SIS_300_VGA) { + ModeIndex = ModeIndex_300_2048x1536[Depth]; + } else { + ModeIndex = ModeIndex_310_2048x1536[Depth]; + } } break; } @@ -793,7 +783,7 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, case 512: if(CustomT != CUT_PANEL848) { if(!((VGAEngine == SIS_300_VGA) && (VBFlags & VB_TRUMPION))) { - if(LCDwidth != 1024 || LCDheight != 600) { + if(LCDwidth >= 1024 && LCDwidth != 1152 && LCDheight >= 768) { if(VDisplay == 384) { ModeIndex = ModeIndex_512x384[Depth]; } @@ -836,9 +826,6 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, if((VDisplay == 768) && (LCDheight == 768)) { ModeIndex = ModeIndex_310_1280x768[Depth]; } - if((VDisplay == 800) && (LCDheight == 800)) { - ModeIndex = ModeIndex_310_1280x768[Depth]; - } } break; case 1360: @@ -872,10 +859,14 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, else if(VDisplay == 240) ModeIndex = ModeIndex_320x240[Depth]; break; case 400: - if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; + if(LCDwidth >= 800 && LCDheight >= 600) { + if(VDisplay == 300) ModeIndex = ModeIndex_400x300[Depth]; + } break; case 512: - if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; + if(LCDwidth >= 1024 && LCDheight >= 768 && LCDwidth != 1152) { + if(VDisplay == 384) ModeIndex = ModeIndex_512x384[Depth]; + } break; case 640: if(VDisplay == 480) ModeIndex = ModeIndex_640x480[Depth]; @@ -925,32 +916,27 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, } break; case 1280: - if(VDisplay == 1024) ModeIndex = ModeIndex_1280x1024[Depth]; - else if(VDisplay == 768) { - if((LCDheight == 768) || (LCDwidth == 1680) || - (VBFlags & VB_SISTMDS)) { - if(VGAEngine == SIS_300_VGA) { - ModeIndex = ModeIndex_300_1280x768[Depth]; - } else { - ModeIndex = ModeIndex_310_1280x768[Depth]; - } - } - } else if(VDisplay == 960) { - if((LCDheight == 960) || (VBFlags & VB_SISTMDS)) { - ModeIndex = ModeIndex_1280x960[Depth]; + switch(VDisplay) { + case 720: + ModeIndex = ModeIndex_1280x720[Depth]; + case 768: + if(VGAEngine == SIS_300_VGA) { + ModeIndex = ModeIndex_300_1280x768[Depth]; + } else { + ModeIndex = ModeIndex_310_1280x768[Depth]; } - } else if(VGAEngine == SIS_315_VGA) { - if(VDisplay == 800) { - if((LCDheight == 800) || (LCDwidth == 1680) || - (VBFlags & VB_SISTMDS)) { - ModeIndex = ModeIndex_1280x800[Depth]; - } - } else if(VDisplay == 720) { - if((LCDheight == 720) || (LCDwidth == 1680) || (LCDwidth == 1400) || - (VBFlags & VB_SISTMDS)) { - ModeIndex = ModeIndex_1280x720[Depth]; - } + break; + case 800: + if(VGAEngine == SIS_315_VGA) { + ModeIndex = ModeIndex_1280x800[Depth]; } + break; + case 960: + ModeIndex = ModeIndex_1280x960[Depth]; + break; + case 1024: + ModeIndex = ModeIndex_1280x1024[Depth]; + break; } break; case 1360: @@ -961,9 +947,7 @@ SiS_GetModeID_LCD(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, case 1400: if(VGAEngine == SIS_315_VGA) { if(VBFlags & (VB_301C | VB_302LV | VB_302ELV)) { - if((LCDwidth == 1400) || (LCDwidth == 1600) || (LCDwidth == 1680)) { - ModeIndex = ModeIndex_1400x1050[Depth]; - } + if(VDisplay == 1050) ModeIndex = ModeIndex_1400x1050[Depth]; } } break; @@ -1042,8 +1026,7 @@ SiS_GetModeID_TV(int VGAEngine, ULONG VBFlags, int HDisplay, int VDisplay, int D case 720: if((!(VBFlags & TV_HIVISION)) && (!((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR1080I)))) { if(VDisplay == 480) { - /* if((VBFlags & TV_YPBPR) || (VBFlags & (TV_NTSC | TV_PALM))) */ - ModeIndex = ModeIndex_720x480[Depth]; + ModeIndex = ModeIndex_720x480[Depth]; } else if(VDisplay == 576) { if( ((VBFlags & TV_YPBPR) && (VBFlags & TV_YPBPR750P)) || ((!(VBFlags & (TV_YPBPR | TV_PALM))) && (VBFlags & TV_PAL)) ) @@ -930,58 +930,31 @@ static const SiS_TVDataStruct SiS_St750pData[] = static const SiS_TVDataStruct SiS_Ext750pData[] = { -#if 1 { 143, 65, 0x35a,0x1bb,0x4f6,0x1b8,0x0ab, 0, 0x0ab, 0x00,0x00,0x00,0x00}, { 88, 35, 0x35a,0x189,0x4f6,0x1b8,0x0ab, 0, 0x0ab, 0x00,0x00,0x00,0x00}, { 18, 5, 0x339,0x1ae,0x500,0x2d0,0x05c, 0, 0x05c, 0x00,0x00,0x00,0x00}, { 143, 70, 0x39c,0x189,0x4f6,0x1b8,0x05c, 0, 0x05c, 0x00,0x00,0x00,0x00}, { 99, 32, 0x320,0x1fe,0x500,0x2d0, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */ { 5, 4, 0x5d8,0x29e,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */ -#if 0 - { 2, 1, 0x35a,0x1f7,0x4f6,0x1e0, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */ -#endif { 99, 32, 0x320,0x1fe,0x500,0x2d0, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 720x480 test WORKS */ { 68, 64, 0x55f,0x346,0x500,0x2a8,0x27e, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */ { 5, 2, 0x3a7,0x226,0x500,0x2a8, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x576 */ { 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 WORKS */ -#endif -#if 0 - { 3, 1, 0x3a7,0x1d6,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, - { 24, 7, 0x3a7,0x1a4,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, - { 3, 1, 0x3a7,0x1d6,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, - { 24, 7, 0x3a7,0x1a4,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, - { 99, 32, 0x320,0x1fe,0x500,0x2d0, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */ - { 5, 4, 0x5d8,0x29e,0x500,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */ - { 2, 1, 0x35a,0x1f7,0x4f6,0x1e0, 0,128, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */ - { 68, 64, 0x55f,0x346,0x500,0x2a8,0x27e, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */ - { 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00} /* 1280x720 */ -#endif -#if 0 - { 136, 35, 0x339,0x181,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* TEST (0.93) BAD */ - { 17, 6, 0x339,0x203,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00}, - { 136, 35, 0x339,0x181,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00}, - { 17, 6, 0x339,0x203,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00}, - { 85, 46, 0x3f4,0x27b,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 640x480 */ - { 17, 16, 0x55f,0x323,0x460,0x2a8,0x2b6, 0, 0, 0x00,0x00,0x00,0x00}, /* 800x600 */ - { 136, 35, 0x339,0x181,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 720x480 */ - { 187, 74, 0x39d,0x203,0x460,0x2a8, 50, 0, 0, 0x00,0x00,0x00,0x00}, /* 1024x768 */ - { 25, 24, 0x5d8,0x2f3,0x460,0x2a8, 50, 0, 50, 0x00,0x00,0x00,0x00} /* 1280x720 */ -#endif }; -static const SiS_LCDDataStruct SiS_LCD1280x720Data[] = +static const SiS_LCDDataStruct SiS_LCD1280x720Data[] = /* 2.03.00 */ { - { 14, 5, 864, 432, 1344, 806 }, /* 640x400 */ - { 16, 5, 864, 378, 1344, 806 }, - { 14, 5, 864, 432, 1344, 806 }, - { 16, 5, 864, 378, 1344, 806 }, - { 24, 11, 924, 523, 1344, 806 }, /* 640x480 */ - { 7, 5, 1152, 664, 1344, 806 }, /* 800x600 */ - { 0, 0, 0, 0, 0, 0 }, + { 44, 15, 864, 430, 1408, 806 }, /* 640x400 */ + { 128, 35, 792, 385, 1408, 806 }, + { 44, 15, 864, 430, 1408, 806 }, + { 128, 35, 792, 385, 1408, 806 }, + { 22, 9, 864, 516, 1408, 806 }, /* 640x480 */ + { 8, 5, 1056, 655, 1408, 806 }, /* 800x600 */ + { 0, 0, 0, 0, 0, 0 }, /* 1024x768 */ + { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */ { 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0 }, - { 0, 0, 0, 0, 0, 0 }, - { 1, 1, 1344, 806, 1344, 806 } /* 1280x720 */ + { 1, 1, 1408, 806, 1408, 806 } /* 1280x720 */ }; /* About 1280x768: For TMDS, Panel_1280x768 will only be set if @@ -990,7 +963,7 @@ static const SiS_LCDDataStruct SiS_LCD1280x720Data[] = * For LVDS, we know two types. Data follows: */ -static const SiS_LCDDataStruct SiS_StLCD1280x768_2Data[] = +static const SiS_LCDDataStruct SiS_StLCD1280x768_2Data[] = /* 2.03.00 */ { { 64, 21, 858, 434, 1408, 806 }, /* 640x400 */ { 32, 9, 858, 372, 1408, 806 }, @@ -1000,20 +973,24 @@ static const SiS_LCDDataStruct SiS_StLCD1280x768_2Data[] = { 64, 51, 1364, 663, 1408, 806 }, /* 800x600 */ { 88, 81, 1296, 806, 1408, 806 }, /* 1024x768 */ { 0, 0, 0, 0, 0, 0 }, - { 1, 1, 1408, 806, 1408, 806 } /* 1280x768 */ + { 1, 1, 1408, 806, 1408, 806 }, /* 1280x768 */ + { 0, 0, 0, 0, 0, 0 }, + { 16, 15, 1600, 750, 1600, 806 } /* 1280x720 - from Ext */ }; -static const SiS_LCDDataStruct SiS_ExtLCD1280x768_2Data[] = +static const SiS_LCDDataStruct SiS_ExtLCD1280x768_2Data[] = /* 2.03.00 */ { - { 64, 25, 1056, 422, 1408, 806 }, /*, 664 */ - { 128, 39, 884, 396, 1408, 806 }, /*, 640 */ - { 64, 25, 1056, 422, 1408, 806 }, /*, 664 */ - { 128, 39, 884, 396, 1408, 806 }, /*, 640 */ - { 32, 15, 1056, 513, 1408, 806 }, /*, 664 */ - { 176, 125, 1280, 640, 1408, 806 }, /*, 768 */ - { 88, 81, 1296, 806, 1408, 806 }, + { 16, 5, 960, 410, 1600, 806 }, /* 640x400 */ + { 64, 21, 1152, 364, 1600, 806 }, + { 16, 5, 960, 410, 1600, 806 }, + { 64, 21, 1152, 364, 1600, 806 }, + { 32, 13, 1040, 493, 1600, 806 }, /* 640x480 */ + { 16, 9, 1152, 618, 1600, 806 }, /* 800x600 */ + { 25, 21, 1344, 796, 1600, 806 }, /* 1024x768 */ { 0, 0, 0, 0, 0, 0 }, - { 1, 1, 1408, 806, 1408, 806 } + { 1, 1, 1600, 806, 1600, 806 }, /* 1280x768 */ + { 0, 0, 0, 0, 0, 0 }, + { 16, 15, 1600, 750, 1600, 806 } /* 1280x720 */ }; static const SiS_LCDDataStruct SiS_LCD1280x768_3Data[] = @@ -1026,20 +1003,24 @@ static const SiS_LCDDataStruct SiS_LCD1280x768_3Data[] = { 176, 125, 1280, 640, 1408, 806 }, /* ,768 */ /* 800x600 */ { 64, 61, 1342, 806, 1408, 806 }, /* 1024x768 */ { 0, 0, 0, 0, 0, 0 }, - { 1, 1, 1408, 806, 1408, 806 } /* 1280x768 */ + { 1, 1, 1408, 806, 1408, 806 }, /* 1280x768 */ + { 0, 0, 0, 0, 0, 0 }, + { 16, 15, 1600, 750, 1600, 806 } /* 1280x720 from above */ }; -static const SiS_LCDDataStruct SiS_LCD1280x800Data[] = +static const SiS_LCDDataStruct SiS_LCD1280x800Data[] = /* 2.03.00 */ { - { 128, 51, 1122, 412, 1408, 816 }, /* 640x400 */ - { 128, 49, 1232, 361, 1408, 816 }, - { 128, 51, 1122, 412, 1408, 816 }, - { 128, 49, 1232, 361, 1408, 816 }, - { 8, 3, 880, 491, 1408, 816 }, /* 640x480 */ - { 11, 6, 1024, 612, 1408, 816 }, /* 800x600 */ - { 22, 21, 1400, 784, 1408, 816 }, /* 1024x768 */ - { 0, 0, 0, 0, 0, 0 }, - { 1, 1, 1408, 816, 1408, 816 } /* 1280x800 */ + { 97, 42, 1344, 409, 1552, 812 }, /* 640x400 */ + { 97, 35, 1280, 358, 1552, 812 }, + { 97, 42, 1344, 409, 1552, 812 }, + { 97, 35, 1280, 358, 1552, 812 }, + { 97, 39, 1040, 488, 1552, 812 }, /* 640x480 */ + { 194, 105, 1120, 608, 1552, 812 }, /* 800x600 */ + { 97, 84, 1400, 780, 1552, 812 }, /* 1024x768 */ + { 0, 0, 0, 0, 0, 0 }, /* 1280x1024 */ + { 1, 1, 1552, 812, 1552, 812 }, /* 1280x800 */ + { 97, 96, 1600, 780, 1552, 812 }, /* 1280x768 - patch index */ + { 97, 90, 1600, 730, 1552, 812 } /* 1280x720 */ }; static const SiS_LCDDataStruct SiS_LCD1280x960Data[] = @@ -1097,9 +1078,9 @@ static const SiS_LCDDataStruct SiS_LCD1680x1050Data[] = { 95, 64, 1750, 784, 1900, 1066 }, /* 6 1024x768 */ { 95, 94, 1900, 1055, 1900, 1066 }, /* 7 1280x1024 */ { 41, 31, 1900, 806, 1900, 1066 }, /* 8 1280x768 */ - { 95, 69, 1800, 817, 1900, 1066 }, /* 9 1280x800 patch */ + { 95, 69, 1800, 817, 1900, 1066 }, /* 9 1280x800 patch index */ { 13, 9, 1900, 739, 1900, 1066 }, /* 10 1280x720 */ - { 95, 94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch */ + { 95, 94, 1880, 1066, 1900, 1066 }, /* 11 1400x1050 patch index */ { 1, 1, 1900, 1066, 1900, 1066 } /* 12 1680x1050 */ }; @@ -1148,12 +1129,12 @@ static const SiS_LCDDataStruct SiS_NoScaleData[] = { 1, 1,1800,1000,1800,1000 }, /* 0x0a: 1280x960 */ { 1, 1,1688,1066,1688,1066 }, /* 0x0b: 1400x1050 */ { 1, 1,1650, 750,1650, 750 }, /* 0x0c: 1280x720 (TMDS, projector) */ - { 1, 1,1656, 841,1656, 841 }, /* 0x0d: 1280x800 (was: 1408, 816) */ + { 1, 1,1552, 812,1552, 812 }, /* 0x0d: 1280x800 (was: 1408,816/ 1656,841) */ { 1, 1,1900,1066,1900,1066 }, /* 0x0e: 1680x1050 (LVDS) */ - { 1, 1,1408, 806,1408, 806 }, /* 0x0f: 1280x768_2 */ - { 1, 1,1664, 798,1664, 798 }, /* 0x10: 1280x768_3 */ - { 1, 1,1688, 802,1688, 802 }, /* 0x11: 1280x768: Std, TMDS only */ - { 1, 1,1344, 806,1344, 806 }, /* 0x12: 1280x720 (LVDS) */ + { 1, 1,1660, 806,1660, 806 }, /* 0x0f: 1280x768_2 (LVDS) */ + { 1, 1,1664, 798,1664, 798 }, /* 0x10: 1280x768_3 (LVDS) - temp */ + { 1, 1,1688, 802,1688, 802 }, /* 0x11: 1280x768 (TMDS) */ + { 1, 1,1408, 806,1408, 806 }, /* 0x12: 1280x720 (LVDS) */ { 1, 1, 896, 497, 896, 497 }, /* 0x13: 720x480 */ { 1, 1, 912, 597, 912, 597 }, /* 0x14: 720x576 */ { 1, 1, 912, 597, 912, 597 }, /* 0x15: 768x576 */ @@ -1166,7 +1147,6 @@ static const SiS_LCDDataStruct SiS_NoScaleData[] = { 1, 1,1104, 563,1104, 563 } /* 0x1c: 960x540 */ }; - /**************************************************************/ /* LVDS ----------------------------------------------------- */ /**************************************************************/ @@ -1207,7 +1187,6 @@ static const SiS_LVDSDataStruct SiS_LVDS640x480Data_2[]= { 800, 525, 800, 525} /* pseudo */ }; - static const SiS_LVDSDataStruct SiS_LVDS800x600Data_1[]= { { 848, 433,1060, 629}, @@ -1221,12 +1200,6 @@ static const SiS_LVDSDataStruct SiS_LVDS800x600Data_1[]= static const SiS_LVDSDataStruct SiS_LVDS800x600Data_2[]= { - {1056, 628,1056, 628}, - {1056, 628,1056, 628}, - {1056, 628,1056, 628}, - {1056, 628,1056, 628}, - {1056, 628,1056, 628}, - {1056, 628,1056, 628}, {1056, 628,1056, 628} }; @@ -1243,13 +1216,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_1[]= static const SiS_LVDSDataStruct SiS_LVDS1024x768Data_2[]= { - {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,1344, 806} }; static const SiS_LVDSDataStruct SiS_LVDS1280x1024Data_1[]= @@ -1266,13 +1233,6 @@ static const SiS_LVDSDataStruct SiS_LVDS1280x1024Data_1[]= static const SiS_LVDSDataStruct SiS_LVDS1280x1024Data_2[]= { - {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} }; @@ -1291,15 +1251,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1400x1050Data_1[]= static const SiS_LVDSDataStruct SiS_LVDS1400x1050Data_2[]= { - {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}, + {1688,1066, 1688,1066} }; static const SiS_LVDSDataStruct SiS_LVDS1600x1200Data_1[]= @@ -1314,32 +1266,11 @@ static const SiS_LVDSDataStruct SiS_LVDS1600x1200Data_1[]= {1728,1144, 2048,1320}, {1848,1170, 2048,1320}, {2048,1320, 2048,1320} -#if 0 - {1088, 450, 2048,1250}, - {1088, 400, 2048,1250}, - {1088, 450, 2048,1250}, - {1088, 400, 2048,1250}, - {1088, 530, 2048,1250}, - {1248, 650, 2048,1250}, - {1472, 818, 2048,1250}, - {1728,1066, 2048,1250}, - {1848,1066, 2048,1250}, - {2048,1250, 2048,1250} -#endif }; static const SiS_LVDSDataStruct SiS_LVDS1600x1200Data_2[]= { - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320}, - {2048,1320, 2048,1320} + {2048,1320, 2048,1320} }; static const SiS_LVDSDataStruct SiS_LVDS1280x960Data_1[]= @@ -1357,15 +1288,7 @@ static const SiS_LVDSDataStruct SiS_LVDS1280x960Data_1[]= static const SiS_LVDSDataStruct SiS_LVDS1280x960Data_2[]= { - {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} + {1344, 806,1344, 806} }; static const SiS_LVDSDataStruct SiS_LVDS1280x768Data_1[]= @@ -1383,14 +1306,6 @@ static const SiS_LVDSDataStruct SiS_LVDS1280x768Data_1[]= static const SiS_LVDSDataStruct SiS_LVDS1280x768Data_2[]= { - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, - {1408, 806, 1408, 806}, {1408, 806, 1408, 806} }; @@ -1407,12 +1322,6 @@ static const SiS_LVDSDataStruct SiS_LVDS1024x600Data_1[] = static const SiS_LVDSDataStruct SiS_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} }; @@ -1429,12 +1338,6 @@ static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_1[] = static const SiS_LVDSDataStruct SiS_LVDS1152x768Data_2[] = { - {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} }; @@ -1445,12 +1348,11 @@ static const SiS_LVDSDataStruct SiS_LVDSXXXxXXXData_1[]= { 800, 449, 800, 449}, { 900, 449, 900, 449}, { 900, 449, 900, 449}, - { 800, 525, 800, 525}, /* 640x480 */ - {1056, 628, 1056, 628}, /* 800x600 */ - {1344, 806, 1344, 806}, /* 1024x768 */ - {1688,1066, 1688,1066}, /* 1280x1024 */ /* INSERTED ! */ - {1688, 806, 1688, 806}, /* 1280x768 */ - /* No other panels ! */ + { 800, 525, 800, 525}, /* 640x480 */ + {1056, 628, 1056, 628}, /* 800x600 */ + {1344, 806, 1344, 806}, /* 1024x768 */ + {1688,1066, 1688,1066}, /* 1280x1024 */ /* INSERTED */ + {1688, 806, 1688, 806}, /* 1280x768 */ }; /* Custom data for Barco iQ R series */ @@ -1496,13 +1398,7 @@ static const SiS_LVDSDataStruct SiS_LVDSBARCO1024Data_1[]= /* Custom data for Barco iQ G series */ static const SiS_LVDSDataStruct SiS_LVDSBARCO1024Data_2[]= { - {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,1344, 806} }; /* Custom data for 848x480 parallel panel */ @@ -1589,10 +1485,10 @@ static const SiS_LVDSDesStruct SiS_CHTVONTSCDesData[]= static const SiS_LVDSDesStruct SiS_CHTVUPALDesData[]= { - {256, 0}, - {256, 0}, - {256, 0}, - {256, 0}, + {256, 0}, + {256, 0}, + {256, 0}, + {256, 0}, { 0, 0}, { 0, 0}, { 0, 0} @@ -1600,10 +1496,10 @@ static const SiS_LVDSDesStruct SiS_CHTVUPALDesData[]= static const SiS_LVDSDesStruct SiS_CHTVOPALDesData[]= { - {256, 0}, - {256, 0}, - {256, 0}, - {256, 0}, + {256, 0}, + {256, 0}, + {256, 0}, + {256, 0}, { 0, 0}, { 0, 0}, { 0, 0} @@ -2132,7 +2028,6 @@ typedef struct _SiS_PlasmaTables UCHAR plasmamodes[20]; /* | 0x80 = DVI-capable, | 0x40 = analog */ } SiS_PlasmaTables; - static const SiS_PlasmaModes SiS_PlasmaMode[] = { { "640x400", /* 00: IBM 400@70 */ 25175, diff --git a/src/init301.c b/src/init301.c index 4dba157..b4ccdb1 100644 --- a/src/init301.c +++ b/src/init301.c @@ -1505,6 +1505,21 @@ SiS_GetLCDInfoBIOS(SiS_Private *SiS_Pr, PSIS_HW_INFO HwInfo) #endif } +static void +SiS_CheckScaling(SiS_Private *SiS_Pr, USHORT resinfo, const UCHAR *nonscalingmodes) +{ + int i = 0; + while(nonscalingmodes[i] != 0xff) { + if(nonscalingmodes[i++] == resinfo) { + if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) || + (SiS_Pr->UsePanelScaler == -1)) { + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + } + break; + } + } +} + void SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, PSIS_HW_INFO HwInfo) @@ -1591,6 +1606,71 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, if(SiS_Pr->SiS_LCDResInfo < SiS_Pr->SiS_PanelMinLVDS) SiS_Pr->SiS_LCDResInfo = SiS_Pr->SiS_PanelMinLVDS; } + + temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); + SiS_Pr->SiS_LCDInfo = temp & ~0x000e; + /* Need temp below! */ + + if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; + + if(!SiS_Pr->UsePanelScaler) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; + else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + + /* Dual link, Pass 1:1 BIOS default, etc. */ +#ifdef SIS315H + if(HwInfo->jChipType >= SIS_661) { + if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { + if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; + } + if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { + if(SiS_Pr->SiS_ROMNew) { + if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; + } else if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) { + if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; + } + } + } else if(HwInfo->jChipType >= SIS_315H) { + if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { + if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; + } + if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) { + SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit); + temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); + if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; + if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { + if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; + } + } else if(!(SiS_Pr->SiS_ROMNew)) { + if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { + if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) && + (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) { + SiS_Pr->SiS_LCDInfo |= LCDDualLink; + } + if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || + (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || + (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || + (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) { + SiS_Pr->SiS_LCDInfo |= LCDDualLink; + } + } + } + } +#endif + + /* Pass 1:1 */ + if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { + /* Always center screen on LVDS (if scaling is disabled) */ + SiS_Pr->SiS_LCDInfo &= ~LCDPass11; + } else if(SiS_Pr->SiS_VBType & VB_SISVB) { + if(SiS_Pr->SiS_VBType & VB_SISLVDS) { + /* Always center screen on SiS LVDS (if scaling is disabled) */ + SiS_Pr->SiS_LCDInfo &= ~LCDPass11; + } else { + /* By default, pass 1:1 on SiS TMDS (if scaling is disabled) */ + SiS_Pr->SiS_LCDInfo |= LCDPass11; + if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; + } + } SiS_Pr->PanelVCLKIdx300 = VCLK65_300; SiS_Pr->PanelVCLKIdx315 = VCLK108_2_315; @@ -1660,15 +1740,21 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); break; case Panel_1280x768: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; - SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; - SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRS = 112; - SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; - SiS_Pr->PanelVCLKIdx300 = VCLK81_300; - SiS_Pr->PanelVCLKIdx315 = VCLK81_315; + if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { + SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 806; + SiS_Pr->PanelVCLKIdx300 = VCLK81_300; /* ? */ + SiS_Pr->PanelVCLKIdx315 = VCLK81_315; /* ? */ + } else { + SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 802; + SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRS = 112; + SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; + SiS_Pr->PanelVCLKIdx300 = VCLK81_300; + SiS_Pr->PanelVCLKIdx315 = VCLK81_315; + } break; case Panel_1280x768_2: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 768; - SiS_Pr->PanelHT = 1408; SiS_Pr->PanelVT = 806; - SiS_Pr->PanelHRS = 16; SiS_Pr->PanelHRE = 64; + SiS_Pr->PanelHT = 1660; SiS_Pr->PanelVT = 806; + SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; SiS_Pr->PanelVRS = 3; SiS_Pr->PanelVRE = 6; SiS_Pr->PanelVCLKIdx315 = VCLK_1280x768_2; SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); @@ -1681,10 +1767,10 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); break; case Panel_1280x800: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 800; - SiS_Pr->PanelHT = 1656; SiS_Pr->PanelVT = 841; /* 1408, 816 */ - SiS_Pr->PanelHRS = 32; SiS_Pr->PanelHRE = 312; /* 16, 64 */ - SiS_Pr->PanelVRS = 16; SiS_Pr->PanelVRE = 8; /* 4, 3 */ - SiS_Pr->PanelVCLKIdx315 = VCLK83_315; + SiS_Pr->PanelHT = 1552; SiS_Pr->PanelVT = 812; + SiS_Pr->PanelHRS = 48; SiS_Pr->PanelHRE = 112; + SiS_Pr->PanelVRS = 4; SiS_Pr->PanelVRE = 3; + SiS_Pr->PanelVCLKIdx315 = VCLK_1280x800_315; SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); break; case Panel_1280x960: SiS_Pr->PanelXRes = 1280; SiS_Pr->PanelYRes = 960; @@ -1725,6 +1811,12 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, SiS_Pr->PanelVCLKIdx315 = VCLK121_315; SiS_GetLCDInfoBIOS(SiS_Pr, HwInfo); break; + case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; + SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; + break; + case Panel_848x480: SiS_Pr->PanelXRes = 848; SiS_Pr->PanelYRes = 480; + SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; + break; case Panel_Custom: SiS_Pr->PanelXRes = SiS_Pr->CP_MaxX; SiS_Pr->PanelYRes = SiS_Pr->CP_MaxY; SiS_Pr->PanelHT = SiS_Pr->CHTotal; @@ -1757,135 +1849,165 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, } } break; - case Panel_Barco1366: SiS_Pr->PanelXRes = 1360; SiS_Pr->PanelYRes = 1024; - SiS_Pr->PanelHT = 1688; SiS_Pr->PanelVT = 1066; - break; - case Panel_848x480: SiS_Pr->PanelXRes = 848; SiS_Pr->PanelYRes = 480; - SiS_Pr->PanelHT = 1088; SiS_Pr->PanelVT = 525; - break; default: SiS_Pr->PanelXRes = 1024; SiS_Pr->PanelYRes = 768; SiS_Pr->PanelHT = 1344; SiS_Pr->PanelVT = 806; break; + } + + /* Special cases */ + if( (SiS_Pr->SiS_IF_DEF_FSTN) || + (SiS_Pr->SiS_IF_DEF_DSTN) || + (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || + (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || + (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { + SiS_Pr->PanelHRS = 999; + SiS_Pr->PanelHRE = 999; } - temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x37); - SiS_Pr->SiS_LCDInfo = temp & ~0x000e; + if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || + (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || + (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { + SiS_Pr->PanelVRS = 999; + SiS_Pr->PanelVRE = 999; + } - if(!(SiS_Pr->UsePanelScaler)) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; - else if(SiS_Pr->UsePanelScaler == 1) SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + /* DontExpand overrule */ + if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { - if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) SiS_Pr->SiS_LCDInfo &= ~DontExpandLCD; - -#ifdef SIS315H - if(HwInfo->jChipType >= SIS_661) { - if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { - if(temp & 0x08) SiS_Pr->SiS_LCDInfo |= LCDPass11; + if((SiS_Pr->SiS_VBInfo & SetCRT2ToLCD) && (modeflag & NoSupportLCDScale)) { + /* No scaling for this mode on any panel */ + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } - if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { - if(SiS_Pr->SiS_ROMNew) { - if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; - } else if((myptr = GetLCDStructPtr661(SiS_Pr, HwInfo))) { - if(myptr[2] & 0x01) SiS_Pr->SiS_LCDInfo |= LCDDualLink; + + switch(SiS_Pr->SiS_LCDResInfo) { + case Panel_Custom: + case Panel_1152x864: + case Panel_1280x768: /* TMDS only */ + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + break; + case Panel_800x600: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, 0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + break; + } + case Panel_1024x768: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + break; + } + case Panel_1280x720: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + if(SiS_Pr->PanelHT == 1650) { + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; } + break; } - } else if(HwInfo->jChipType >= SIS_315H) { - if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { - if(SiS_GetReg(SiS_Pr->SiS_P3d4,0x39) & 0x01) SiS_Pr->SiS_LCDInfo |= LCDPass11; + case Panel_1280x768_2: /* LVDS only */ + case Panel_1280x768_3: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768, + 0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + switch(resinfo) { + case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + } + break; + } + break; } - if((SiS_Pr->SiS_ROMNew) && (!(SiS_Pr->PanelSelfDetected))) { - SiS_Pr->SiS_LCDInfo &= ~(LCDRGB18Bit); - temp = SiS_GetReg(SiS_Pr->SiS_P3d4,0x35); - if(temp & 0x01) SiS_Pr->SiS_LCDInfo |= LCDRGB18Bit; - if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { - if(temp & 0x02) SiS_Pr->SiS_LCDInfo |= LCDDualLink; + case Panel_1280x800: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768, + 0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + switch(resinfo) { + case SIS_RI_1280x720: + case SIS_RI_1280x768: if(SiS_Pr->UsePanelScaler == -1) { + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + } + break; } + break; + } + case Panel_1280x960: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768, + SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800,0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + break; + } + case Panel_1280x1024: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768, + SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800,SIS_RI_1280x960, + 0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + break; + } + case Panel_1400x1050: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768, + SIS_RI_1152x864,SIS_RI_1280x768,SIS_RI_1280x800,SIS_RI_1280x960,0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + switch(resinfo) { + case SIS_RI_1280x720: if(SiS_Pr->UsePanelScaler == -1) { + SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + } + break; + case SIS_RI_1280x1024: SiS_Pr->SiS_LCDInfo |= DontExpandLCD; + break; + } + break; + } + case Panel_1600x1200: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600,SIS_RI_1152x768, + SIS_RI_1152x864,SIS_RI_1280x720,SIS_RI_1280x768,SIS_RI_1280x800,SIS_RI_1280x960, + SIS_RI_1360x768,SIS_RI_1360x1024,0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + break; + } + case Panel_1680x1050: { + static const UCHAR nonscalingmodes[] = { + SIS_RI_720x480, SIS_RI_720x576, SIS_RI_768x576, SIS_RI_800x480, SIS_RI_848x480, + SIS_RI_856x480, SIS_RI_960x540, SIS_RI_1024x576,SIS_RI_1024x600, SIS_RI_1152x768, + SIS_RI_1152x864,SIS_RI_1280x960,SIS_RI_1360x768,SIS_RI_1360x1024,0xff + }; + SiS_CheckScaling(SiS_Pr, resinfo, nonscalingmodes); + break; } - } -#endif - - if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { - /* Always center screen on LVDS (if scaling is disabled) */ - SiS_Pr->SiS_LCDInfo &= ~LCDPass11; - } else if(SiS_Pr->SiS_VBType & VB_SISVB) { - if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { - /* Always center screen on SiS LVDS (if scaling is disabled) */ - SiS_Pr->SiS_LCDInfo &= ~LCDPass11; - } else { - /* By default, pass 1:1 on SiS TMDS (if scaling is disabled) */ - SiS_Pr->SiS_LCDInfo |= LCDPass11; - if(SiS_Pr->CenterScreen == 1) SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } } - + if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { SiS_Pr->SiS_LCDInfo = 0x80 | 0x40 | 0x20; /* neg h/v sync, RGB24(D0 = 0) */ } } - if((SiS_Pr->SiS_VBType & VB_SISVB) && (!(SiS_Pr->SiS_VBType & VB_NoLCD))) { - if(SiS_Pr->SiS_VBInfo & (SetCRT2ToLCD | SetCRT2ToLCDA)) { - if(modeflag & NoSupportLCDScale) { - /* No scaling for this mode on any panel */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - switch(SiS_Pr->SiS_LCDResInfo) { - case Panel_Custom: - /* For non-standard LCD resolution, we let the panel scale */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - break; - case Panel_1280x720: - if(SiS_Pr->PanelHT == 1650) { - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - case Panel_1280x768: /* TMDS only */ - /* No idea about the timing and zoom factors */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - break; - case Panel_1280x1024: - if(SiS_Pr->SiS_VBType & VB_SISTMDS) { - if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e || - ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78 || - ModeNo == 0x14 || ModeNo == 0x15 || ModeNo == 0x16) { - /* We do not scale to 1280x720/800/960 (B/C bridges only) */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - if(((HwInfo->jChipType >= SIS_315H) && - (ModeNo == 0x23 || ModeNo == 0x24 || ModeNo == 0x25)) || - ((HwInfo->jChipType < SIS_315H) && - (ModeNo == 0x55 || ModeNo == 0x5a || ModeNo == 0x5b))) { - /* We do not scale to 1280x768 (B/C bridges only) */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - } - break; - case Panel_1400x1050: - if(SiS_Pr->SiS_VBType & VB_SISTMDS) { - if(ModeNo == 0x7c || ModeNo == 0x7d || ModeNo == 0x7e || - ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78 || - ModeNo == 0x14 || ModeNo == 0x15 || ModeNo == 0x16 || - ModeNo == 0x23 || ModeNo == 0x24 || ModeNo == 0x25) { - /* Do not scale to 1280x720/768/800/960 (B/C bridges only) */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - } - if(SiS_Pr->SiS_VBType & VB_SIS301LV302LV) { - if(ModeNo == 0x79 || ModeNo == 0x75 || ModeNo == 0x78) { - if(SiS_Pr->UsePanelScaler == -1) { - /* Do not scale to 1280x720 by default (LVDS bridges) */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - } - } - if(ModeNo == 0x3a || ModeNo == 0x4d || ModeNo == 0x65) { - /* Do not scale to 1280x1024 (all bridges) */ - SiS_Pr->SiS_LCDInfo |= DontExpandLCD; - } - break; - } - } - } - #ifdef SIS300 if(HwInfo->jChipType < SIS_315H) { if(SiS_Pr->SiS_IF_DEF_LVDS == 1) { @@ -1908,15 +2030,19 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, if(SiS_Pr->SiS_IF_DEF_TRUMPION) { SiS_Pr->SiS_LCDInfo |= (DontExpandLCD | LCDPass11); } - - if(SiS_Pr->SiS_LCDResInfo == Panel_640x480) { + + switch(SiS_Pr->SiS_LCDResInfo) { + case Panel_640x480: SiS_Pr->SiS_LCDInfo |= LCDPass11; - } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x960) { + break; + case Panel_1280x960: SiS_Pr->SiS_LCDInfo &= ~LCDPass11; - } else if(SiS_Pr->SiS_LCDResInfo == Panel_Custom) { + break; + case Panel_Custom: if(!SiS_Pr->CP_PrefClock) { SiS_Pr->SiS_LCDInfo |= LCDPass11; } + break; } if(SiS_Pr->UseCustomMode) { @@ -1928,46 +2054,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, SiS_Pr->SiS_LCDInfo &= ~LCDPass11; } - /* Special cases */ - if( (SiS_Pr->SiS_IF_DEF_FSTN) || - (SiS_Pr->SiS_IF_DEF_DSTN) || - (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || - (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || - (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { - SiS_Pr->PanelHRS = 999; - SiS_Pr->PanelHRE = 999; - } - - if( (SiS_Pr->SiS_CustomT == CUT_BARCO1366) || - (SiS_Pr->SiS_CustomT == CUT_BARCO1024) || - (SiS_Pr->SiS_CustomT == CUT_PANEL848) ) { - SiS_Pr->PanelVRS = 999; - SiS_Pr->PanelVRE = 999; - } - -#ifdef SIS315H - if((HwInfo->jChipType >= SIS_315H) && (HwInfo->jChipType < SIS_661)) { - if(!(SiS_Pr->SiS_ROMNew)) { - if(SiS_Pr->SiS_VBType & (VB_SIS302LV | VB_SIS302ELV)) { - /* Enable 302LV/302ELV dual link mode. - * For 661, this is done above. - */ - if((SiS_Pr->SiS_CustomT == CUT_CLEVO1024) && - (SiS_Pr->SiS_LCDResInfo == Panel_1024x768)) { - /* (Sets this in SenseLCD; new paneltypes) */ - SiS_Pr->SiS_LCDInfo |= LCDDualLink; - } - if((SiS_Pr->SiS_LCDResInfo == Panel_1280x1024) || - (SiS_Pr->SiS_LCDResInfo == Panel_1400x1050) || - (SiS_Pr->SiS_LCDResInfo == Panel_1600x1200) || - (SiS_Pr->SiS_LCDResInfo == Panel_1680x1050)) { - SiS_Pr->SiS_LCDInfo |= LCDDualLink; - } - } - } - } -#endif - + /* LVDS DDA */ if(!((HwInfo->jChipType < SIS_315H) && (SiS_Pr->SiS_SetFlag & SetDOSMode))) { if((SiS_Pr->SiS_IF_DEF_LVDS == 1) || (SiS_Pr->SiS_VBType & VB_NoLCD)) { @@ -2006,6 +2093,7 @@ SiS_GetLCDResInfo(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, } + /* VESA timing */ if(SiS_Pr->SiS_VBInfo & SetInSlaveMode) { if(SiS_Pr->SiS_VBInfo & SetNotSimuMode) { SiS_Pr->SiS_SetFlag |= LCDVESATiming; @@ -2072,7 +2160,7 @@ SiS_GetVCLK2Ptr(SiS_Private *SiS_Pr, USHORT ModeNo, USHORT ModeIdIndex, /* Only those whose IndexGEN doesn't match VBVCLK array: */ case SIS_RI_1280x720: VCLKIndex = VCLK_1280x720; if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) { - if(SiS_Pr->PanelHT == 1344) { + if(SiS_Pr->PanelHT != 1650) { VCLKIndex = VCLK_1280x720_2; } } @@ -2844,6 +2932,8 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, if(SiS_Pr->SiS_LCDResInfo == Panel_1680x1050) { if (resinfo == SIS_RI_1280x800) tempal = 9; else if(resinfo == SIS_RI_1400x1050) tempal = 11; + } else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x800) { + if (resinfo == SIS_RI_1280x768) tempal = 9; } if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) { /* Pass 1:1 only (center-screen handled outside) */ @@ -2857,6 +2947,13 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_2) tempal = 0x0f; else if(SiS_Pr->SiS_LCDResInfo == Panel_1280x768_3) tempal = 0x10; } + /* Special for 1280x720 TMDS <> LVDS */ + if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) && + (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 720)) { + if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) { + if(SiS_Pr->PanelHT != 1650) tempal = 0x12; + } + } } } @@ -2928,6 +3025,7 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, tempbx = 0; if((SiS_Pr->SiS_IF_DEF_CH70xx) && (SiS_Pr->SiS_VBInfo & SetCRT2ToTV)) { + tempbx = 10; if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; if(SiS_Pr->SiS_TVMode & TVSetPAL) { @@ -2943,10 +3041,12 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, if(SiS_Pr->SiS_TVMode & TVSetCHOverScan) tempbx += 1; } } + } else { + switch(SiS_Pr->SiS_LCDResInfo) { case Panel_640x480: tempbx = 6; break; - case Panel_640x480_2: tempbx = 30; break; + case Panel_640x480_2: case Panel_640x480_3: tempbx = 30; break; case Panel_800x600: tempbx = 0; break; case Panel_1024x600: tempbx = 15; break; @@ -2972,21 +3072,22 @@ SiS_GetCRT2Ptr(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, if(SiS_Pr->SiS_CustomT == CUT_BARCO1024) { tempbx = 82; - if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; + if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; } else if(SiS_Pr->SiS_CustomT == CUT_PANEL848) { tempbx = 84; - if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; + if(SiS_Pr->SiS_LCDInfo & DontExpandLCD) tempbx++; } + + if((SiS_Pr->SiS_CustomT != CUT_BARCO1366) && + (SiS_Pr->SiS_CustomT != CUT_PANEL848)) { + if((SiS_Pr->SiS_LCDInfo & DontExpandLCD) && + (!(SiS_Pr->SiS_LCDInfo & LCDPass11))) { + tempal = 0; + } + } } - if(SiS_Pr->SiS_SetFlag & SetDOSMode) { - if(SiS_Pr->SiS_LCDResInfo != Panel_640x480) tempal = 7; - if(HwInfo->jChipType < SIS_315H) { - if(SiS_GetReg(SiS_Pr->SiS_P3c4,0x13) & 0x80) tempal++; - } - } - (*CRT2Index) = tempbx; (*ResIndex) = tempal & 0x1F; } @@ -3094,7 +3195,7 @@ SiS_GetCRT2DataLVDS(SiS_Private *SiS_Pr,USHORT ModeNo,USHORT ModeIdIndex, if((SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].XRes == 1280) && (SiS_Pr->SiS_RefIndex[RefreshRateTableIndex].YRes == 720)) { if(SiS_Pr->SiS_LCDResInfo == Panel_1280x720) { - if(SiS_Pr->PanelHT == 1344) ResIndex = 0x12; + if(SiS_Pr->PanelHT != 1650) ResIndex = 0x12; } } } diff --git a/src/init301.h b/src/init301.h index 07de3db..1bba215 100644 --- a/src/init301.h +++ b/src/init301.h @@ -149,7 +149,7 @@ const UCHAR SiS_HiTVGroup3_2[] = { 0x18, 0x1d, 0x23, 0x28, 0x4c, 0xaa, 0x01 }; -/* 301C / 302ELV extended Part2 TV registers */ +/* 301C / 302ELV extended Part2 TV registers (4 tap scaler) */ static const UCHAR SiS_Part2CLVX_1[] = { 0x00,0x00, @@ -224,13 +224,13 @@ static const UCHAR SiS_Part2CLVX_6[] = { /* 1080i */ }; #ifdef SIS315H -/* 661 et al LCD data structure (0.94.0) */ +/* 661 et al LCD data structure (2.03.00) */ static const UCHAR SiS_LCDStruct661[] = { /* 1024x768 */ /* type|CR37| HDE | VDE | HT | VT | hss | hse */ 0x02,0xC0,0x00,0x04,0x00,0x03,0x40,0x05,0x26,0x03,0x10,0x00,0x88, 0x00,0x02,0x00,0x06,0x00,0x41,0x5A,0x64,0x00,0x00,0x00,0x00,0x04, - /* | vss | vse |clck| clock |CRT2DataP|CRT2DataP|idx */ + /* | vss | vse |clck| clock |CRT2DataP|CRT2DataP|idx */ /* VESA non-VESA noscale */ /* 1280x1024 */ 0x03,0xC0,0x00,0x05,0x00,0x04,0x98,0x06,0x2A,0x04,0x30,0x00,0x70, @@ -239,21 +239,21 @@ static const UCHAR SiS_LCDStruct661[] = { 0x09,0x20,0x78,0x05,0x1A,0x04,0x98,0x06,0x2A,0x04,0x18,0x00,0x38, 0x00,0x01,0x00,0x03,0x00,0x6C,0xF8,0x2F,0x00,0x00,0x00,0x00,0x09, /* 1600x1200 */ - 0x0B,0xC0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0, - 0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0B, - /* 1280x768 */ - 0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x05,0x26,0x03,0x10,0x00,0x40, - 0x00,0x03,0x00,0x06,0x00,0x44,0x63,0x46,0x00,0x00,0x00,0x00,0x06, + 0x0B,0xE0,0x40,0x06,0xB0,0x04,0x70,0x08,0xE2,0x04,0x40,0x00,0xC0, + 0x00,0x01,0x00,0x03,0x00,0xA2,0x70,0x24,0x00,0x00,0x00,0x00,0x0A, + /* 1280x768 (_2) */ + 0x0A,0xE0,0x00,0x05,0x00,0x03,0x7C,0x06,0x26,0x03,0x30,0x00,0x70, + 0x00,0x03,0x00,0x06,0x00,0x4D,0xC8,0x48,0x00,0x00,0x00,0x00,0x06, /* 1280x720 */ - 0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x02, + 0x0E,0xE0,0x00,0x05,0xD0,0x02,0x80,0x05,0x26,0x03,0x10,0x00,0x20, 0x00,0x01,0x00,0x06,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x05, /* 1280x800 */ - 0x0C,0xE0,0x00,0x05,0x20,0x03,0x80,0x05,0x30,0x03,0x10,0x00,0x40, - 0x00,0x04,0x00,0x03,0x00,0x45,0x9C,0x62,0x00,0x00,0x00,0x00,0x07, + 0x0C,0xE0,0x00,0x05,0x20,0x03,0x10,0x06,0x2C,0x03,0x30,0x00,0x70, + 0x00,0x04,0x00,0x03,0x00,0x49,0xCE,0x1E,0x00,0x00,0x00,0x00,0x09, /* 1680x1050 */ 0x0D,0xE0,0x90,0x06,0x1A,0x04,0x6C,0x07,0x2A,0x04,0x1A,0x00,0x4C, 0x00,0x03,0x00,0x06,0x00,0x79,0xBE,0x44,0x00,0x00,0x00,0x00,0x06, - /* 1280x768 (not in 0.93) */ + /* 1280x768 (_3) (not in 0.93 and later) */ 0x0A,0xC0,0x00,0x05,0x00,0x03,0x80,0x06,0x1E,0x03,0x40,0x00,0x80, 0x00,0x03,0x00,0x07,0x00,0x4F,0x00,0x00,0x00,0x00,0x00,0x00,0x06 }; diff --git a/src/initdef.h b/src/initdef.h index 837f834..14390d5 100644 --- a/src/initdef.h +++ b/src/initdef.h @@ -143,7 +143,7 @@ #define CRT2Mode 0x0800 #define HalfDCLK 0x1000 #define NoSupportSimuTV 0x2000 -#define NoSupportLCDScale 0x4000 /* TMDS: No scaling possible (no matter what panel) */ +#define NoSupportLCDScale 0x4000 /* SiS bridge: No scaling possible (no matter what panel) */ #define DoubleScanMode 0x8000 /* Infoflag */ @@ -488,8 +488,7 @@ #define VCLK100_315 0x46 /* Index in VBVCLKData table (315) */ #define VCLK34_315 0x55 #define VCLK68_315 0x0d -#define VCLK69_315 0x5c /* deprecated ! Index in VBVCLKData table (315) */ -#define VCLK83_315 0x5c /* Index in VBVCLKData table (315) */ +#define VCLK_1280x800_315 0x5c /* Index in VBVCLKData table (315) */ #define VCLK121_315 0x5d /* Index in VBVCLKData table (315) */ #define VCLK_1280x720 0x5f #define VCLK_1280x768_2 0x60 diff --git a/src/sis310_accel.c b/src/sis310_accel.c index b023b97..5b95203 100644 --- a/src/sis310_accel.c +++ b/src/sis310_accel.c @@ -90,7 +90,7 @@ # undef SISNEWRENDER # ifdef XORG_VERSION_CURRENT # include "xorgVersion.h" -# if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(6,7,0,0,0) +# if XORG_VERSION_CURRENT > XORG_VERSION_NUMERIC(6,7,0,0,0) # define SISNEWRENDER # endif # endif |