annotate drivers/radeon/hacking @ 15435:428b13185b63

fix the range and type of -tv immediatemode option
author henry
date Fri, 13 May 2005 14:45:28 +0000
parents 8a46f6a9efd0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3191
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
1 ATI chips hacking
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
2 =================
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
3 Dedicated to ATI's hackers.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
4
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
5 Preface
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
6 ~~~~~~~
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
7 This document will compare ATI chips only from point of DAC and video overlay.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
8 There are lots of difference from 3D point, dual-head support, tv-out support
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
9 and many other things but it's already perfectly different story.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
10 This document doesn't include information about ATI AIW (All In Wonder) chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
11
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
12 What are units on modern ATI chips:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
13 DAC - (Digital to Analog Convertor) controls CRTC, LCD, DFP monitor's output
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
14 Consists from:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
15 PLL - (Programable line length) registers
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
16 CRTC - CRT controller
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
17 LCD/DFP scaler
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
18 surface control
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
19 DAC2 - controls CRTC, LCD, DFP monitor's output on second head
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
20 TVDAC - controls Composite Video and Super Video output ports
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
21 Consists from:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
22 TV_PLL
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
23 TV scaler & sync unit
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
24 TV format convertor (PAL/NTSC)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
25 TVCAP - controls Video-In port
3197
9440d478e10d Sorry for inexactitude
nick
parents: 3191
diff changeset
26 MPP - Miscellaneous peripheral port. (includes macrovision's filter - copy
3191
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
27 protection mechanism)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
28 OV - Video overlay (YUV BES) (include subpictures, gamma correction and
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
29 adaptive deinterlacing)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
30 CAP0 - Video capturing
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
31 CAP1 - Video capturing (second unit)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
32 RT - Rage theatre: video encoding and mixing
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
33 MUX - video muxer
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
34 MEM - PCI/AGP bus mastering
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
35 2D - GUI engine
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
36 3D - 3D-OpenGL engine (There are lots of stuff)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
37 I2C - I2C Bus control
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
38
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
39 This document is mainly related only with OV unit ;)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
40 Video decoding diagram:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
41
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
42 RAM memory: [ App ] Copies YUV image to overlay memory
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
43 | <-- (It's possible to program DMA here)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
44 overlay memory:[ OV ] performs scaling and YUVtoRGB convertion
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
45 /\
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
46 RGB memory: / \
3197
9440d478e10d Sorry for inexactitude
nick
parents: 3191
diff changeset
47 / [ macrovision ] performs copy protection filtering
9440d478e10d Sorry for inexactitude
nick
parents: 3191
diff changeset
48 / \ (unneeded but presented by default thing;)
3191
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
49 [ CRTC/LCD/DFP DAC ] [ TV DAC ] convert RGB memory to CRTC and NTSC/PAL signals
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
50 | |
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
51 [CRTC/LCD/DFP Monitor] [TV-screen]
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
52
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
53 History
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
54 ~~~~~~~
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
55 What is history of ATI's chips? I can be wrong but below is my vision
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
56 of this question:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
57
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
58 0. I don't know any earlied chips :(
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
59 1. Mach8
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
60 2. Mach16
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
61 3. Mach32
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
62
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
63 4. Mach64.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
64 It's first chip which has support from side of open
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
65 source drivers. Set of mach64 chips is:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
66 mach64GX (ATI888GX00)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
67 mach64CX (ATI888CX00)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
68 mach64CT (ATI264CT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
69 mach64ET (ATI264ET)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
70 mach64VTA3 (ATI264VT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
71 mach64VTA4 (ATI264VT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
72 mach64VTB (ATI264VTB)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
73 mach64VT4 (ATI264VT4)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
74
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
75 5. 3D rage chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
76 It seems that these chips have fully compatible by GPU with Mach64
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
77 which is extended by 3D possibilities. Set of 3D rage chips is:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
78 3D RAGE (GT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
79 3D RAGE II+ (GTB)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
80 3D RAGE IIC (PCI)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
81 3D RAGE IIC (AGP)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
82 3D RAGE LT
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
83 3D RAGE LT-G
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
84 3D RAGE PRO (BGA, AGP)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
85 3D RAGE PRO (BGA, AGP, 1x only)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
86 3D RAGE PRO (BGA, PCI)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
87 3D RAGE PRO (PQFP, PCI)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
88 3D RAGE PRO (PQFP, PCI, limited 3D)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
89 3D RAGE (XL)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
90 3D RAGE LT PRO (AGP)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
91 3D RAGE LT PRO (PCI)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
92 3D RAGE Mobility (PCI)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
93 3D RAGE Mobility (AGP)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
94
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
95 6. Rage128 chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
96 These chips have perfectly new GPU which supports memory mapped IO
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
97 space for accelerating port access (It's main cause of incompatibility
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
98 with mach64). Set of Rage128 chips is:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
99 Rage128 GL RE
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
100 Rage128 GL RF
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
101 Rage128 GL RG
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
102 Rage128 GL RH
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
103 Rage128 GL RI
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
104 Rage128 VR RK
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
105 Rage128 VR RL
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
106 Rage128 VR RM
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
107 Rage128 VR RN
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
108 Rage128 VR RO
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
109 Rage128 Mobility M3 LE
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
110 Rage128 Mobility M3 LF
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
111 7. Rage128Pro chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
112 These chips are successors of Rage128 ones.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
113 Rage128Pro GL PA
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
114 Rage128Pro GL PB
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
115 Rage128Pro GL PC
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
116 Rage128Pro GL PD
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
117 Rage128Pro GL PE
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
118 Rage128Pro GL PF
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
119 Rage128Pro VR PG
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
120 Rage128Pro VR PH
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
121 Rage128Pro VR PI
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
122 Rage128Pro VR PJ
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
123 Rage128Pro VR PK
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
124 Rage128Pro VR PL
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
125 Rage128Pro VR PM
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
126 Rage128Pro VR PN
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
127 Rage128Pro VR PO
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
128 Rage128Pro VR PP
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
129 Rage128Pro VR PQ
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
130 Rage128Pro VR PR
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
131 Rage128Pro VR TR
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
132 Rage128Pro VR PS
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
133 Rage128Pro VR PT
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
134 Rage128Pro VR PU
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
135 Rage128Pro VR PV
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
136 Rage128Pro VR PW
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
137 Rage128Pro VR PX
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
138 Rage128Pro Ultra U1
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
139 Rage128Pro Ultra U2
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
140 Rage128Pro Ultra U3
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
141
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
142 8. Radeon chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
143 Indeed they could be named Rage256 Pro. (With minor changes is fully
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
144 compatible with Rage128 chips).
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
145 Radeon QD
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
146 Radeon QE
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
147 Radeon QF
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
148 Radeon QG
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
149 Radeon VE QY
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
150 Radeon VE QZ
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
151 Radeon M6 LY
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
152 Radeon M6 LZ
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
153 Radeon M7 LW
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
154 9. Radeon2 chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
155 Indeed they could be named Rage512 Pro.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
156 Radeon2 8500 QL
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
157 Radeon2 7500 QW
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
158
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
159 10. Radeon3 and newest are cooming soon, but I hope that they will be fully
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
160 compatible with Radeon1 chips.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
161
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
162 In Radeon famility there were introduced also FX chips: Radeon FX and
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
163 Radeon2 8700 FX. Probably they have the same possibility as other Radeon
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
164 but currently it's unknown for me.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
165
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
166 What about video overlay and DAC?
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
167 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
168
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
169 Currently it's known that there is only difference between
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
170 Mach64 and Rage128 compatible chips:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
171 - They have different logic of io ports programming!
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
172 - They are incompatible by port numbers!
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
173 But:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
174 - They use the same program logic from register's name point.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
175 (Indeed exists slight difference even between Radeon and Rage128
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
176 chips. AFAIK only Radeon has OV0_SLICE_CNTL register which currently
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
177 is not used by driver. But I know only its name ;). Also there
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
178 is difference in slight adjust of BES position but it's configured
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
179 by #ifdef blocks).
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
180
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
181 Please compare:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
182
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
183 (The piece of Back-End Scaler programming)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
184
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
185 Sample for Mach64 compatible chips:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
186 ***********************************
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
187
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
188 #define SPARSE_IO_BASE 0x03fcu
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
189 #define SPARSE_IO_SELECT 0xfc00u
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
190
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
191 #define BLOCK_IO_BASE 0xff00u
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
192 #define BLOCK_IO_SELECT 0x00fcu
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
193
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
194 #define MM_IO_SELECT 0x03fcu
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
195 #define BLOCK_SELECT 0x0400u
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
196 #define DWORD_SELECT (BLOCK_SELECT | MM_IO_SELECT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
197
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
198 #define IO_BYTE_SELECT 0x0003u
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
199
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
200 #define SPARSE_IO_PORT (SPARSE_IO_BASE | IO_BYTE_SELECT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
201 #define BLOCK_IO_PORT (BLOCK_IO_BASE | IO_BYTE_SELECT)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
202
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
203 #define IOPortTag(_SparseIOSelect, _BlockIOSelect) \
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
204 (SetBits(_SparseIOSelect, SPARSE_IO_SELECT) | \
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
205 SetBits(_BlockIOSelect, BLOCK_SELECT | MM_IO_SELECT))
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
206 #define SparseIOTag(_IOSelect) IOPortTag(_IOSelect, 0)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
207 #define BlockIOTag(_IOSelect) IOPortTag(0, _IOSelect)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
208
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
209 ...
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
210
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
211 #define OVERLAY_Y_X_START BlockIOTag(0x100u)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
212 #define OVERLAY_Y_X_END BlockIOTag(0x101u)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
213
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
214 ...
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
215
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
216 #define OUTREG(_Register, _Value) \
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
217 MMIO_OUT32(pATI->pBlock[GetBits(_Register, BLOCK_SELECT)], \
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
218 (_Register) & MM_IO_SELECT, _Value)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
219
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
220 ...
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
221
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
222 OUTREG(OVERLAY_Y_X_START,((drw_x)<<16)|(drw_y)|(1<<31));
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
223 OUTREG(OVERLAY_Y_X_END,((drw_x+drw_w)<<16)|(drw_y+drw_h));
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
224
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
225
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
226 Sample for Rage128 compatible chips:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
227 ************************************
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
228
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
229 #define OV0_Y_X_START 0x0400
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
230 #define OV0_Y_X_END 0x0404
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
231
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
232 ...
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
233
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
234 #define INREG(addr) readl((rage_mmio_base)+addr)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
235 #define OUTREG(addr,val) writel(val, (rage_mmio_base)+addr)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
236
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
237 ...
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
238
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
239 rage_mmio_base = ioremap_nocache(pci_resource_start (dev, 2),RAGE_REGSIZE);
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
240
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
241 ...
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
242
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
243 #ifdef RADEON
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
244 #define X_ADJUST 8
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
245 #else /* rage128 */
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
246 #define X_ADJUST 0
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
247 #endif
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
248
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
249 OUTREG(OV0_Y_X_START,(drw_x+X_ADJUST)|(drw_y<<16));
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
250 OUTREG(OV0_Y_X_END,(drw_x+drw_w+X_ADJUST)|(drw_y+drw_h)<<16));
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
251
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
252 Thus - these chips have almost the same logic from register's name point.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
253 (except the fact that they have swapped 16-bit halfs).
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
254 Yes - programming of Rage128 is much simpler of Mach64.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
255
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
256
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
257 What about other ATI's chips?
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
258 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
259
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
260 I suggest you have latest copy of GATOS-CVS:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
261 http://www.linuxvideo.org
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
262 GATOS was designed and introduced as General ATI TV and Overlay Sowfware.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
263 You will be able to find out there a lots of useful hacking utilities
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
264 (at location gatos-ati/gatos):
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
265 gfxdump - Program for dumping graphics chips registers on Linux and Windows 9X.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
266 (it's more useful for Win9x to hack their values).
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
267 xatitv - For working with tv-in (currently is under hard development)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
268 atitvout- For working with tv-out
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
269 and lot of other stuff.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
270 BUT: After studing of Gatos and X11 stuffs I've found that they are bad
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
271 optimized for movie playback.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
272 Please compare:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
273 radeon_vid - configures video overlay only once and provides DGA to it.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
274 (doesn't require to be MMX optimized)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
275 gatos and X11 - configures video overlay at every slice of frame, then
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
276 performs unoptimized copying of source stuff to video memory
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
277 often with using CopyMungedData (it's C-analog of YV12_to_YUY2)
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
278 since there are lacks in yv12 support.
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
279 (is not MMX optimized that's gladly accepted, but probably
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
280 will be never optimized due portability).
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
281
3473
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
282 hardware IDCT support diagram:
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
283 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
284 |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
285 [ Video parser ] <---------- [ Transport demuxing ] --> [ Audio ]
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
286 | | |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
287 [ Variable length decoder] |D |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
288 | |V |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
289 [ Inverse quantization ] |D |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
290 | | |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
291 -------|---[ video card ]---------+ |s |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
292 | | |u |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
293 [ Run level decode & de-zigzag ] | |b |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
294 | | |p |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
295 [ IDCT ] | |i |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
296 | | |c |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
297 [ Motion compensation ] | |t |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
298 | | |u |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
299 [ Advanced deinterlacing ] | |r |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
300 | | |e |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
301 [ Filtered X-Y scaling ] [SUBPIC]-|-----+s [ OSD ]
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
302 | | | | |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
303 [ 4-bit alpha blending ] <---+ | +-------+
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
304 | |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
305 [ YUV to RGB conversion ] |
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
306 -------|--------------------------+
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
307 TV-screen or CRT-display
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
308
8a46f6a9efd0 Preparing to next acceleration level
nick
parents: 3197
diff changeset
309
3191
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
310 Conslusion:
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
311 ~~~~~~~~~~~
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
312
0a7eac44c808 Just for volunteers
nick
parents:
diff changeset
313 That's all folk!