172b676d7Smrg/*
272b676d7Smrg * X.org/XFree86 specific supplements to init.c/init301.c
372b676d7Smrg *
472b676d7Smrg * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria
572b676d7Smrg *
672b676d7Smrg * Redistribution and use in source and binary forms, with or without
772b676d7Smrg * modification, are permitted provided that the following conditions
872b676d7Smrg * are met:
972b676d7Smrg * 1) Redistributions of source code must retain the above copyright
1072b676d7Smrg *    notice, this list of conditions and the following disclaimer.
1172b676d7Smrg * 2) Redistributions in binary form must reproduce the above copyright
1272b676d7Smrg *    notice, this list of conditions and the following disclaimer in the
1372b676d7Smrg *    documentation and/or other materials provided with the distribution.
1472b676d7Smrg * 3) The name of the author may not be used to endorse or promote products
1572b676d7Smrg *    derived from this software without specific prior written permission.
1672b676d7Smrg *
1772b676d7Smrg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1872b676d7Smrg * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1972b676d7Smrg * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2072b676d7Smrg * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2172b676d7Smrg * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2272b676d7Smrg * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2372b676d7Smrg * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2472b676d7Smrg * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2572b676d7Smrg * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2672b676d7Smrg * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2772b676d7Smrg *
2872b676d7Smrg * Author: 	Thomas Winischhofer <thomas@winischhofer.net>
2972b676d7Smrg *
3072b676d7Smrg */
3172b676d7Smrg
3272b676d7Smrg#ifndef _INITEXTX_H_
3372b676d7Smrg#define _INITEXTX_H_
3472b676d7Smrg
3572b676d7Smrg#include "osdef.h"
3672b676d7Smrg#include "initdef.h"
3772b676d7Smrg
3872b676d7Smrg#include "sis.h"
3972b676d7Smrg#include "sis_regs.h"
4072b676d7Smrg
4172b676d7Smrg#ifdef SIS315H
4272b676d7Smrgstatic const struct {
4372b676d7Smrg	unsigned char  Ext_ModeID;     /* ModeID in new ROM */
4472b676d7Smrg	unsigned char  Ext_MyModeID;   /* corresponding ModeID in my tables (0 = identical) */
4572b676d7Smrg	unsigned short Ext_VESAID;     /* corresponding VESA ID in new ROM */
4672b676d7Smrg} SiS_EModeIDTable661[] = {
4772b676d7Smrg	{ 0x6a, 0x00, 0x0102 },
4872b676d7Smrg	{ 0x1d, 0x20, 0x0000 },
4972b676d7Smrg	{ 0x1e, 0x21, 0x0000 },
5072b676d7Smrg	{ 0x1f, 0x22, 0x0000 },
5172b676d7Smrg	{ 0x20, 0x29, 0x0000 },
5272b676d7Smrg	{ 0x21, 0x2a, 0x0000 },
5372b676d7Smrg	{ 0x22, 0x2b, 0x0000 },
5472b676d7Smrg	{ 0x23, 0x00, 0x011c },
5572b676d7Smrg	{ 0x24, 0x00, 0x011d },
5672b676d7Smrg	{ 0x25, 0x00, 0x011e },
5772b676d7Smrg	{ 0x26, 0x00, 0x011f },
5872b676d7Smrg	{ 0x27, 0x00, 0x0120 },
5972b676d7Smrg	{ 0x28, 0x00, 0x0121 },
6072b676d7Smrg	{ 0x2a, 0x14, 0x013d },
6172b676d7Smrg	{ 0x2b, 0x15, 0x013e },
6272b676d7Smrg	{ 0x2c, 0x16, 0x013f },
6372b676d7Smrg	{ 0x2e, 0x00, 0x0101 },
6472b676d7Smrg	{ 0x2f, 0x00, 0x0100 },
6572b676d7Smrg	{ 0x30, 0x00, 0x0103 },
6672b676d7Smrg	{ 0x37, 0x00, 0x0104 },
6772b676d7Smrg	{ 0x38, 0x00, 0x0105 },
6872b676d7Smrg	{ 0x3a, 0x00, 0x0107 },
6972b676d7Smrg	{ 0x3c, 0x00, 0x0125 },
7072b676d7Smrg	{ 0x3d, 0x00, 0x0126 },
7172b676d7Smrg	{ 0x40, 0x00, 0x010d },
7272b676d7Smrg	{ 0x41, 0x00, 0x010e },
7372b676d7Smrg	{ 0x43, 0x00, 0x0110 },
7472b676d7Smrg	{ 0x44, 0x00, 0x0111 },
7572b676d7Smrg	{ 0x46, 0x00, 0x0113 },
7672b676d7Smrg	{ 0x47, 0x00, 0x0114 },
7772b676d7Smrg	{ 0x49, 0x00, 0x0116 },
7872b676d7Smrg	{ 0x4a, 0x00, 0x0117 },
7972b676d7Smrg	{ 0x4c, 0x00, 0x0119 },
8072b676d7Smrg	{ 0x4d, 0x00, 0x011a },
8172b676d7Smrg	{ 0x50, 0x00, 0x0127 },
8272b676d7Smrg	{ 0x51, 0x00, 0x0128 },
8372b676d7Smrg	{ 0x52, 0x00, 0x0129 },
8472b676d7Smrg	{ 0x53, 0x1a, 0x0141 },
8572b676d7Smrg	{ 0x54, 0x1b, 0x0142 },
8672b676d7Smrg	{ 0x55, 0x1c, 0x0143 },
8772b676d7Smrg	{ 0x56, 0x00, 0x012a },
8872b676d7Smrg	{ 0x57, 0x00, 0x012b },
8972b676d7Smrg	{ 0x58, 0x00, 0x012c },
9072b676d7Smrg	{ 0x59, 0x00, 0x012d },
9172b676d7Smrg	{ 0x5a, 0x17, 0x012e },
9272b676d7Smrg	{ 0x5b, 0x18, 0x012f },
9372b676d7Smrg	{ 0x5c, 0x19, 0x0130 },
9472b676d7Smrg	{ 0x5d, 0x00, 0x0131 },
9572b676d7Smrg	{ 0x62, 0x00, 0x0112 },
9672b676d7Smrg	{ 0x63, 0x00, 0x0115 },
9772b676d7Smrg	{ 0x64, 0x00, 0x0118 },
9872b676d7Smrg	{ 0x65, 0x00, 0x011b },
9972b676d7Smrg	{ 0x66, 0x00, 0x0132 },
10072b676d7Smrg	{ 0x75, 0x00, 0x013a },
10172b676d7Smrg	{ 0x78, 0x00, 0x013b },
10272b676d7Smrg	{ 0x79, 0x00, 0x013c },
10372b676d7Smrg	{ 0x7b, 0x7c, 0x0136 },
10472b676d7Smrg	{ 0x7c, 0x7d, 0x0137 },
10572b676d7Smrg	{ 0x7d, 0x7e, 0x0138 },
10672b676d7Smrg	{ 0xff, 0xff, 0xffff }
10772b676d7Smrg};
10872b676d7Smrg#endif
10972b676d7Smrg
11072b676d7Smrg#define SIS_PL_HSYNCP 0x01
11172b676d7Smrg#define SIS_PL_HSYNCN 0x02
11272b676d7Smrg#define SIS_PL_VSYNCP 0x04
11372b676d7Smrg#define SIS_PL_VSYNCN 0x08
11472b676d7Smrg#define SIS_PL_DVI    0x80
11572b676d7Smrg
11672b676d7Smrgstruct SiS_PlasmaModes
11772b676d7Smrg{
11872b676d7Smrg   const char     *name;
11972b676d7Smrg   unsigned int   clock;
12072b676d7Smrg   unsigned short HDisplay, HTotal, HFrontPorch, HSyncWidth;
12172b676d7Smrg   unsigned short VDisplay, VTotal, VFrontPorch, VSyncWidth;
12272b676d7Smrg   unsigned char  SyncFlags;
12372b676d7Smrg};
12472b676d7Smrg
12572b676d7Smrgstruct SiS_PlasmaTables
12672b676d7Smrg{
12772b676d7Smrg   unsigned short vendor;
12872b676d7Smrg   unsigned char  productnum;
12972b676d7Smrg   unsigned short product[5];
13072b676d7Smrg   const char     *DDCnames[5];
13172b676d7Smrg   const char     *plasmaname;
13272b676d7Smrg   unsigned short maxx,maxy;
13372b676d7Smrg   unsigned short prefx, prefy;
13472b676d7Smrg   unsigned char  modenum;
13572b676d7Smrg   unsigned char  plasmamodes[20];  /* | 0x80 = DVI-capable, | 0x40 = analog */
13672b676d7Smrg};
13772b676d7Smrg
13872b676d7Smrgstatic const struct SiS_PlasmaModes SiS_PlasmaMode[] = {
13972b676d7Smrg   {  "640x400",		/* 00: IBM 400@70 */
14072b676d7Smrg      25175,
14172b676d7Smrg       640,  800, 17,  64,
14272b676d7Smrg       400,  449, 13,   2,
14372b676d7Smrg      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
14472b676d7Smrg   {  "640x480",		/* 01: VESA 480@72 */
14572b676d7Smrg      31500,
14672b676d7Smrg       640,  832, 24,  40,
14772b676d7Smrg       480,  520,  9,   3,
14872b676d7Smrg      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
14972b676d7Smrg   {  "800x600",		/* 02: VESA 600@72 */
15072b676d7Smrg      50000,
15172b676d7Smrg       800, 1040, 56, 120,
15272b676d7Smrg       600,  666, 37,   6,
15372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
15472b676d7Smrg   {  "864x480",		/* 03: Cereb wide 1 */
15572b676d7Smrg      42526,
15672b676d7Smrg       864, 1134, 22,  86,
15772b676d7Smrg       480,  500,  1,   3,
15872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCN },
15972b676d7Smrg   {  "848x480",		/* 04: VESA wide (NEC1) */
16072b676d7Smrg      33750,
16172b676d7Smrg       848, 1088, 16, 112,
16272b676d7Smrg       480,  517,  6,   8,
16372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
16472b676d7Smrg   {  "1024x576",		/* 05: VESA wide (NEC2) */
16572b676d7Smrg      47250,
16672b676d7Smrg      1024, 1320, 16, 144,
16772b676d7Smrg       576,  596,  2,   4,
16872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
16972b676d7Smrg   {  "1280x720",		/* 06: VESA wide (NEC3) */
17072b676d7Smrg      76500,
17172b676d7Smrg      1280, 1696, 48, 176,
17272b676d7Smrg       720,  750,  4,   8,
17372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
17472b676d7Smrg   {  "1360x765",		/* 07: VESA wide (NEC4) */
17572b676d7Smrg      85500,
17672b676d7Smrg      1360, 1792, 64, 176,
17772b676d7Smrg       765,  795,  4,   8,
17872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
17972b676d7Smrg   {  "1024x600",		/* 08: CEREB wide 2 */
18072b676d7Smrg      51200,
18172b676d7Smrg      1024, 1352, 51, 164,
18272b676d7Smrg       600,  628,  1,   4,
18372b676d7Smrg      SIS_PL_HSYNCN | SIS_PL_VSYNCP },
18472b676d7Smrg   {  "1024x768",		/* 09: VESA 768@75 */
18572b676d7Smrg      78750,
18672b676d7Smrg      1024, 1312,  16, 96,
18772b676d7Smrg       768,  800,   1,  3,
18872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
18972b676d7Smrg   {  "1152x864",		/* 10: VESA 1152x864@75 */
19072b676d7Smrg      108000,
19172b676d7Smrg      1152, 1600, 64, 128,
19272b676d7Smrg       864,  900,  1,   3,
19372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
19472b676d7Smrg   {  "1280x1024",		/* 11: VESA 1024@60 */
19572b676d7Smrg      108000,
19672b676d7Smrg      1280, 1688, 48, 112,
19772b676d7Smrg      1024, 1066,  1,   3,
19872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
19972b676d7Smrg   {  "1280x768",		/* 12: W_XGA */
20072b676d7Smrg      81000,
20172b676d7Smrg      1280, 1688, 48, 112,
20272b676d7Smrg       768,  802,  3,   6,
20372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCN },
20472b676d7Smrg   {  "1280x768",		/* 13: I/O Data W_XGA@56Hz */
20572b676d7Smrg      76064,
20672b676d7Smrg      1280, 1688, 48, 112,
20772b676d7Smrg       768,  802,  2,   3,
20872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
20972b676d7Smrg   {  "1376x768",		/* 14: I/O Wide XGA */
21072b676d7Smrg      87340,
21172b676d7Smrg      1376, 1808, 32, 128,
21272b676d7Smrg       768,  806,  3,   6,
21372b676d7Smrg      SIS_PL_HSYNCN | SIS_PL_VSYNCP },
21472b676d7Smrg   {  "1280x960",		/* 15: VESA 960@60 */
21572b676d7Smrg      108000,
21672b676d7Smrg      1280, 1800, 96, 112,
21772b676d7Smrg       960, 1000,  1,   3,
21872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
21972b676d7Smrg   {  "1400x1050",		/* 16: VESA 1050@60Hz */
22072b676d7Smrg      108000,
22172b676d7Smrg      1400, 1688, 48, 112,
22272b676d7Smrg      1050, 1066,  1,   3,
22372b676d7Smrg      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
22472b676d7Smrg   {  "1360x768",		/* 17: VESA wide (NEC4/2) */
22572b676d7Smrg      85500,
22672b676d7Smrg      1360, 1792, 64, 112,
22772b676d7Smrg       765,  795,  3,   6,
22872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
22972b676d7Smrg   {  "800x600",		/* 18: VESA 600@56 */
23072b676d7Smrg      36000,
23172b676d7Smrg       800, 1024, 24,   2,
23272b676d7Smrg       600,  625,  1,   2,
23372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
23472b676d7Smrg   {  "1072x600",		/* 19: Panasonic 1072x600 (sync?) */
23572b676d7Smrg      54100,
23672b676d7Smrg       1072, 1424, 48, 176,
23772b676d7Smrg        600,  628, 16,   1,
23872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
23972b676d7Smrg   {  "848x480",		/* 20: Panasonic 848x480 (sync?) */
24072b676d7Smrg      33070,			/* is 852x480, but we can't use 852 */
24172b676d7Smrg        848, 1068, 20,  40,	/* differs from DDC data, better centered */
24272b676d7Smrg        480,  516,  3,   5,	/* won't work assumingly, because data is % 8 */
24372b676d7Smrg      SIS_PL_HSYNCN | SIS_PL_VSYNCN },
24472b676d7Smrg   {  "1280x720",		/* 21: WIDE720(60) (aka "750p") (Panasonic) */
24572b676d7Smrg      74300,
24672b676d7Smrg      1280, 1650,110,  40,
24772b676d7Smrg       720,  750,  5,   5,
24872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
24972b676d7Smrg   {  "1280x768",		/* 22: 1280x768@56.5 (Panasonic) */
25072b676d7Smrg      76200,			/* (According to manual not supported for HDMI; but works) */
25172b676d7Smrg      1280, 1680, 16,  24,
25272b676d7Smrg       768,  802,  2,   5,
25372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
25472b676d7Smrg   {  "1280x720@50",		/* 23: WIDE720(50) (aka "750p") (Panasonic) */
25572b676d7Smrg      74300,			/* Panasonic states 45.0kHz. Not possible. This one works (with some overscan) */
25672b676d7Smrg      1280, 1980,400,  80,
25772b676d7Smrg       720,  750,  1,   2,
25872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
25972b676d7Smrg   {  "720x480",		/* 24: 720x480 (aka "525p" and "480p") (Panasonic) */
26072b676d7Smrg      27000,
26172b676d7Smrg       720,  856, 40,  32,
26272b676d7Smrg       480,  525,  1,   3,
26372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
26472b676d7Smrg   {  "720x576",		/* 25: 720x576 (aka "625p"and "576p") (Panasonic) */
26572b676d7Smrg      27500,
26672b676d7Smrg       720,  864, 16,  64,
26772b676d7Smrg       576,  625,  5,   6,
26872b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
26972b676d7Smrg   {  "1280x720@50",		/* 26: WIDE720(50) (aka "750p") (Generic) */
27072b676d7Smrg      74300,
27172b676d7Smrg      1280, 1980,400,  80,
27272b676d7Smrg       720,  750,  5,   5,
27372b676d7Smrg      SIS_PL_HSYNCP | SIS_PL_VSYNCP },
27472b676d7Smrg};
27572b676d7Smrg
27672b676d7Smrg/*
27772b676d7Smrg27.00  720 755 791 858  480 480 484 525
27872b676d7Smrg27.50  720 732 795 864  576 581 587 625
27972b676d7Smrg*/
28072b676d7Smrg
28172b676d7Smrgstatic const struct SiS_PlasmaTables SiS_PlasmaTable[] = {
28272b676d7Smrg#if 0  /* Product IDs missing */
28372b676d7Smrg   { 0x38a3, 4,
28472b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
28572b676d7Smrg     { "", "", "", "", "" },
28672b676d7Smrg     "NEC PlasmaSync 42VP4/42VP4D/42VP4G/42VP4DG",
28772b676d7Smrg     0, 0,
28872b676d7Smrg     0, 0,
28972b676d7Smrg     11,   /* All DVI, except 0, 7, 13 */
29072b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
29172b676d7Smrg      17|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
29272b676d7Smrg   },
29372b676d7Smrg#endif
29472b676d7Smrg#if 0  /* Product IDs missing */
29572b676d7Smrg   { 0x38a3, 3,
29672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
29772b676d7Smrg     { "", "", "", "", "" },
29872b676d7Smrg     "NEC PlasmaSync 42PD1/50PD1/50PD2",
29972b676d7Smrg     0, 0,
30072b676d7Smrg     0, 0,
30172b676d7Smrg     5,   /* DVI entirely unknown */
30272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0, 0     , 0     , 0     , 0     , 0     ,
30372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
30472b676d7Smrg   },
30572b676d7Smrg   { 0x38a3, 1,
30672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
30772b676d7Smrg     { "", "", "", "", "" },
30872b676d7Smrg     "NEC PlasmaSync 42PD3",
30972b676d7Smrg     0, 0,
31072b676d7Smrg     0, 0,
31172b676d7Smrg     10,   /* DVI entirely unknown */
31272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 7|0x40, 8|0xc0, 9|0xc0,
31372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
31472b676d7Smrg   },
31572b676d7Smrg   { 0x38a3, 2,
31672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
31772b676d7Smrg     { "", "", "", "", "" },
31872b676d7Smrg     "NEC PlasmaSync 42VM3/61XM1",
31972b676d7Smrg     0, 0,
32072b676d7Smrg     0, 0,
32172b676d7Smrg     11,  /* DVI entirely unknown */
32272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 3|0xc0, 4|0xc0, 5|0xc0, 6|0xc0, 8|0xc0, 9|0xc0,11|0xc0,
32372b676d7Smrg      17|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
32472b676d7Smrg   },
32572b676d7Smrg   { 0x38a3, 2,
32672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
32772b676d7Smrg     { "", "", "", "", "" },
32872b676d7Smrg     "NEC PlasmaSync 42MP1/42MP2",
32972b676d7Smrg     0, 0,
33072b676d7Smrg     0, 0,
33172b676d7Smrg     6,   /* DVI entirely unknown */
33272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0     , 0     , 0     , 0     ,
33372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
33472b676d7Smrg   },
33572b676d7Smrg   { 0x38a3, 1,
33672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
33772b676d7Smrg     { "", "", "", "", "" },
33872b676d7Smrg     "NEC PlasmaSync 50MP1",
33972b676d7Smrg     0, 0,
34072b676d7Smrg     0, 0,
34172b676d7Smrg     10,   /* DVI entirely unknown */
34272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
34372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
34472b676d7Smrg   },
34572b676d7Smrg#endif
34672b676d7Smrg   { 0x38a3, 4,
34772b676d7Smrg     { 0xa482, 0xa483, 0x0000, 0x0000, 0x0000 },
34872b676d7Smrg     { "PX-42VM", "", "", "", "" },
34972b676d7Smrg     "NEC PlasmaSync 42MP3/42MP4/50MP2/61MP1",
35072b676d7Smrg     0, 0,
35172b676d7Smrg     0, 0,
35272b676d7Smrg     11,   /* All DVI except 0, 7, 13, 17 */
35372b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,10|0xc0,11|0xc0,13|0x40,14|0xc0,
35472b676d7Smrg      17|0x40, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
35572b676d7Smrg   },
35672b676d7Smrg#if 0  /* Product IDs missing */
35772b676d7Smrg   { 0x38a3, 1,
35872b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
35972b676d7Smrg     { "", "", "", "", "" },
36072b676d7Smrg     "NEC PlasmaSync 3300W",
36172b676d7Smrg     0, 0,
36272b676d7Smrg     0, 0,
36372b676d7Smrg     3,
36472b676d7Smrg     { 0|0x40, 1|0xc0,18|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     ,
36572b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
36672b676d7Smrg   },
36772b676d7Smrg   { 0x38a3, 1,
36872b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
36972b676d7Smrg     { "", "", "", "", "" },
37072b676d7Smrg     "NEC PlasmaSync 4200W",
37172b676d7Smrg     4,   /* DVI entirely unknown */
37272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 0     , 0     , 0     , 0     , 0     , 0     ,
37372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
37472b676d7Smrg   },
37572b676d7Smrg   { 0x38a3, 1,
37672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
37772b676d7Smrg     { "", "", "", "", "" },
37872b676d7Smrg     "NEC PlasmaSync 4210W",
37972b676d7Smrg     0, 0,
38072b676d7Smrg     0, 0,
38172b676d7Smrg     6,   /* DVI entirely unknown */
38272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 9|0xc0,11|0xc0, 0     , 0     , 0     , 0     ,
38372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
38472b676d7Smrg   },
38572b676d7Smrg   { 0x38a3, 1,
38672b676d7Smrg     { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 },
38772b676d7Smrg     { "", "", "", "", "" },
38872b676d7Smrg     "NEC PlasmaSync 5000W",
38972b676d7Smrg     0, 0,
39072b676d7Smrg     0, 0,
39172b676d7Smrg     7,   /* DVI entirely unknown */
39272b676d7Smrg     { 0|0x40, 1|0xc0, 2|0xc0, 4|0xc0, 7|0x40, 9|0xc0,11|0xc0, 0     , 0     , 0     ,
39372b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
39472b676d7Smrg   },
39572b676d7Smrg#endif
39672b676d7Smrg   { 0x412f, 2,
39772b676d7Smrg     { 0x000c, 0x000b, 0x0000, 0x0000, 0x0000 },
39872b676d7Smrg     { "", "", "", "", "" },
39972b676d7Smrg     "Pioneer 503CMX/PDA-5002",
40072b676d7Smrg     0, 0,
40172b676d7Smrg     0, 0,
40272b676d7Smrg     6,   /* DVI unknown */
40372b676d7Smrg     { 1|0xc0, 2|0xc0, 9|0xc0,11|0xc0,12|0xc0,15|0xc0, 0     , 0     , 0     , 0     ,
40472b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
40572b676d7Smrg   },
40672b676d7Smrg   { 0x34a9, 1,
40772b676d7Smrg     { 0xa00e, 0x0000, 0x0000, 0x0000, 0x0000 },
40872b676d7Smrg     { "", "", "", "", "" },
40972b676d7Smrg     "Panasonic TH-42",
41072b676d7Smrg     0, 0,
41172b676d7Smrg     0, 0,
41272b676d7Smrg     5,   /* No DVI output */
41372b676d7Smrg     { 1|0x40, 2|0x40, 4|0x40, 9|0x40,15|0x40, 0     , 0     , 0     , 0     , 0     ,
41472b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
41572b676d7Smrg   },
41672b676d7Smrg   { 0x34a9, 1,
41772b676d7Smrg     { 0xa005, 0x0000, 0x0000, 0x0000, 0x0000 },
41872b676d7Smrg     { "TH-42PW*4", "", "", "", "" },
41972b676d7Smrg     "Panasonic TH-42PW5",
42072b676d7Smrg     0, 0,
42172b676d7Smrg     0, 0,
42272b676d7Smrg     1,   /* No special modes otherwise; no DVI. */
42372b676d7Smrg     {20|0x40,19|0x40, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     ,
42472b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
42572b676d7Smrg   },
42672b676d7Smrg   { 0x4c2e, 1,
42772b676d7Smrg     { 0x9b05, 0x0000, 0x0000, 0x0000, 0x0000 },
42872b676d7Smrg     { "PLV-Z2", "", "", "", "" },
42972b676d7Smrg     "Sanyo PLV-Z2 (non HDCP-mode)", 	/* HDCP mode would be id 9b06, but not needed */
43072b676d7Smrg     1280, 768,				/* as it then advertises correct size */
43172b676d7Smrg     1280, 720,
43272b676d7Smrg     1,   /* 1280x720, no special modes otherwise */
43372b676d7Smrg     {21|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     ,
43472b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
43572b676d7Smrg   },
43672b676d7Smrg   { 0x34a9, 1,
43772b676d7Smrg     { 0xd034, 0x0000, 0x0000, 0x0000, 0x0000 },
43872b676d7Smrg     { "AE500U (DVI-D)", "", "", "", "" },
43972b676d7Smrg     "Panasonic AE500U",
44072b676d7Smrg     1280, 768,
44172b676d7Smrg     1280, 720,
44272b676d7Smrg     1,   /* 1280x720, no special modes otherwise */
44372b676d7Smrg     {21|0xc0, 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     ,
44472b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
44572b676d7Smrg   },
44672b676d7Smrg   { 0x34a9, 1,
44772b676d7Smrg     { 0xd043, 0x0000, 0x0000, 0x0000, 0x0000 },
44872b676d7Smrg     { "AE700U (HDMI)", "", "", "", "" },
44972b676d7Smrg     "Panasonic AE700U",
45072b676d7Smrg     1360, 768,
45172b676d7Smrg     1280, 720,
45272b676d7Smrg     6,   /* 1280x720/60, 1280x720/50, 1280x768@56(digital/analog), 720x480, 720x576 */
45372b676d7Smrg     {21|0xc0,23|0xc0,22|0x80,13|0x40,24|0x80,25|0x80, 0     , 0     , 0     , 0     ,
45472b676d7Smrg       0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0     , 0       }
45572b676d7Smrg   },
45672b676d7Smrg   { 0x0000 }
45772b676d7Smrg};
45872b676d7Smrg
45972b676d7Smrgunsigned short	SiS_CheckBuildCustomMode(ScrnInfoPtr pScrn, DisplayModePtr mode, unsigned int VBFlags);
46072b676d7SmrgDisplayModePtr	SiSBuildBuiltInModeList(ScrnInfoPtr pScrn, BOOLEAN, BOOLEAN, BOOLEAN, BOOLEAN);
46172b676d7Smrgint		SiSTranslateToVESA(ScrnInfoPtr pScrn, int modenumber);
46272b676d7Smrgint		SiSTranslateToOldMode(int modenumber);
46372b676d7SmrgBOOLEAN		SiS_GetPanelID(struct SiS_Private *SiS_Pr);
46472b676d7Smrg
46572b676d7Smrgunsigned short	SiS_SenseLCDDDC(struct SiS_Private *SiS_Pr, SISPtr pSiS);
46672b676d7Smrgunsigned short	SiS_SenseVGA2DDC(struct SiS_Private *SiS_Pr, SISPtr pSiS);
46772b676d7Smrg
46872b676d7Smrgvoid		SiS_CalcXTapScaler(struct SiS_Private *SiS_Pr, int srcsize, int destsize, int taps, Bool ishoriz);
46972b676d7Smrgvoid		SiS_SetGroup2_C_ELV(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
47072b676d7Smrg			unsigned short ModeIdIndex, unsigned short RefreshRateTableIndex);
47172b676d7Smrg
47272b676d7Smrgextern unsigned char	SiS_GetReg(SISIOADDRESS port, unsigned short index);
47372b676d7Smrgextern void		SiS_SetReg(SISIOADDRESS port, unsigned short index, unsigned short data);
47472b676d7Smrgextern void		SiS_SetRegOR(SISIOADDRESS, unsigned short, unsigned short);
47572b676d7Smrgextern void		SiS_SetRegAND(SISIOADDRESS, unsigned short, unsigned short);
47672b676d7Smrgextern void		SiS_SetRegANDOR(SISIOADDRESS Port, unsigned short Index, unsigned short DataAND,
47772b676d7Smrg				unsigned short DataOR);
47872b676d7Smrgextern int		SiS_compute_vclk(int Clock, int *out_n, int *out_dn, int *out_div,
47972b676d7Smrg				int *out_sbit, int *out_scale);
48072b676d7Smrgextern void		SiSCalcClock(ScrnInfoPtr pScrn, int clock, int max_VLD, unsigned int *vclk);
48172b676d7Smrgextern void		SiS_CalcCRRegisters(struct SiS_Private *SiS_Pr, int depth);
48272b676d7Smrgextern BOOLEAN		SiSInitPtr(struct SiS_Private *SiS_Pr);
48372b676d7Smrgextern unsigned short	SiS_GetRefCRT1CRTC(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide);
48472b676d7Smrgextern unsigned short	SiS_GetRefCRTVCLK(struct SiS_Private *SiS_Pr, unsigned short Index, int UseWide);
48572b676d7Smrgextern void		SiS_Generic_ConvertCRData(struct SiS_Private *SiS_Pr, unsigned char *crdata,
48672b676d7Smrg				int xres, int yres, DisplayModePtr current);
48772b676d7Smrg
48872b676d7Smrgextern unsigned short	SiS_InitDDCRegs(struct SiS_Private *SiS_Pr, unsigned int VBFlags, int VGAEngine,
48972b676d7Smrg                		unsigned short adaptnum, unsigned short DDCdatatype, BOOLEAN checkcr32,
49072b676d7Smrg				unsigned int VBFlags2);
49172b676d7Smrgextern unsigned short	SiS_ProbeDDC(struct SiS_Private *SiS_Pr);
49272b676d7Smrgextern unsigned short	SiS_ReadDDC(struct SiS_Private *SiS_Pr, unsigned short DDCdatatype,
49372b676d7Smrg				unsigned char *buffer);
49472b676d7Smrg
49572b676d7Smrg#endif
49672b676d7Smrg
49772b676d7Smrg
49872b676d7Smrg
499