annotate vidix/sis_bridge.c @ 23037:c2c2bc418257

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