annotate vidix/sis_bridge.c @ 23047:702085652768

Suggest svn diff command that does not show most cosmetics
author reimar
date Sun, 22 Apr 2007 15:11:47 +0000
parents 82216ef041e0
children 7973a6935234
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23046
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
1 /*
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
2 * VIDIX driver for SiS chipsets.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
3 * Video bridge detection for SiS 300 and 310/325 series.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
4 * Copyright (C) 2003 Jake Page, Sugar Media.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
5 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
6 * This file is part of MPlayer.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
7 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
8 * MPlayer is free software; you can redistribute it and/or modify
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
9 * it under the terms of the GNU General Public License as published by
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
11 * (at your option) any later version.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
12 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
13 * MPlayer is distributed in the hope that it will be useful,
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
16 * GNU General Public License for more details.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
17 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
18 * You should have received a copy of the GNU General Public License
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
19 * along with MPlayer; if not, write to the Free Software
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
21 *
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
22 * Based on SiS Xv driver
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
23 * Copyright 2002-2003 by Thomas Winischhofer, Vienna, Austria.
82216ef041e0 updated vidix files headers whenever it's possible to have a clear GPL statement
ben
parents: 22901
diff changeset
24 */
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
25
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
26 #include <stdio.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
27 #include <stdlib.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
28 #include <unistd.h>
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
29
22901
a7605669b114 renamed libdha.[hc] to dha.[hc]
ben
parents: 22900
diff changeset
30 #include "dha.h"
22850
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
31 #include "sis_regs.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
32 #include "sis_defs.h"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
33
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
34
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
35 static void sis_ddc2_delay(unsigned short delaytime)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
36 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
37 unsigned short i;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
38 int temp;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
39
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
40 for (i = 0; i < delaytime; i++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
41 inSISIDXREG(SISSR, 0x05, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
42 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
43 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
44
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
45
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
46 static int sis_do_sense(int tempbl, int tempbh, int tempcl, int tempch)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
47 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
48 int temp;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
49
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
50 outSISIDXREG(SISPART4, 0x11, tempbl);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
51 temp = tempbh | tempcl;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
52 setSISIDXREG(SISPART4, 0x10, 0xe0, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
53 //usleep(200000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
54 sis_ddc2_delay(0x1000);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
55 tempch &= 0x7f;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
56 inSISIDXREG(SISPART4, 0x03, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
57 temp ^= 0x0e;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
58 temp &= tempch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
59 return (temp == tempch);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
60 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
61
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
62
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
63 /* sense connected devices on 30x bridge */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
64 static void sis_sense_30x(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
65 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
66 unsigned char backupP4_0d, backupP2_00, biosflag;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
67 unsigned char testsvhs_tempbl, testsvhs_tempbh;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
68 unsigned char testsvhs_tempcl, testsvhs_tempch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
69 unsigned char testcvbs_tempbl, testcvbs_tempbh;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
70 unsigned char testcvbs_tempcl, testcvbs_tempch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
71 unsigned char testvga2_tempbl, testvga2_tempbh;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
72 unsigned char testvga2_tempcl, testvga2_tempch;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
73 int myflag, result = 0, i, j, haveresult;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
74
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
75 inSISIDXREG(SISPART4, 0x0d, backupP4_0d);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
76 outSISIDXREG(SISPART4, 0x0d, (backupP4_0d | 0x04));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
77
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
78 inSISIDXREG(SISPART2, 0x00, backupP2_00);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
79 outSISIDXREG(SISPART2, 0x00, (backupP2_00 | 0x1c));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
80
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
81 sis_do_sense(0, 0, 0, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
82
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
83 if ((sis_vga_engine == SIS_315_VGA) ||
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
84 (sis_device_id == DEVICE_SIS_300)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
85 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
86 if (0 /*pSiS->sishw_ext.UseROM */ ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
87 if (sis_vga_engine == SIS_300_VGA)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
88 temp = 0xfe;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
89 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
90 temp = 0xf3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
91 if (sis_device_id == DEVICE_SIS_330)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
92 temp = 0x11b;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
93 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
94 if (pSiS->BIOS[temp] & 0x08) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
95 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
96 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
97 ("[SiS] SiS30x: Video bridge has DVI-I TMDS/VGA combo connector\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
98 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
99 orSISIDXREG(SISCR, 0x32, 0x80);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
100 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
101 andSISIDXREG(SISCR, 0x32, 0x7f);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
102 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
103 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
104 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
105 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
106
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
107 if (sis_vga_engine == SIS_300_VGA) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
108 if (0 /*pSiS->sishw_ext.UseROM */ ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
109 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
110 testvga2_tempbh = pSiS->BIOS[0xf9];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
111 testvga2_tempbl = pSiS->BIOS[0xf8];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
112 testsvhs_tempbh = pSiS->BIOS[0xfb];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
113 testsvhs_tempbl = pSiS->BIOS[0xfa];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
114 testcvbs_tempbh = pSiS->BIOS[0xfd];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
115 testcvbs_tempbl = pSiS->BIOS[0xfc];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
116 biosflag = pSiS->BIOS[0xfe];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
117 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
118 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
119 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
120 testvga2_tempbl = 0xd1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
121 testsvhs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
122 testsvhs_tempbl = 0xb9;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
123 testcvbs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
124 testcvbs_tempbl = 0xb3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
125 biosflag = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
126 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
127 if (sis_vbflags & (VB_301B | VB_302B | VB_301LV | VB_302LV)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
128 testvga2_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
129 testvga2_tempbl = 0x90;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
130 testsvhs_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
131 testsvhs_tempbl = 0x6b;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
132 testcvbs_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
133 testcvbs_tempbl = 0x74;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
134 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
135 inSISIDXREG(SISPART4, 0x01, myflag);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
136 if (myflag & 0x04) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
137 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
138 testvga2_tempbl = 0xfd;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
139 testsvhs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
140 testsvhs_tempbl = 0xdd;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
141 testcvbs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
142 testcvbs_tempbl = 0xee;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
143 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
144 testvga2_tempch = 0x0e;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
145 testvga2_tempcl = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
146 testsvhs_tempch = 0x06;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
147 testsvhs_tempcl = 0x04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
148 testcvbs_tempch = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
149 testcvbs_tempcl = 0x04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
150
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
151 if (sis_device_id == DEVICE_SIS_300) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
152 inSISIDXREG(SISSR, 0x3b, myflag);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
153 if (!(myflag & 0x01)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
154 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
155 testvga2_tempbl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
156 testvga2_tempch = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
157 testvga2_tempcl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
158 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
159 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
160 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
161 if (0 /*pSiS->sishw_ext.UseROM */ ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
162 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
163 if (sis_device_id == DEVICE_SIS_330) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
164 testvga2_tempbh = pSiS->BIOS[0xe6];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
165 testvga2_tempbl = pSiS->BIOS[0xe5];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
166 testsvhs_tempbh = pSiS->BIOS[0xe8];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
167 testsvhs_tempbl = pSiS->BIOS[0xe7];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
168 testcvbs_tempbh = pSiS->BIOS[0xea];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
169 testcvbs_tempbl = pSiS->BIOS[0xe9];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
170 biosflag = pSiS->BIOS[0x11b];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
171 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
172 testvga2_tempbh = pSiS->BIOS[0xbe];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
173 testvga2_tempbl = pSiS->BIOS[0xbd];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
174 testsvhs_tempbh = pSiS->BIOS[0xc0];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
175 testsvhs_tempbl = pSiS->BIOS[0xbf];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
176 testcvbs_tempbh = pSiS->BIOS[0xc2];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
177 testcvbs_tempbl = pSiS->BIOS[0xc1];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
178 biosflag = pSiS->BIOS[0xf3];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
179 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
180 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
181 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
182 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
183 testvga2_tempbl = 0xd1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
184 testsvhs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
185 testsvhs_tempbl = 0xb9;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
186 testcvbs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
187 testcvbs_tempbl = 0xb3;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
188 biosflag = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
189 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
190
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
191 if (sis_vbflags & (VB_301B | VB_302B | VB_301LV | VB_302LV)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
192 if (0 /*pSiS->sishw_ext.UseROM */ ) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
193 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
194 if (sis_device_id == DEVICE_SIS_330) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
195 testvga2_tempbh = pSiS->BIOS[0xec];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
196 testvga2_tempbl = pSiS->BIOS[0xeb];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
197 testsvhs_tempbh = pSiS->BIOS[0xee];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
198 testsvhs_tempbl = pSiS->BIOS[0xed];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
199 testcvbs_tempbh = pSiS->BIOS[0xf0];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
200 testcvbs_tempbl = pSiS->BIOS[0xef];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
201 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
202 testvga2_tempbh = pSiS->BIOS[0xc4];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
203 testvga2_tempbl = pSiS->BIOS[0xc3];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
204 testsvhs_tempbh = pSiS->BIOS[0xc6];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
205 testsvhs_tempbl = pSiS->BIOS[0xc5];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
206 testcvbs_tempbh = pSiS->BIOS[0xc8];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
207 testcvbs_tempbl = pSiS->BIOS[0xc7];
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
208 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
209 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
210 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
211 if (sis_vbflags & (VB_301B | VB_302B)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
212 testvga2_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
213 testvga2_tempbl = 0x90;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
214 testsvhs_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
215 testsvhs_tempbl = 0x6b;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
216 testcvbs_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
217 testcvbs_tempbl = 0x74;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
218 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
219 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
220 testvga2_tempbl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
221 testsvhs_tempbh = 0x02;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
222 testsvhs_tempbl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
223 testcvbs_tempbh = 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
224 testcvbs_tempbl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
225 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
226 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
227 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
228 if (sis_vbflags & (VB_301 | VB_301B | VB_302B)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
229 inSISIDXREG(SISPART4, 0x01, myflag);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
230 if (myflag & 0x04) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
231 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
232 testvga2_tempbl = 0xfd;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
233 testsvhs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
234 testsvhs_tempbl = 0xdd;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
235 testcvbs_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
236 testcvbs_tempbl = 0xee;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
237 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
238 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
239 if (sis_vbflags & (VB_301LV | VB_302LV)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
240 /* TW: No VGA2 or SCART on LV bridges */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
241 testvga2_tempbh = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
242 testvga2_tempbl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
243 testvga2_tempch = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
244 testvga2_tempcl = 0x00;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
245 testsvhs_tempch = 0x04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
246 testsvhs_tempcl = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
247 testcvbs_tempch = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
248 testcvbs_tempcl = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
249 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
250 testvga2_tempch = 0x0e;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
251 testvga2_tempcl = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
252 testsvhs_tempch = 0x06;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
253 testsvhs_tempcl = 0x04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
254 testcvbs_tempch = 0x08;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
255 testcvbs_tempcl = 0x04;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
256 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
257 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
258
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
259 /* XXX: ?? andSISIDXREG(SISCR, 0x32, ~0x14); */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
260 /* pSiS->postVBCR32 &= ~0x14; */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
261
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
262 /* scan for VGA2/SCART */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
263 if (testvga2_tempch || testvga2_tempcl ||
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
264 testvga2_tempbh || testvga2_tempbl) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
265
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
266 haveresult = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
267 for (j = 0; j < 10; j++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
268 result = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
269 for (i = 0; i < 3; i++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
270 if (sis_do_sense(testvga2_tempbl, testvga2_tempbh,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
271 testvga2_tempcl, testvga2_tempch))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
272 result++;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
273 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
274 if ((result == 0) || (result >= 2))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
275 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
276 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
277 if (result) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
278 if (biosflag & 0x01) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
279 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
280 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
281 ("[SiS] SiS30x: Detected TV connected to SCART output\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
282 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
283 sis_vbflags |= TV_SCART;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
284 orSISIDXREG(SISCR, 0x32, 0x04);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
285 /*pSiS->postVBCR32 |= 0x04; */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
286 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
287 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
288 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
289 ("[SiS] SiS30x: Detected secondary VGA connection\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
290 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
291 sis_vbflags |= VGA2_CONNECTED;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
292 orSISIDXREG(SISCR, 0x32, 0x10);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
293 /*pSiS->postVBCR32 |= 0x10; */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
294 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
295 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
296 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
297
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
298 /* scanning for TV */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
299
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
300 /* XXX: ?? andSISIDXREG(SISCR, 0x32, ~0x03); */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
301 /* pSiS->postVBCR32 &= ~0x03; */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
302
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
303 result = sis_do_sense(testsvhs_tempbl, testsvhs_tempbh,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
304 testsvhs_tempcl, testsvhs_tempch);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
305
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
306
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
307 haveresult = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
308 for (j = 0; j < 10; j++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
309 result = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
310 for (i = 0; i < 3; i++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
311 if (sis_do_sense(testsvhs_tempbl, testsvhs_tempbh,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
312 testsvhs_tempcl, testsvhs_tempch))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
313 result++;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
314 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
315 if ((result == 0) || (result >= 2))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
316 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
317 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
318 if (result) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
319 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
320 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
321 ("[SiS] SiS30x: Detected TV connected to SVIDEO output\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
322 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
323 /* TW: So we can be sure that there IS a SVIDEO output */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
324 sis_vbflags |= TV_SVIDEO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
325 orSISIDXREG(SISCR, 0x32, 0x02);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
326 //pSiS->postVBCR32 |= 0x02;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
327 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
328
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
329 if ((biosflag & 0x02) || (!(result))) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
330 haveresult = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
331 for (j = 0; j < 10; j++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
332 result = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
333 for (i = 0; i < 3; i++) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
334 if (sis_do_sense(testcvbs_tempbl, testcvbs_tempbh,
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
335 testcvbs_tempcl, testcvbs_tempch))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
336 result++;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
337 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
338 if ((result == 0) || (result >= 2))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
339 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
340 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
341 if (result) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
342 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
343 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
344 ("[SiS] SiS30x: Detected TV connected to COMPOSITE output\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
345 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
346 sis_vbflags |= TV_AVIDEO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
347 orSISIDXREG(SISCR, 0x32, 0x01);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
348 //pSiS->postVBCR32 |= 0x01;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
349 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
350 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
351
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
352 sis_do_sense(0, 0, 0, 0);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
353
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
354 outSISIDXREG(SISPART2, 0x00, backupP2_00);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
355 outSISIDXREG(SISPART4, 0x0d, backupP4_0d);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
356 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
357
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
358
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
359 static void sis_detect_crt1(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
360 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
361 unsigned char CR32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
362 unsigned char CRT1Detected = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
363 unsigned char OtherDevices = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
364
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
365 if (!(sis_vbflags & VB_VIDEOBRIDGE)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
366 sis_crt1_off = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
367 return;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
368 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
369
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
370 inSISIDXREG(SISCR, 0x32, CR32);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
371
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
372 if (CR32 & 0x20)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
373 CRT1Detected = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
374 if (CR32 & 0x5F)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
375 OtherDevices = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
376
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
377 if (sis_crt1_off == -1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
378 if (!CRT1Detected) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
379 /* BIOS detected no CRT1. */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
380 /* If other devices exist, switch it off */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
381 if (OtherDevices)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
382 sis_crt1_off = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
383 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
384 sis_crt1_off = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
385 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
386 /* BIOS detected CRT1, leave/switch it on */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
387 sis_crt1_off = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
388 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
389 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
390 if (sis_verbose > 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
391 printf("[SiS] %sCRT1 connection detected\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
392 sis_crt1_off ? "No " : "");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
393 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
394 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
395
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
396 static void sis_detect_tv(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
397 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
398 unsigned char SR16, SR38, CR32, CR38 = 0, CR79;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
399 int temp = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
400
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
401 if (!(sis_vbflags & VB_VIDEOBRIDGE))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
402 return;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
403
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
404 inSISIDXREG(SISCR, 0x32, CR32);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
405 inSISIDXREG(SISSR, 0x16, SR16);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
406 inSISIDXREG(SISSR, 0x38, SR38);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
407 switch (sis_vga_engine) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
408 case SIS_300_VGA:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
409 if (sis_device_id == DEVICE_SIS_630_VGA)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
410 temp = 0x35;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
411 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
412 case SIS_315_VGA:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
413 temp = 0x38;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
414 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
415 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
416 if (temp) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
417 inSISIDXREG(SISCR, temp, CR38);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
418 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
419
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
420 if (CR32 & 0x47)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
421 sis_vbflags |= CRT2_TV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
422
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
423 if (CR32 & 0x04)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
424 sis_vbflags |= TV_SCART;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
425 else if (CR32 & 0x02)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
426 sis_vbflags |= TV_SVIDEO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
427 else if (CR32 & 0x01)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
428 sis_vbflags |= TV_AVIDEO;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
429 else if (CR32 & 0x40)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
430 sis_vbflags |= (TV_SVIDEO | TV_HIVISION);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
431 else if ((CR38 & 0x04) && (sis_vbflags & (VB_301LV | VB_302LV)))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
432 sis_vbflags |= TV_HIVISION_LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
433 else if ((CR38 & 0x04) && (sis_vbflags & VB_CHRONTEL))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
434 sis_vbflags |= (TV_CHSCART | TV_PAL);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
435 else if ((CR38 & 0x08) && (sis_vbflags & VB_CHRONTEL))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
436 sis_vbflags |= (TV_CHHDTV | TV_NTSC);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
437
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
438 if (sis_vbflags & (TV_SCART | TV_SVIDEO | TV_AVIDEO | TV_HIVISION)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
439 if (sis_vga_engine == SIS_300_VGA) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
440 /* TW: Should be SR38 here as well, but this
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
441 * does not work. Looks like a BIOS bug (2.04.5c).
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
442 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
443 if (SR16 & 0x20)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
444 sis_vbflags |= TV_PAL;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
445 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
446 sis_vbflags |= TV_NTSC;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
447 } else if ((sis_device_id == DEVICE_SIS_550_VGA)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
448 inSISIDXREG(SISCR, 0x79, CR79);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
449 if (CR79 & 0x08) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
450 inSISIDXREG(SISCR, 0x79, CR79);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
451 CR79 >>= 5;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
452 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
453 if (CR79 & 0x01) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
454 sis_vbflags |= TV_PAL;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
455 if (CR38 & 0x40)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
456 sis_vbflags |= TV_PALM;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
457 else if (CR38 & 0x80)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
458 sis_vbflags |= TV_PALN;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
459 } else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
460 sis_vbflags |= TV_NTSC;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
461 } else if ((sis_device_id == DEVICE_SIS_650_VGA)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
462 inSISIDXREG(SISCR, 0x79, CR79);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
463 if (CR79 & 0x20) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
464 sis_vbflags |= TV_PAL;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
465 if (CR38 & 0x40)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
466 sis_vbflags |= TV_PALM;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
467 else if (CR38 & 0x80)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
468 sis_vbflags |= TV_PALN;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
469 } else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
470 sis_vbflags |= TV_NTSC;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
471 } else { /* 315, 330 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
472 if (SR38 & 0x01) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
473 sis_vbflags |= TV_PAL;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
474 if (CR38 & 0x40)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
475 sis_vbflags |= TV_PALM;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
476 else if (CR38 & 0x80)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
477 sis_vbflags |= TV_PALN;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
478 } else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
479 sis_vbflags |= TV_NTSC;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
480 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
481 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
482
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
483 if (sis_vbflags &
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
484 (TV_SCART | TV_SVIDEO | TV_AVIDEO | TV_HIVISION | TV_CHSCART |
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
485 TV_CHHDTV)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
486 if (sis_verbose > 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
487 printf("[SiS] %sTV standard %s\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
488 (sis_vbflags & (TV_CHSCART | TV_CHHDTV)) ? "Using " :
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
489 "Detected default ",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
490 (sis_vbflags & TV_NTSC) ? ((sis_vbflags & TV_CHHDTV) ?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
491 "480i HDTV" : "NTSC")
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
492 : ((sis_vbflags & TV_PALM) ? "PALM"
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
493 : ((sis_vbflags & TV_PALN) ? "PALN" : "PAL")));
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
494 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
495 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
496
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
497 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
498
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
499
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
500 static void sis_detect_crt2(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
501 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
502 unsigned char CR32;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
503
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
504 if (!(sis_vbflags & VB_VIDEOBRIDGE))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
505 return;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
506
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
507 /* CRT2-VGA not supported on LVDS and 30xLV */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
508 if (sis_vbflags & (VB_LVDS | VB_301LV | VB_302LV))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
509 return;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
510
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
511 inSISIDXREG(SISCR, 0x32, CR32);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
512
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
513 if (CR32 & 0x10)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
514 sis_vbflags |= CRT2_VGA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
515
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
516 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
517 if (!(pSiS->nocrt2ddcdetection)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
518 if (sis_vbflags & (VB_301B | VB_302B)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
519 if (!(sis_vbflags & (CRT2_VGA | CRT2_LCD))) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
520 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
521 ("[SiS] BIOS detected no secondary VGA, sensing via DDC\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
522 if (SiS_SenseVGA2DDC(pSiS->SiS_Pr, pSiS)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
523 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
524 ("[SiS] DDC error during secondary VGA detection\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
525 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
526 inSISIDXREG(SISCR, 0x32, CR32);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
527 if (CR32 & 0x10) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
528 sis_vbflags |= CRT2_VGA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
529 /*pSiS->postVBCR32 |= 0x10; */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
530 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
531 ("[SiS] Detected secondary VGA connection\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
532 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
533 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
534 ("[SiS] No secondary VGA connection detected\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
535 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
536 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
537 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
538 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
539 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
540 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
541
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
542 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
543
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
544
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
545 /* Preinit: detect video bridge and sense connected devs */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
546 static void sis_detect_video_bridge(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
547 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
548 int temp, temp1, temp2;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
549
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
550
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
551 sis_vbflags = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
552
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
553 if (sis_vga_engine != SIS_300_VGA && sis_vga_engine != SIS_315_VGA)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
554 return;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
555
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
556 inSISIDXREG(SISPART4, 0x00, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
557 temp &= 0x0F;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
558 if (temp == 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
559 inSISIDXREG(SISPART4, 0x01, temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
560 temp1 &= 0xff;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
561 if (temp1 >= 0xE0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
562 sis_vbflags |= VB_302LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
563 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_302LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
564 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
565 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
566 ("[SiS] Detected SiS302LV video bridge (ID 1; Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
567 temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
568 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
569
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
570 } else if (temp1 >= 0xD0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
571 sis_vbflags |= VB_301LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
572 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
573 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
574 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
575 ("[SiS] Detected SiS301LV video bridge (ID 1; Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
576 temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
577 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
578 } else if (temp1 >= 0xB0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
579 sis_vbflags |= VB_301B;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
580 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301B;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
581 inSISIDXREG(SISPART4, 0x23, temp2);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
582 if (!(temp2 & 0x02))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
583 sis_vbflags |= VB_30xBDH;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
584 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
585 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
586 ("[SiS] Detected SiS301B%s video bridge (Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
587 (temp2 & 0x02) ? "" : " (DH)", temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
588 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
589 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
590 sis_vbflags |= VB_301;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
591 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
592 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
593 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
594 ("[SiS] Detected SiS301 video bridge (Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
595 temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
596 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
597 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
598
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
599 sis_sense_30x();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
600
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
601 } else if (temp == 2) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
602
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
603 inSISIDXREG(SISPART4, 0x01, temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
604 temp1 &= 0xff;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
605 if (temp1 >= 0xE0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
606 sis_vbflags |= VB_302LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
607 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_302LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
608 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
609 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
610 ("[SiS] Detected SiS302LV video bridge (ID 2; Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
611 temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
612 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
613 } else if (temp1 >= 0xD0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
614 sis_vbflags |= VB_301LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
615 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_301LV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
616 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
617 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
618 ("[SiS] Detected SiS301LV video bridge (ID 2; Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
619 temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
620 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
621 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
622 sis_vbflags |= VB_302B;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
623 //pSiS->sishw_ext.ujVBChipID = VB_CHIP_302B;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
624 inSISIDXREG(SISPART4, 0x23, temp2);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
625 if (!(temp & 0x02))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
626 sis_vbflags |= VB_30xBDH;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
627 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
628 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
629 ("[SiS] Detected SiS302B%s video bridge (Revision 0x%x)\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
630 (temp2 & 0x02) ? "" : " (DH)", temp1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
631 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
632 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
633
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
634 sis_sense_30x();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
635
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
636 } else if (temp == 3) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
637 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
638 printf("[SiS] Detected SiS303 video bridge - not supported\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
639 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
640 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
641 /* big scary mess of code to handle unknown or Chrontel LVDS */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
642 /* skipping it for now */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
643 if (sis_verbose > 1) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
644 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
645 ("[SiS] Detected Chrontel video bridge - not supported\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
646 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
647 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
648
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
649 /* this is probably not relevant to video overlay driver... */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
650 /* detects if brdige uses LCDA for low res text modes */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
651 if (sis_vga_engine == SIS_315_VGA) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
652 if (sis_vbflags & (VB_302B | VB_301LV | VB_302LV)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
653 #if 0
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
654 if (pSiS->sisfblcda != 0xff) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
655 if ((pSiS->sisfblcda & 0x03) == 0x03) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
656 //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
657 sis_vbflags |= VB_USELCDA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
658 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
659 } else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
660 #endif
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
661 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
662 inSISIDXREG(SISCR, 0x34, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
663 if (temp <= 0x13) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
664 inSISIDXREG(SISCR, 0x38, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
665 if ((temp & 0x03) == 0x03) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
666 //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
667 sis_vbflags |= VB_USELCDA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
668 } else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
669 inSISIDXREG(SISCR, 0x30, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
670 if (temp & 0x20) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
671 inSISIDXREG(SISPART1, 0x13, temp);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
672 if (temp & 0x40) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
673 //pSiS->SiS_Pr->SiS_UseLCDA = TRUE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
674 sis_vbflags |= VB_USELCDA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
675 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
676 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
677 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
678 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
679 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
680 if (sis_vbflags & VB_USELCDA) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
681 /* printf("Bridge uses LCDA for low resolution and text modes\n"); */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
682 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
683 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
684 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
685
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
686
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
687 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
688
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
689
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
690 /* detect video bridge type and sense connected devices */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
691 void sis_init_video_bridge(void)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
692 {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
693
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
694 sis_detect_video_bridge();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
695
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
696 sis_detect_crt1();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
697 //sis_detect_lcd();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
698 sis_detect_tv();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
699 sis_detect_crt2();
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
700
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
701 sis_detected_crt2_devices =
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
702 sis_vbflags & (CRT2_LCD | CRT2_TV | CRT2_VGA);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
703
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
704 // force crt2 type
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
705 if (sis_force_crt2_type == CRT2_DEFAULT) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
706 if (sis_vbflags & CRT2_VGA)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
707 sis_force_crt2_type = CRT2_VGA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
708 else if (sis_vbflags & CRT2_LCD)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
709 sis_force_crt2_type = CRT2_LCD;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
710 else if (sis_vbflags & CRT2_TV)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
711 sis_force_crt2_type = CRT2_TV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
712 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
713
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
714 switch (sis_force_crt2_type) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
715 case CRT2_TV:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
716 sis_vbflags = sis_vbflags & ~(CRT2_LCD | CRT2_VGA);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
717 if (sis_vbflags & VB_VIDEOBRIDGE)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
718 sis_vbflags = sis_vbflags | CRT2_TV;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
719 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
720 sis_vbflags = sis_vbflags & ~(CRT2_TV);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
721 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
722 case CRT2_LCD:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
723 sis_vbflags = sis_vbflags & ~(CRT2_TV | CRT2_VGA);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
724 if ((sis_vbflags & VB_VIDEOBRIDGE) /* XXX: && (pSiS->VBLCDFlags) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
725 )
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
726 sis_vbflags = sis_vbflags | CRT2_LCD;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
727 else {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
728 sis_vbflags = sis_vbflags & ~(CRT2_LCD);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
729 if (sis_verbose > 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
730 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
731 ("[SiS] Can't force CRT2 to LCD, no panel detected\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
732 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
733 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
734 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
735 case CRT2_VGA:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
736 if (sis_vbflags & VB_LVDS) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
737 if (sis_verbose > 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
738 printf("[SiS] LVDS does not support secondary VGA\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
739 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
740 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
741 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
742 if (sis_vbflags & (VB_301LV | VB_302LV)) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
743 if (sis_verbose > 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
744 printf
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
745 ("[SiS] SiS30xLV bridge does not support secondary VGA\n");
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
746 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
747 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
748 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
749 sis_vbflags = sis_vbflags & ~(CRT2_TV | CRT2_LCD);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
750 if (sis_vbflags & VB_VIDEOBRIDGE)
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
751 sis_vbflags = sis_vbflags | CRT2_VGA;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
752 else
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
753 sis_vbflags = sis_vbflags & ~(CRT2_VGA);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
754 break;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
755 default:
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
756 sis_vbflags &= ~(CRT2_TV | CRT2_LCD | CRT2_VGA);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
757 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
758
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
759 /* CRT2 gamma correction?? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
760
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
761 /* other force modes: */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
762 /* have a 'force tv type' (svideo, composite, scart) option? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
763 /* have a 'force crt1 type' (to turn it off, etc??) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
764
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
765 /* TW: Check if CRT1 used (or needed; this eg. if no CRT2 detected) */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
766 if (sis_vbflags & VB_VIDEOBRIDGE) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
767
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
768 /* TW: No CRT2 output? Then we NEED CRT1!
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
769 * We also need CRT1 if depth = 8 and bridge=LVDS|630+301B
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
770 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
771 if ((!(sis_vbflags & (CRT2_VGA | CRT2_LCD | CRT2_TV))) || ( /*(pScrn->bitsPerPixel == 8) && */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
772 ((sis_vbflags & (VB_LVDS | VB_CHRONTEL)) || ((sis_vga_engine == SIS_300_VGA) && (sis_vbflags & VB_301B))))) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
773 sis_crt1_off = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
774 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
775 /* TW: No CRT2 output? Then we can't use hw overlay on CRT2 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
776 if (!(sis_vbflags & (CRT2_VGA | CRT2_LCD | CRT2_TV)))
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
777 sis_overlay_on_crt1 = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
778
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
779 } else { /* TW: no video bridge? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
780
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
781 /* Then we NEED CRT1... */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
782 sis_crt1_off = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
783 /* ... and can't use CRT2 for overlay output */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
784 sis_overlay_on_crt1 = 1;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
785 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
786
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
787 /* tvstandard options ? */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
788
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
789 // determine using CRT1 or CRT2?
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
790 /* -> NO dualhead right now... */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
791 if (sis_vbflags & DISPTYPE_DISP2) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
792 if (sis_crt1_off) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
793 sis_vbflags |= VB_DISPMODE_SINGLE;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
794 /* TW: No CRT1? Then we use the video overlay on CRT2 */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
795 sis_overlay_on_crt1 = 0;
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
796 } else /* TW: CRT1 and CRT2 - mirror or dual head ----- */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
797 sis_vbflags |= (VB_DISPMODE_MIRROR | DISPTYPE_CRT1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
798 } else { /* TW: CRT1 only ------------------------------- */
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
799 sis_vbflags |= (VB_DISPMODE_SINGLE | DISPTYPE_CRT1);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
800 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
801
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
802 if (sis_verbose > 0) {
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
803 printf("[SiS] Using hardware overlay on CRT%d\n",
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
804 sis_overlay_on_crt1 ? 1 : 2);
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
805 }
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
806
9a1e26fef45b Move driver files directly into the vidix directory.
diego
parents:
diff changeset
807 }