summaryrefslogtreecommitdiff
path: root/src/nvreg.h
blob: 79d2204d72594f064c00c6acd89321f0837a96d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
/* $XConsortium: nvreg.h /main/2 1996/10/28 05:13:41 kaleb $ */
/*
 * Copyright 1996-1997  David J. McKay
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * DAVID J. MCKAY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nvreg.h,v 1.6 2002/01/25 21:56:06 tsi Exp $ */

#ifndef __NVREG_H_
#define __NVREG_H_

#define NV_PMC_OFFSET               0x00000000
#define NV_PMC_SIZE                 0x00001000

#define NV_PBUS_OFFSET              0x00001000
#define NV_PBUS_SIZE                0x00001000

#define NV_PFIFO_OFFSET             0x00002000
#define NV_PFIFO_SIZE               0x00002000

#define NV_HDIAG_OFFSET             0x00005000
#define NV_HDIAG_SIZE               0x00001000

#define NV_PRAM_OFFSET              0x00006000
#define NV_PRAM_SIZE                0x00001000

#define NV_PVIDEO_OFFSET            0x00008000
#define NV_PVIDEO_SIZE              0x00001000

#define NV_PTIMER_OFFSET            0x00009000
#define NV_PTIMER_SIZE              0x00001000

#define NV_PPM_OFFSET               0x0000A000
#define NV_PPM_SIZE                 0x00001000

#define NV_PVGA_OFFSET              0x000A0000
#define NV_PVGA_SIZE                0x00020000

#define NV_PVIO_OFFSET              0x000C0000
#define NV_PVIO_SIZE                0x00008000

#define NV_PFB_OFFSET               0x00100000
#define NV_PFB_SIZE                 0x00001000

#define NV_PEXTDEV_OFFSET           0x00101000
#define NV_PEXTDEV_SIZE             0x00001000

#define NV_PROM_OFFSET              0x00300000
#define NV_PROM_SIZE                0x00010000

#define NV_PGRAPH_OFFSET            0x00400000
#define NV_PGRAPH_SIZE              0x00010000

#define NV_PCRTC0_OFFSET            0x00600000
#define NV_PCRTC0_SIZE              0x00002000 /* empirical */

#define NV_PCIO0_OFFSET             0x00601000
#define NV_PCIO0_SIZE               0x00002000

#define NV50_PCRTC_OFFSET           0x00610000
#define NV50_PCRTC_SIZE             0x00004000 /* Until a better guess comes along */

#define NV_PRAMDAC0_OFFSET          0x00680000
#define NV_PRAMDAC0_SIZE            0x00002000

#define NV_PDIO0_OFFSET             0x00681000
#define NV_PDIO0_SIZE               0x00002000

/* FIXME one of these is wrong */
#define NV_PRAMIN_OFFSET            0x00710000
#define NV_PRAMIN_SIZE              0x00100000

#define NV_FIFO_OFFSET              0x00800000
#define NV_FIFO_SIZE                0x00800000

/* Nvidia CRTC indexed registers */
/* VGA standard registers: - from Haiku */
#define NV_VGA_CRTCX_HTOTAL		0x00
#define NV_VGA_CRTCX_HDISPE		0x01
#define NV_VGA_CRTCX_HBLANKS		0x02
#define NV_VGA_CRTCX_HBLANKE		0x03
#define NV_VGA_CRTCX_HSYNCS		0x04
#define NV_VGA_CRTCX_HSYNCE		0x05
#define NV_VGA_CRTCX_VTOTAL		0x06
#define NV_VGA_CRTCX_OVERFLOW		0x07
#define NV_VGA_CRTCX_PRROWSCN		0x08
#define NV_VGA_CRTCX_MAXSCLIN		0x09
#define NV_VGA_CRTCX_VGACURSTART	0x0a
#define NV_VGA_CRTCX_VGACUREND		0x0b
#define NV_VGA_CRTCX_FBSTADDH		0x0c
#define NV_VGA_CRTCX_FBSTADDL		0x0d
#define NV_VGA_CRTCX_VSYNCS		0x10
#define NV_VGA_CRTCX_VSYNCE		0x11
#define NV_VGA_CRTCX_VDISPE		0x12
#define NV_VGA_CRTCX_PITCHL		0x13
#define NV_VGA_CRTCX_UNDERLINE		0x14
#define NV_VGA_CRTCX_VBLANKS		0x15
#define NV_VGA_CRTCX_VBLANKE		0x16
#define NV_VGA_CRTCX_MODECTL		0x17
#define NV_VGA_CRTCX_LINECOMP		0x18
/* Extended VGA CRTC registers */
#define NV_VGA_CRTCX_REPAINT0		0x19
#define NV_VGA_CRTCX_REPAINT1		0x1a
#define NV_VGA_CRTCX_FIFO0		0x1b
#define NV_VGA_CRTCX_FIFO1		0x1c
#define NV_VGA_CRTCX_LOCK		0x1f
#define NV_VGA_CRTCX_FIFO_LWM		0x20
#define NV_VGA_CRTCX_BUFFER		0x21
#define NV_VGA_CRTCX_LSR		0x25
#define NV_VGA_CRTCX_26			0x26
#define NV_VGA_CRTCX_27			0x27
#define NV_VGA_CRTCX_PIXEL		0x28
#define NV_VGA_CRTCX_HEB		0x2d
#define NV_VGA_CRTCX_2E			0x2e
#define NV_VGA_CRTCX_CURCTL2		0x2f
#define NV_VGA_CRTCX_CURCTL0		0x30
#define NV_VGA_CRTCX_CURCTL1		0x31
#define NV_VGA_CRTCX_LCD		0x33
#define NV_VGA_CRTCX_INTERLACE		0x39
#define NV_VGA_CRTCX_3B			0x3b
#define NV_VGA_CRTCX_SCRATCH4		0x3c
#define NV_VGA_CRTCX_EXTRA		0x41
#define NV_VGA_CRTCX_43			0x43
#define NV_VGA_CRTCX_OWNER		0x44
#define NV_VGA_CRTCX_45			0x45
#define NV_VGA_CRTCX_SWAPPING		0x46
#define NV_VGA_CRTCX_FIFO_LWM_NV30	0x47
#define NV_VGA_CRTCX_4B			0x4b
#define NV_VGA_CRTCX_FP_HTIMING		0x53
#define NV_VGA_CRTCX_FP_VTIMING		0x54
#define NV_VGA_CRTCX_52			0x52
#define NV_VGA_CRTCX_55			0x55
#define NV_VGA_CRTCX_56			0x56
#define NV_VGA_CRTCX_57			0x57
#define NV_VGA_CRTCX_58			0x58
#define NV_VGA_CRTCX_59			0x59
#define NV_VGA_CRTCX_85			0x85
#define NV_VGA_CRTCX_86			0x86

#define NV_PBUS_PCI_NV_19		0x0000184C
#define NV_PBUS_PCI_NV_20		0x00001850
#	define NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED	(0 << 0)
#	define NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED	(1 << 0)

#define NV_PFIFO_RAMHT			0x00002210

#define NV_PFB_BOOT_0			0x00100000
#define NV_PFB_CFG0			0x00100200
#define NV_PFB_CFG1			0x00100204
#define NV_PFB_020C			0x0010020C
#define NV_PFB_REFCTRL			0x00100210
#	define NV_PFB_REFCTRL_VALID_1			(1 << 31)
#define NV_PFB_PAD			0x0010021C
#	define NV_PFB_PAD_CKE_NORMAL			(1 << 0)
#define NV_PFB_TILE_NV10		0x00100240
#define NV_PFB_TILE_SIZE_NV10		0x00100244
#define NV_PFB_REF			0x001002D0
#	define NV_PFB_REF_CMD_REFRESH			(1 << 0)
#define NV_PFB_PRE			0x001002D4
#	define NV_PFB_PRE_CMD_PRECHARGE			(1 << 0)
#define NV_PFB_CLOSE_PAGE2		0x0010033C
#define NV_PFB_TILE_NV40		0x00100600
#define NV_PFB_TILE_SIZE_NV40		0x00100604

#define NV_PEXTDEV_BOOT_0		0x00101000
#	define NV_PEXTDEV_BOOT_0_STRAP_FP_IFACE_12BIT	(1 << 15)
#define NV_PEXTDEV_BOOT_3		0x0010100c

#define NV_CRTC_INTR_0			0x00600100
#	define NV_CRTC_INTR_VBLANK			(1<<0)
#define NV_CRTC_INTR_EN_0		0x00600140
#define NV_CRTC_START			0x00600800
#define NV_CRTC_CONFIG			0x00600804
#define NV_CRTC_CURSOR_ADDRESS		0x0060080C
#define NV_CRTC_CURSOR_CONFIG		0x00600810
#	define NV_CRTC_CURSOR_CONFIG_ENABLE		(1 << 0)
#	define NV_CRTC_CURSOR_CONFIG_DOUBLE_SCAN	(1 << 4)
#	define NV_CRTC_CURSOR_CONFIG_32BPP		(1 << 12)
#	define NV_CRTC_CURSOR_CONFIG_64PIXELS		(1 << 16)
#	define NV_CRTC_CURSOR_CONFIG_32LINES		(1 << 25)
#	define NV_CRTC_CURSOR_CONFIG_64LINES		(1 << 26)
#	define NV_CRTC_CURSOR_CONFIG_ALPHA_BLEND	(1 << 28)

#define NV_CRTC_GPIO			0x00600818
#define NV_PCRTC_GPIO_EXT		0x0060081c
#define NV_CRTC_0830			0x00600830
#define NV_CRTC_0834			0x00600834
#define NV_CRTC_0850			0x00600850
#define NV_CRTC_FSEL			0x00600860
#	define NV_CRTC_FSEL_I2C				(1<<4)
#	define NV_CRTC_FSEL_TVOUT1			(1<<8)
#	define NV_CRTC_FSEL_TVOUT2			(2<<8)
#	define NV_CRTC_FSEL_OVERLAY			(1<<12)
#	define NV_CRTC_FSEL_FPP2			(1<<16)
#	define NV_CRTC_FSEL_FPP1			(2<<16)

#define NV_RAMDAC_CURSOR_POS		0x00680300
#define NV_RAMDAC_CURSOR_CTRL		0x00680320
#define NV_RAMDAC_CURSOR_DATA_LO	0x00680324
#define NV_RAMDAC_CURSOR_DATA_HI	0x00680328
#define NV_RAMDAC_NV10_CURSYNC		0x00680404

#define NV_RAMDAC_NVPLL			0x00680500
#define NV_RAMDAC_MPLL			0x00680504
#define NV_RAMDAC_VPLL			0x00680508
#	define NV_RAMDAC_PLL_COEFF_MDIV			0x000000FF
#	define NV_RAMDAC_PLL_COEFF_NDIV			0x0000FF00
#	define NV_RAMDAC_PLL_COEFF_PDIV			0x00070000
#	define NV30_RAMDAC_ENABLE_VCO2			(1 << 7)

#define NV_RAMDAC_PLL_SELECT		0x0068050c
/* Without this it will use vpll1 */
/* Maybe only for nv4x */
#	define NV_RAMDAC_PLL_SELECT_USE_VPLL2_FALSE	(0<<2)
#	define NV_RAMDAC_PLL_SELECT_USE_VPLL2_TRUE	(1<<2)
#	define NV_RAMDAC_PLL_SELECT_DLL_BYPASS		(1<<4)
#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_DEFAULT	(0<<8)
#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_MPLL	(1<<8)
#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_VPLL	(2<<8)
#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_NVPLL	(4<<8)
#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_ALL	(7<<8)
/* Does this name make sense? */
#	define NV_RAMDAC_PLL_SELECT_PLL_SOURCE_VPLL2	(1<<11)
#	define NV_RAMDAC_PLL_SELECT_MPLL_BYPASS_FALSE	(0<<12)
#	define NV_RAMDAC_PLL_SELECT_MPLL_BYPASS_TRUE	(1<<12)
#	define NV_RAMDAC_PLL_SELECT_VS_PCLK_TV_NONE	(0<<16)
#	define NV_RAMDAC_PLL_SELECT_VS_PCLK_TV_VSCLK	(1<<16)
#	define NV_RAMDAC_PLL_SELECT_VS_PCLK_TV_PCLK	(2<<16)
#	define NV_RAMDAC_PLL_SELECT_VS_PCLK_TV_BOTH	(3<<16)
#	define NV_RAMDAC_PLL_SELECT_TVCLK_SOURCE_EXT	(0<<20)
#	define NV_RAMDAC_PLL_SELECT_TVCLK_SOURCE_VIP	(1<<20)
#	define NV_RAMDAC_PLL_SELECT_TVCLK_RATIO_DB1	(0<<24)
#	define NV_RAMDAC_PLL_SELECT_TVCLK_RATIO_DB2	(1<<24)
#	define NV_RAMDAC_PLL_SELECT_VCLK_RATIO_DB1	(0<<28)
#	define NV_RAMDAC_PLL_SELECT_VCLK_RATIO_DB2	(1<<28)
#	define NV_RAMDAC_PLL_SELECT_VCLK2_RATIO_DB1	(0<<29)
#	define NV_RAMDAC_PLL_SELECT_VCLK2_RATIO_DB2	(1<<29)

#define NV_RAMDAC_PLL_SETUP_CONTROL	0x00680510
#define NV_RAMDAC_PLL_TEST_COUNTER	0x00680514
#define NV_RAMDAC_PALETTE_TEST		0x00680518
#define NV_RAMDAC_VPLL2			0x00680520
#define NV_RAMDAC_SEL_CLK		0x00680524
#define NV_RAMDAC_DITHER_NV11		0x00680528
#define NV_RAMDAC_OUTPUT		0x0068052c
#	define NV_RAMDAC_OUTPUT_DAC_ENABLE		(1<<0)
#	define NV_RAMDAC_OUTPUT_SELECT_CRTC1		(1<<8)

#define NV_RAMDAC_NVPLL_B		0x00680570
#define NV_RAMDAC_MPLL_B		0x00680574
#define NV_RAMDAC_VPLL_B		0x00680578
#define NV_RAMDAC_VPLL2_B		0x0068057c
/* Educated guess, should remain on for NV4x vpll's. */
#	define NV31_RAMDAC_ENABLE_VCO2			(1 << 31)

#define NV_RAMDAC_580			0x00680580
/* This is not always activated, but only when VCLK_RATIO_DB1 is used */
#	define NV_RAMDAC_580_VPLL1_ACTIVE		(1<<8)
#	define NV_RAMDAC_580_VPLL2_ACTIVE		(1<<28)

#define NV_RAMDAC_594			0x00680594
#define NV_RAMDAC_GENERAL_CONTROL	0x00680600
#define NV_RAMDAC_TEST_CONTROL		0x00680608
#define NV_RAMDAC_TEST_DATA		0x00680610
/* This register is similar to TEST_CONTROL in the style of values */
#define NV_RAMDAC_670			0x00680670

#define NV_RAMDAC_TV_SETUP		0x00680700
#define NV_RAMDAC_TV_VBLANK_START	0x00680704
#define NV_RAMDAC_TV_VBLANK_END		0x00680708
#define NV_RAMDAC_TV_HBLANK_START	0x0068070c
#define NV_RAMDAC_TV_HBLANK_END		0x00680710
#define NV_RAMDAC_TV_BLANK_COLOR	0x00680714
#define NV_RAMDAC_TV_VTOTAL		0x00680720
#define NV_RAMDAC_TV_VSYNC_START	0x00680724
#define NV_RAMDAC_TV_VSYNC_END		0x00680728
#define NV_RAMDAC_TV_HTOTAL		0x0068072c
#define NV_RAMDAC_TV_HSYNC_START	0x00680730
#define NV_RAMDAC_TV_HSYNC_END		0x00680734
#define NV_RAMDAC_TV_SYNC_DELAY		0x00680738

#define REG_DISP_END 0
#define REG_DISP_TOTAL 1
#define REG_DISP_CRTC 2
#define REG_DISP_SYNC_START 3
#define REG_DISP_SYNC_END 4
#define REG_DISP_VALID_START 5
#define REG_DISP_VALID_END 6

#define NV_RAMDAC_FP_VDISP_END		0x00680800
#define NV_RAMDAC_FP_VTOTAL		0x00680804
#define NV_RAMDAC_FP_VCRTC		0x00680808
#define NV_RAMDAC_FP_VSYNC_START	0x0068080c
#define NV_RAMDAC_FP_VSYNC_END		0x00680810
#define NV_RAMDAC_FP_VVALID_START	0x00680814
#define NV_RAMDAC_FP_VVALID_END		0x00680818
#define NV_RAMDAC_FP_HDISP_END		0x00680820
#define NV_RAMDAC_FP_HTOTAL		0x00680824
#define NV_RAMDAC_FP_HCRTC		0x00680828
#define NV_RAMDAC_FP_HSYNC_START	0x0068082c
#define NV_RAMDAC_FP_HSYNC_END		0x00680830
#define NV_RAMDAC_FP_HVALID_START	0x00680834
#define NV_RAMDAC_FP_HVALID_END		0x00680838

#define NV_RAMDAC_FP_DITHER		0x0068083c
#define NV_RAMDAC_FP_CHECKSUM		0x00680840
#define NV_RAMDAC_FP_TEST_CONTROL	0x00680844
#define NV_RAMDAC_FP_CONTROL		0x00680848
#	define NV_RAMDAC_FP_CONTROL_VSYNC_NEG		(0 << 0)
#	define NV_RAMDAC_FP_CONTROL_VSYNC_POS		(1 << 0)
#	define NV_RAMDAC_FP_CONTROL_VSYNC_DISABLE	(2 << 0)
#	define NV_RAMDAC_FP_CONTROL_HSYNC_NEG		(0 << 4)
#	define NV_RAMDAC_FP_CONTROL_HSYNC_POS		(1 << 4)
#	define NV_RAMDAC_FP_CONTROL_HSYNC_DISABLE	(2 << 4)
#	define NV_RAMDAC_FP_CONTROL_MODE_SCALE		(0 << 8)
#	define NV_RAMDAC_FP_CONTROL_MODE_CENTER		(1 << 8)
#	define NV_RAMDAC_FP_CONTROL_MODE_NATIVE		(2 << 8)
#	define NV_PRAMDAC_FP_TG_CONTROL_WIDTH_12	(1 << 24)
#	define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_POS	(1 << 28)
#	define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_DISABLE	(2 << 28)
#define NV_RAMDAC_FP_850		0x00680850
#define NV_RAMDAC_FP_85C		0x0068085c

#define NV_RAMDAC_FP_DEBUG_0		0x00680880
#	define NV_RAMDAC_FP_DEBUG_0_XSCALE_ENABLED	(1 << 0)
#	define NV_RAMDAC_FP_DEBUG_0_YSCALE_ENABLED	(1 << 4)
/* This doesn't seem to be essential for tmds, but still often set */
#	define NV_RAMDAC_FP_DEBUG_0_TMDS_ENABLED	(1 << 7)
#	define NV_RAMDAC_FP_DEBUG_0_PWRDOWN_FPCLK	(1 << 28)
#	define NV_RAMDAC_FP_DEBUG_0_PWRDOWN_TMDS_PLL	(2 << 28)
#	define NV_RAMDAC_FP_DEBUG_0_PWRDOWN_BOTH	(3 << 28)
#define NV_RAMDAC_FP_DEBUG_1		0x00680884
#define NV_RAMDAC_FP_DEBUG_2		0x00680888
#define NV_RAMDAC_FP_DEBUG_3		0x0068088C

/* Some unknown regs, purely for NV30 it seems. */
#define NV30_RAMDAC_890			0x00680890
#define NV30_RAMDAC_894			0x00680894
#define NV30_RAMDAC_89C			0x0068089C

#define NV_RAMDAC_FP_TMDS_CONTROL	0x006808b0
#	define NV_RAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE	(1<<16)
#define NV_RAMDAC_FP_TMDS_DATA		0x006808b4
#define NV_RAMDAC_FP_TMDS_CONTROL_2	0x006808b8
#	define NV_RAMDAC_FP_TMDS_CONTROL_2_WRITE_DISABLE	(1<<16)
#define NV_RAMDAC_FP_TMDS_DATA_2	0x006808bc

/* Some kind of switch */
#define NV_RAMDAC_900			0x00680900
#define NV_RAMDAC_A20			0x00680A20
#define NV_RAMDAC_A24			0x00680A24
#define NV_RAMDAC_A34			0x00680A34

#define NV_PGRAPH_DEBUG_0		0x00400080
#define NV_PGRAPH_DEBUG_1		0x00400084
#define NV_PGRAPH_DEBUG_2_NV04		0x00400088
#define NV_PGRAPH_DEBUG_2		0x00400620
#define NV_PGRAPH_DEBUG_3		0x0040008c
#define NV_PGRAPH_DEBUG_4		0x00400090
#define NV_PGRAPH_INTR			0x00400100
#define NV_PGRAPH_INTR_EN		0x00400140
#define NV_PGRAPH_CTX_CONTROL		0x00400144
#define NV_PGRAPH_CTX_CONTROL_NV04	0x00400170
#define NV_PGRAPH_ABS_UCLIP_XMIN	0x0040053C
#define NV_PGRAPH_ABS_UCLIP_YMIN	0x00400540
#define NV_PGRAPH_ABS_UCLIP_XMAX	0x00400544
#define NV_PGRAPH_ABS_UCLIP_YMAX	0x00400548
#define NV_PGRAPH_BETA_AND		0x00400608
#define NV_PGRAPH_LIMIT_VIOL_PIX	0x00400610
#define NV_PGRAPH_BOFFSET0		0x00400640
#define NV_PGRAPH_BOFFSET1		0x00400644
#define NV_PGRAPH_BOFFSET2		0x00400648
#define NV_PGRAPH_BLIMIT0		0x00400684
#define NV_PGRAPH_BLIMIT1		0x00400688
#define NV_PGRAPH_BLIMIT2		0x0040068c
#define NV_PGRAPH_STATUS		0x00400700
#define NV_PGRAPH_SURFACE		0x00400710
#define NV_PGRAPH_STATE			0x00400714
#define NV_PGRAPH_FIFO			0x00400720
#define NV_PGRAPH_PATTERN_SHAPE		0x00400810
#define NV_PGRAPH_TILE			0x00400b00

#define NV_PVIDEO_INTR_EN		0x00008140
#define NV_PVIDEO_BUFFER		0x00008700
#define NV_PVIDEO_STOP			0x00008704
#define NV_PVIDEO_UVPLANE_BASE(buff)	(0x00008800+(buff)*4)
#define NV_PVIDEO_UVPLANE_LIMIT(buff)	(0x00008808+(buff)*4)
#define NV_PVIDEO_UVPLANE_OFFSET_BUFF(buff)	(0x00008820+(buff)*4)
#define NV_PVIDEO_BASE(buff)		(0x00008900+(buff)*4)
#define NV_PVIDEO_LIMIT(buff)		(0x00008908+(buff)*4)
#define NV_PVIDEO_LUMINANCE(buff)	(0x00008910+(buff)*4)
#define NV_PVIDEO_CHROMINANCE(buff)	(0x00008918+(buff)*4)
#define NV_PVIDEO_OFFSET_BUFF(buff)	(0x00008920+(buff)*4)
#define NV_PVIDEO_SIZE_IN(buff)		(0x00008928+(buff)*4)
#define NV_PVIDEO_POINT_IN(buff)	(0x00008930+(buff)*4)
#define NV_PVIDEO_DS_DX(buff)		(0x00008938+(buff)*4)
#define NV_PVIDEO_DT_DY(buff)		(0x00008940+(buff)*4)
#define NV_PVIDEO_POINT_OUT(buff)	(0x00008948+(buff)*4)
#define NV_PVIDEO_SIZE_OUT(buff)	(0x00008950+(buff)*4)
#define NV_PVIDEO_FORMAT(buff)		(0x00008958+(buff)*4)
#	define NV_PVIDEO_FORMAT_PLANAR			(1 << 0)
#	define NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8	(1 << 16)
#	define NV_PVIDEO_FORMAT_DISPLAY_COLOR_KEY	(1 << 20)
#	define NV_PVIDEO_FORMAT_MATRIX_ITURBT709	(1 << 24)
#define NV_PVIDEO_COLOR_KEY		0x00008B00

/* NV04 overlay defines from VIDIX & Haiku */
#define NV_PVIDEO_INTR_EN_0		0x00680140
#define NV_PVIDEO_STEP_SIZE		0x00680200
#define NV_PVIDEO_CONTROL_Y		0x00680204
#define NV_PVIDEO_CONTROL_X		0x00680208
#define NV_PVIDEO_BUFF0_START_ADDRESS	0x0068020c
#define NV_PVIDEO_BUFF0_PITCH_LENGTH	0x00680214
#define NV_PVIDEO_BUFF0_OFFSET		0x0068021c
#define NV_PVIDEO_BUFF1_START_ADDRESS	0x00680210
#define NV_PVIDEO_BUFF1_PITCH_LENGTH	0x00680218
#define NV_PVIDEO_BUFF1_OFFSET		0x00680220
#define NV_PVIDEO_OE_STATE		0x00680224
#define NV_PVIDEO_SU_STATE		0x00680228
#define NV_PVIDEO_RM_STATE		0x0068022c
#define NV_PVIDEO_WINDOW_START		0x00680230
#define NV_PVIDEO_WINDOW_SIZE		0x00680234
#define NV_PVIDEO_FIFO_THRES_SIZE	0x00680238
#define NV_PVIDEO_FIFO_BURST_LENGTH	0x0068023c
#define NV_PVIDEO_KEY			0x00680240
#define NV_PVIDEO_OVERLAY		0x00680244
#define NV_PVIDEO_RED_CSC_OFFSET	0x00680280
#define NV_PVIDEO_GREEN_CSC_OFFSET	0x00680284
#define NV_PVIDEO_BLUE_CSC_OFFSET	0x00680288
#define NV_PVIDEO_CSC_ADJUST		0x0068028c

/* These are the real registers, not the redirected ones */
#define NV40_VCLK1_A			0x4010
#define NV40_VCLK1_B			0x4014
#define NV40_VCLK2_A			0x4018
#define NV40_VCLK2_B			0x401c

#endif