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