Mercurial > mplayer.hg
annotate TVout/matroxtv @ 9558:29aa61268e54
Update, new page fault handler to access the agp mem. Doesn't really work
here (display is grabelled) but read are realiable and fast. Could
it be possible to write with the aperture and read with the page fault
handler ?
author | albeu |
---|---|
date | Sun, 09 Mar 2003 23:55:42 +0000 |
parents | 43a33dff1293 |
children | 1c59a05f406d |
rev | line source |
---|---|
2487 | 1 #!/bin/sh |
7376 | 2 # |
3 # Gabucino - no warranty, this script can BOOM your TV and/or monitor, or else. | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
4 # v2.5 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
5 # This script has been tested and configured on a Matrox G400DH, a PAL TV, |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
6 # a 14" analog and a 15" digital monitor. |
7376 | 7 # |
8 # INSTALLATION: | |
9 # 1. READ MPLAYER'S TVOUT DOCUMENTATION! | |
10 # 2. Edit 'defaultmode', 'TVdefaultmode', and 'SetTVstandard' functions | |
11 # below to fit your needs. | |
12 # 3. Remove 'exit 1' safety check. | |
13 # | |
14 | |
15 function defaultmode { | |
16 # You can choose the mode to use in monitor-only mode | |
17 # 640x480 60Hz 32bpp (14" monitors) | |
18 fbset -a -xres 640 -yres 480 -vxres 640 -vyres 480 -depth 32 -pixclock 39721 -left 48 -right 16 -upper 33 -lower 10 -hslen 96 -vslen 2 -hsync high -accel true | |
19 # 768x576 60Hz 32bpp (14" monitors) | |
20 # fbset -a -xres 768 -yres 576 -vxres 768 -vyres 5460 -depth 32 -pixclock 26101 -left 144 -right 16 -upper 28 -lower 6 -hslen 112 -vslen 4 -accel true | |
21 # 800x600 76Hz 32bpp (15" monitors) | |
22 # fbset -a -xres 800 -yres 600 -vxres 800 -vyres 1440 -depth 32 -pixclock 20000 -left 128 -right 16 -upper 24 -lower 2 -hslen 96 -vslen 6 | |
23 # 1024x768 70Hz 32bpp (15" monitors) | |
24 # fbset -a -xres 1024 -yres 768 -vxres 1024 -vyres 1440 -depth 32 -pixclock 12500 -left 144 -right 32 -upper 30 -lower 2 -hslen 192 -vslen 6 | |
25 } | |
26 | |
27 function TVdefaultmode { | |
2487 | 28 |
7376 | 29 ## |
30 ## PAL modes | |
31 ## | |
32 | |
33 # 640x512 80Hz 32bpp | |
34 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true | |
35 # 640x528 83Hz 32bpp | |
36 # fbset -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true | |
37 # 720x576 78Hz 32bpp | |
38 # fbset -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true | |
39 | |
40 ## | |
41 ## NTSC modes | |
42 ## | |
2487 | 43 |
7376 | 44 # 640x240 non-interlaced 32bpp |
45 # fbset -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 | |
46 # 640x480 interlaced 32bpp | |
47 # fbset -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true | |
48 } | |
49 | |
50 function SetTVstandard { | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
51 matroxset 128 # PAL |
7376 | 52 # matroxset 2 # NTSC |
53 } | |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
54 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
55 function SetMonitorMode { |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
56 matroxset 128 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
57 } |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
58 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
59 function mappingreset { |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
60 matroxset -f /dev/fb0 -m 0 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
61 matroxset -f /dev/fb1 -m 0 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
62 matroxset -f /dev/fb0 -m 1 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
63 con2fb /dev/fb0 /dev/tty1 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
64 con2fb /dev/fb0 /dev/tty2 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
65 SetMonitorMode |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
66 defaultmode |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
67 } |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
68 |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
69 function warn { |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
70 clear |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
71 echo "Display routing is about to come! Due to certain limitations" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
72 echo "(kernel? driver?), you MUST switch ttys a few times for" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
73 echo "these changes to take effect!!!!! After pressing a key now." |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
74 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
75 echo "I.e.: press alt-f1, alt-f2, alt-f3, then back to alt-f1" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
76 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
77 echo "NOTE: you won't automatically get consoles on the new display." |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
78 echo " To achieve that, use the con2fb utility:" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
79 echo " $ con2fb /dev/fb1 /dev/tty1" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
80 echo " (and don't forget to change ttys a few times...)" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
81 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
82 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
83 echo "If you read this, PRESS ANY KEY TO CONTINUE" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
84 read |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
85 } |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
86 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
87 function warn2 { |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
88 clear |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
89 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
90 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
91 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
92 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
93 echo Routing done! |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
94 echo Change consoles! |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
95 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
96 echo Then PRESS ANY KEY TO RETURN to menu |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
97 read |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
98 } |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
99 |
7376 | 100 echo |
101 echo "Please read MPlayer's TV-out documentation, and install 'matroxset' and 'fbset'." | |
102 echo "Then edit this script to suit your monitor+TV set." | |
103 echo | |
9487 | 104 exit 1 |
2487 | 105 |
106 while [ 1 ]; do | |
107 | |
108 clear | |
109 | |
7524 | 110 echo " [ 0 ] Clear & blank screen" |
7376 | 111 echo " [ 1 ] Monitor only" |
112 echo " /---> Monitor" | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
113 echo " [ 2 ] Cloning - CRTC1" |
7376 | 114 echo " \\---> TV" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
115 echo |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
116 echo " /---> Monitor1" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
117 echo " [ 3 ] Cloning - CRTC1" |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
118 echo " \\---> Monitor2" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
119 echo |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
120 echo " CRTC1 ---> Monitor1" |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
121 echo " [ 4 ] DualHead -" |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
122 echo " CRTC2 ---> Monitor2" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
123 echo |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
124 echo " CRTC1 ---> Monitor2" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
125 echo " [ 5 ] DualHead - SWAP!" |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
126 echo " CRTC2 ---> Monitor1" |
2487 | 127 |
128 echo | |
129 | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
130 echo -- TV MODES |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
131 echo |
7376 | 132 echo " [ A ] 640x512 PAL" |
133 echo " [ S ] 640x528 PAL" | |
134 echo " [ D ] 720x576 PAL" | |
135 echo " [ F ] 640x240 NTSC" | |
136 echo " [ G ] 640x480 NTSC, Interlaced" | |
2487 | 137 |
138 read ABC | |
139 | |
140 case "$ABC" in | |
7524 | 141 0) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
142 mappingreset |
7524 | 143 clear |
144 setterm -cursor off | |
145 setterm -blank 0 | |
146 read | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
147 setterm -cursor on |
7524 | 148 ;; |
149 | |
2487 | 150 1) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
151 mappingreset |
2487 | 152 echo |
153 ;; | |
154 | |
155 2) | |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
156 mappingreset |
2487 | 157 matroxset -f /dev/fb0 -m 3 |
7376 | 158 SetTVstandard |
159 TVdefaultmode | |
2487 | 160 ;; |
161 | |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
162 3) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
163 mappingreset |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
164 matroxset -f /dev/fb0 -m 3 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
165 ;; |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
166 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
167 4) |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
168 warn |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
169 mappingreset |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
170 matroxset -f /dev/fb0 -m 1 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
171 matroxset -f /dev/fb1 -m 2 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
172 warn2 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
173 ;; |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
174 |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
175 5) |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
176 warn |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
177 mappingreset |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
178 matroxset -f /dev/fb0 -m 2 |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
179 matroxset -f /dev/fb1 -m 1 |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
180 warn2 |
9485
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
181 ;; |
10ac5e716014
added "Dualhead with Monitors", and "Cloning with Monitors" modes
gabucino
parents:
7524
diff
changeset
|
182 |
2487 | 183 a) |
7376 | 184 # 640x512 80Hz 32bpp |
185 fbset -depth 32 -left 60 -right 0 -upper 70 -lower 39 -hslen 76 -vslen 4 -xres 640 -yres 512 -bcast true | |
2487 | 186 ;; |
187 | |
188 s) | |
7376 | 189 # 640x528 83Hz 32bpp |
190 fbset -depth 32 -left 40 -right 0 -upper 63 -lower 29 -hslen 56 -vslen 4 -xres 640 -yres 528 -vxres 640 -vyres 528 -laced false -bcast true | |
2487 | 191 ;; |
192 | |
193 d) | |
7376 | 194 # 720x576 78Hz 32bpp |
9486
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
195 # fbset -depth 32 -left 54 -right -36 -upper 55 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true |
35355ec9f2b7
now it looks much better. Anyone wants to port this script to use
gabucino
parents:
9485
diff
changeset
|
196 fbset -depth 32 -right -36 -lower -6 -hslen 46 -vslen 4 -xres 720 -yres 576 -vxres 720 -vyres 576 -laced false -bcast true |
2487 | 197 ;; |
198 | |
7376 | 199 f) |
200 # 640x240 non-interlaced 32bpp | |
201 fbset -depth 32 -xres 640 -yres 240 -vxres 640 -vyres 240 -pixclock 79443 -left 72 -right 40 -upper 15 -lower 5 -hslen 48 -vslen 3 | |
202 ;; | |
203 | |
204 g) | |
205 # 640x480 interlaced 32bpp | |
206 fbset -depth 32 -xres 640 -yres 480 -vxres 640 -vyres 480 -pixclock 79443 -left 72 -right 40 -upper 30 -lower 10 -hslen 48 -vslen 5 -laced true | |
207 ;; | |
2487 | 208 esac |
209 | |
210 done |