nvreg.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. /* $XConsortium: nvreg.h /main/2 1996/10/28 05:13:41 kaleb $ */
  2. /*
  3. * Copyright 1996-1997 David J. McKay
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the "Software"),
  7. * to deal in the Software without restriction, including without limitation
  8. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. * and/or sell copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * DAVID J. MCKAY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  19. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  20. * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nv/nvreg.h,v 1.6 2002/01/25 21:56:06 tsi Exp $ */
  24. #ifndef __NVREG_H_
  25. #define __NVREG_H_
  26. #define NV_PMC_OFFSET 0x00000000
  27. #define NV_PMC_SIZE 0x00001000
  28. #define NV_PBUS_OFFSET 0x00001000
  29. #define NV_PBUS_SIZE 0x00001000
  30. #define NV_PFIFO_OFFSET 0x00002000
  31. #define NV_PFIFO_SIZE 0x00002000
  32. #define NV_HDIAG_OFFSET 0x00005000
  33. #define NV_HDIAG_SIZE 0x00001000
  34. #define NV_PRAM_OFFSET 0x00006000
  35. #define NV_PRAM_SIZE 0x00001000
  36. #define NV_PVIDEO_OFFSET 0x00008000
  37. #define NV_PVIDEO_SIZE 0x00001000
  38. #define NV_PTIMER_OFFSET 0x00009000
  39. #define NV_PTIMER_SIZE 0x00001000
  40. #define NV_PPM_OFFSET 0x0000A000
  41. #define NV_PPM_SIZE 0x00001000
  42. #define NV_PTV_OFFSET 0x0000D000
  43. #define NV_PTV_SIZE 0x00001000
  44. #define NV_PRMVGA_OFFSET 0x000A0000
  45. #define NV_PRMVGA_SIZE 0x00020000
  46. #define NV_PRMVIO0_OFFSET 0x000C0000
  47. #define NV_PRMVIO_SIZE 0x00002000
  48. #define NV_PRMVIO1_OFFSET 0x000C2000
  49. #define NV_PFB_OFFSET 0x00100000
  50. #define NV_PFB_SIZE 0x00001000
  51. #define NV_PEXTDEV_OFFSET 0x00101000
  52. #define NV_PEXTDEV_SIZE 0x00001000
  53. #define NV_PME_OFFSET 0x00200000
  54. #define NV_PME_SIZE 0x00001000
  55. #define NV_PROM_OFFSET 0x00300000
  56. #define NV_PROM_SIZE 0x00010000
  57. #define NV_PGRAPH_OFFSET 0x00400000
  58. #define NV_PGRAPH_SIZE 0x00010000
  59. #define NV_PCRTC0_OFFSET 0x00600000
  60. #define NV_PCRTC0_SIZE 0x00002000 /* empirical */
  61. #define NV_PRMCIO0_OFFSET 0x00601000
  62. #define NV_PRMCIO_SIZE 0x00002000
  63. #define NV_PRMCIO1_OFFSET 0x00603000
  64. #define NV50_DISPLAY_OFFSET 0x00610000
  65. #define NV50_DISPLAY_SIZE 0x0000FFFF
  66. #define NV_PRAMDAC0_OFFSET 0x00680000
  67. #define NV_PRAMDAC0_SIZE 0x00002000
  68. #define NV_PRMDIO0_OFFSET 0x00681000
  69. #define NV_PRMDIO_SIZE 0x00002000
  70. #define NV_PRMDIO1_OFFSET 0x00683000
  71. #define NV_PRAMIN_OFFSET 0x00700000
  72. #define NV_PRAMIN_SIZE 0x00100000
  73. #define NV_FIFO_OFFSET 0x00800000
  74. #define NV_FIFO_SIZE 0x00800000
  75. #define NV_PMC_BOOT_0 0x00000000
  76. #define NV_PMC_ENABLE 0x00000200
  77. #define NV_VIO_VSE2 0x000003c3
  78. #define NV_VIO_SRX 0x000003c4
  79. #define NV_CIO_CRX__COLOR 0x000003d4
  80. #define NV_CIO_CR__COLOR 0x000003d5
  81. #define NV_PBUS_DEBUG_1 0x00001084
  82. #define NV_PBUS_DEBUG_4 0x00001098
  83. #define NV_PBUS_DEBUG_DUALHEAD_CTL 0x000010f0
  84. #define NV_PBUS_POWERCTRL_1 0x00001584
  85. #define NV_PBUS_POWERCTRL_2 0x00001588
  86. #define NV_PBUS_POWERCTRL_4 0x00001590
  87. #define NV_PBUS_PCI_NV_19 0x0000184C
  88. #define NV_PBUS_PCI_NV_20 0x00001850
  89. # define NV_PBUS_PCI_NV_20_ROM_SHADOW_DISABLED (0 << 0)
  90. # define NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED (1 << 0)
  91. #define NV_PFIFO_RAMHT 0x00002210
  92. #define NV_PTV_TV_INDEX 0x0000d220
  93. #define NV_PTV_TV_DATA 0x0000d224
  94. #define NV_PTV_HFILTER 0x0000d310
  95. #define NV_PTV_HFILTER2 0x0000d390
  96. #define NV_PTV_VFILTER 0x0000d510
  97. #define NV_PRMVIO_MISC__WRITE 0x000c03c2
  98. #define NV_PRMVIO_SRX 0x000c03c4
  99. #define NV_PRMVIO_SR 0x000c03c5
  100. # define NV_VIO_SR_RESET_INDEX 0x00
  101. # define NV_VIO_SR_CLOCK_INDEX 0x01
  102. # define NV_VIO_SR_PLANE_MASK_INDEX 0x02
  103. # define NV_VIO_SR_CHAR_MAP_INDEX 0x03
  104. # define NV_VIO_SR_MEM_MODE_INDEX 0x04
  105. #define NV_PRMVIO_MISC__READ 0x000c03cc
  106. #define NV_PRMVIO_GRX 0x000c03ce
  107. #define NV_PRMVIO_GX 0x000c03cf
  108. # define NV_VIO_GX_SR_INDEX 0x00
  109. # define NV_VIO_GX_SREN_INDEX 0x01
  110. # define NV_VIO_GX_CCOMP_INDEX 0x02
  111. # define NV_VIO_GX_ROP_INDEX 0x03
  112. # define NV_VIO_GX_READ_MAP_INDEX 0x04
  113. # define NV_VIO_GX_MODE_INDEX 0x05
  114. # define NV_VIO_GX_MISC_INDEX 0x06
  115. # define NV_VIO_GX_DONT_CARE_INDEX 0x07
  116. # define NV_VIO_GX_BIT_MASK_INDEX 0x08
  117. #define NV_PCRTC_INTR_0 0x00600100
  118. # define NV_PCRTC_INTR_0_VBLANK (1 << 0)
  119. #define NV_PCRTC_INTR_EN_0 0x00600140
  120. #define NV_PCRTC_START 0x00600800
  121. #define NV_PCRTC_CONFIG 0x00600804
  122. # define NV_PCRTC_CONFIG_START_ADDRESS_NON_VGA (1 << 0)
  123. # define NV04_PCRTC_CONFIG_START_ADDRESS_HSYNC (4 << 0)
  124. # define NV10_PCRTC_CONFIG_START_ADDRESS_HSYNC (2 << 0)
  125. #define NV_PCRTC_CURSOR_CONFIG 0x00600810
  126. # define NV_PCRTC_CURSOR_CONFIG_ENABLE_ENABLE (1 << 0)
  127. # define NV_PCRTC_CURSOR_CONFIG_DOUBLE_SCAN_ENABLE (1 << 4)
  128. # define NV_PCRTC_CURSOR_CONFIG_ADDRESS_SPACE_PNVM (1 << 8)
  129. # define NV_PCRTC_CURSOR_CONFIG_CUR_BPP_32 (1 << 12)
  130. # define NV_PCRTC_CURSOR_CONFIG_CUR_PIXELS_64 (1 << 16)
  131. # define NV_PCRTC_CURSOR_CONFIG_CUR_LINES_32 (2 << 24)
  132. # define NV_PCRTC_CURSOR_CONFIG_CUR_LINES_64 (4 << 24)
  133. # define NV_PCRTC_CURSOR_CONFIG_CUR_BLEND_ALPHA (1 << 28)
  134. /* note: PCRTC_GPIO is not available on nv10, and in fact aliases 0x600810 */
  135. #define NV_PCRTC_GPIO 0x00600818
  136. #define NV_PCRTC_GPIO_EXT 0x0060081c
  137. #define NV_PCRTC_830 0x00600830
  138. #define NV_PCRTC_834 0x00600834
  139. #define NV_PCRTC_850 0x00600850
  140. #define NV_PCRTC_ENGINE_CTRL 0x00600860
  141. # define NV_CRTC_FSEL_I2C (1 << 4)
  142. # define NV_CRTC_FSEL_OVERLAY (1 << 12)
  143. #define NV_PRMCIO_ARX 0x006013c0
  144. #define NV_PRMCIO_AR__WRITE 0x006013c0
  145. #define NV_PRMCIO_AR__READ 0x006013c1
  146. # define NV_CIO_AR_MODE_INDEX 0x10
  147. # define NV_CIO_AR_OSCAN_INDEX 0x11
  148. # define NV_CIO_AR_PLANE_INDEX 0x12
  149. # define NV_CIO_AR_HPP_INDEX 0x13
  150. # define NV_CIO_AR_CSEL_INDEX 0x14
  151. #define NV_PRMCIO_INP0 0x006013c2
  152. #define NV_PRMCIO_CRX__COLOR 0x006013d4
  153. #define NV_PRMCIO_CR__COLOR 0x006013d5
  154. /* Standard VGA CRTC registers */
  155. # define NV_CIO_CR_HDT_INDEX 0x00 /* horizontal display total */
  156. # define NV_CIO_CR_HDE_INDEX 0x01 /* horizontal display end */
  157. # define NV_CIO_CR_HBS_INDEX 0x02 /* horizontal blanking start */
  158. # define NV_CIO_CR_HBE_INDEX 0x03 /* horizontal blanking end */
  159. # define NV_CIO_CR_HBE_4_0 4:0
  160. # define NV_CIO_CR_HRS_INDEX 0x04 /* horizontal retrace start */
  161. # define NV_CIO_CR_HRE_INDEX 0x05 /* horizontal retrace end */
  162. # define NV_CIO_CR_HRE_4_0 4:0
  163. # define NV_CIO_CR_HRE_HBE_5 7:7
  164. # define NV_CIO_CR_VDT_INDEX 0x06 /* vertical display total */
  165. # define NV_CIO_CR_OVL_INDEX 0x07 /* overflow bits */
  166. # define NV_CIO_CR_OVL_VDT_8 0:0
  167. # define NV_CIO_CR_OVL_VDE_8 1:1
  168. # define NV_CIO_CR_OVL_VRS_8 2:2
  169. # define NV_CIO_CR_OVL_VBS_8 3:3
  170. # define NV_CIO_CR_OVL_VDT_9 5:5
  171. # define NV_CIO_CR_OVL_VDE_9 6:6
  172. # define NV_CIO_CR_OVL_VRS_9 7:7
  173. # define NV_CIO_CR_RSAL_INDEX 0x08 /* normally "preset row scan" */
  174. # define NV_CIO_CR_CELL_HT_INDEX 0x09 /* cell height?! normally "max scan line" */
  175. # define NV_CIO_CR_CELL_HT_VBS_9 5:5
  176. # define NV_CIO_CR_CELL_HT_SCANDBL 7:7
  177. # define NV_CIO_CR_CURS_ST_INDEX 0x0a /* cursor start */
  178. # define NV_CIO_CR_CURS_END_INDEX 0x0b /* cursor end */
  179. # define NV_CIO_CR_SA_HI_INDEX 0x0c /* screen start address high */
  180. # define NV_CIO_CR_SA_LO_INDEX 0x0d /* screen start address low */
  181. # define NV_CIO_CR_TCOFF_HI_INDEX 0x0e /* cursor offset high */
  182. # define NV_CIO_CR_TCOFF_LO_INDEX 0x0f /* cursor offset low */
  183. # define NV_CIO_CR_VRS_INDEX 0x10 /* vertical retrace start */
  184. # define NV_CIO_CR_VRE_INDEX 0x11 /* vertical retrace end */
  185. # define NV_CIO_CR_VRE_3_0 3:0
  186. # define NV_CIO_CR_VDE_INDEX 0x12 /* vertical display end */
  187. # define NV_CIO_CR_OFFSET_INDEX 0x13 /* sets screen pitch */
  188. # define NV_CIO_CR_ULINE_INDEX 0x14 /* underline location */
  189. # define NV_CIO_CR_VBS_INDEX 0x15 /* vertical blank start */
  190. # define NV_CIO_CR_VBE_INDEX 0x16 /* vertical blank end */
  191. # define NV_CIO_CR_MODE_INDEX 0x17 /* crtc mode control */
  192. # define NV_CIO_CR_LCOMP_INDEX 0x18 /* line compare */
  193. /* Extended VGA CRTC registers */
  194. # define NV_CIO_CRE_RPC0_INDEX 0x19 /* repaint control 0 */
  195. # define NV_CIO_CRE_RPC0_OFFSET_10_8 7:5
  196. # define NV_CIO_CRE_RPC1_INDEX 0x1a /* repaint control 1 */
  197. # define NV_CIO_CRE_RPC1_LARGE 2:2
  198. # define NV_CIO_CRE_FF_INDEX 0x1b /* fifo control */
  199. # define NV_CIO_CRE_ENH_INDEX 0x1c /* enhanced? */
  200. # define NV_CIO_SR_LOCK_INDEX 0x1f /* crtc lock */
  201. # define NV_CIO_SR_UNLOCK_RW_VALUE 0x57
  202. # define NV_CIO_SR_LOCK_VALUE 0x99
  203. # define NV_CIO_CRE_FFLWM__INDEX 0x20 /* fifo low water mark */
  204. # define NV_CIO_CRE_21 0x21 /* vga shadow crtc lock */
  205. # define NV_CIO_CRE_LSR_INDEX 0x25 /* ? */
  206. # define NV_CIO_CRE_LSR_VDT_10 0:0
  207. # define NV_CIO_CRE_LSR_VDE_10 1:1
  208. # define NV_CIO_CRE_LSR_VRS_10 2:2
  209. # define NV_CIO_CRE_LSR_VBS_10 3:3
  210. # define NV_CIO_CRE_LSR_HBE_6 4:4
  211. # define NV_CIO_CR_ARX_INDEX 0x26 /* attribute index -- ro copy of 0x60.3c0 */
  212. # define NV_CIO_CRE_CHIP_ID_INDEX 0x27 /* chip revision */
  213. # define NV_CIO_CRE_PIXEL_INDEX 0x28
  214. # define NV_CIO_CRE_PIXEL_FORMAT 1:0
  215. # define NV_CIO_CRE_HEB__INDEX 0x2d /* horizontal extra bits? */
  216. # define NV_CIO_CRE_HEB_HDT_8 0:0
  217. # define NV_CIO_CRE_HEB_HDE_8 1:1
  218. # define NV_CIO_CRE_HEB_HBS_8 2:2
  219. # define NV_CIO_CRE_HEB_HRS_8 3:3
  220. # define NV_CIO_CRE_HEB_ILC_8 4:4
  221. # define NV_CIO_CRE_2E 0x2e /* some scratch or dummy reg to force writes to sink in */
  222. # define NV_CIO_CRE_HCUR_ADDR2_INDEX 0x2f /* cursor */
  223. # define NV_CIO_CRE_HCUR_ADDR0_INDEX 0x30 /* pixmap */
  224. # define NV_CIO_CRE_HCUR_ADDR0_ADR 6:0
  225. # define NV_CIO_CRE_HCUR_ASI 7:7
  226. # define NV_CIO_CRE_HCUR_ADDR1_INDEX 0x31 /* address */
  227. # define NV_CIO_CRE_HCUR_ADDR1_ENABLE 0:0
  228. # define NV_CIO_CRE_HCUR_ADDR1_CUR_DBL 1:1
  229. # define NV_CIO_CRE_HCUR_ADDR1_ADR 7:2
  230. # define NV_CIO_CRE_LCD__INDEX 0x33
  231. # define NV_CIO_CRE_LCD_LCD_SELECT 0:0
  232. # define NV_CIO_CRE_LCD_ROUTE_MASK 0x3b
  233. # define NV_CIO_CRE_DDC0_STATUS__INDEX 0x36
  234. # define NV_CIO_CRE_DDC0_WR__INDEX 0x37
  235. # define NV_CIO_CRE_ILACE__INDEX 0x39 /* interlace */
  236. # define NV_CIO_CRE_SCRATCH3__INDEX 0x3b
  237. # define NV_CIO_CRE_SCRATCH4__INDEX 0x3c
  238. # define NV_CIO_CRE_DDC_STATUS__INDEX 0x3e
  239. # define NV_CIO_CRE_DDC_WR__INDEX 0x3f
  240. # define NV_CIO_CRE_EBR_INDEX 0x41 /* extra bits ? (vertical) */
  241. # define NV_CIO_CRE_EBR_VDT_11 0:0
  242. # define NV_CIO_CRE_EBR_VDE_11 2:2
  243. # define NV_CIO_CRE_EBR_VRS_11 4:4
  244. # define NV_CIO_CRE_EBR_VBS_11 6:6
  245. # define NV_CIO_CRE_42 0x42
  246. # define NV_CIO_CRE_42_OFFSET_11 6:6
  247. # define NV_CIO_CRE_43 0x43
  248. # define NV_CIO_CRE_44 0x44 /* head control */
  249. # define NV_CIO_CRE_CSB 0x45 /* colour saturation boost */
  250. # define NV_CIO_CRE_RCR 0x46
  251. # define NV_CIO_CRE_RCR_ENDIAN_BIG 7:7
  252. # define NV_CIO_CRE_47 0x47 /* extended fifo lwm, used on nv30+ */
  253. # define NV_CIO_CRE_49 0x49
  254. # define NV_CIO_CRE_4B 0x4b /* given patterns in 0x[2-3][a-c] regs, probably scratch 6 */
  255. # define NV_CIO_CRE_TVOUT_LATENCY 0x52
  256. # define NV_CIO_CRE_53 0x53 /* `fp_htiming' according to Haiku */
  257. # define NV_CIO_CRE_54 0x54 /* `fp_vtiming' according to Haiku */
  258. # define NV_CIO_CRE_57 0x57 /* index reg for cr58 */
  259. # define NV_CIO_CRE_58 0x58 /* data reg for cr57 */
  260. # define NV_CIO_CRE_59 0x59 /* related to on/off-chip-ness of digital outputs */
  261. # define NV_CIO_CRE_5B 0x5B /* newer colour saturation reg */
  262. # define NV_CIO_CRE_85 0x85
  263. # define NV_CIO_CRE_86 0x86
  264. #define NV_PRMCIO_INP0__COLOR 0x006013da
  265. #define NV_PRAMDAC_CU_START_POS 0x00680300
  266. # define NV_PRAMDAC_CU_START_POS_X 15:0
  267. # define NV_PRAMDAC_CU_START_POS_Y 31:16
  268. #define NV_RAMDAC_NV10_CURSYNC 0x00680404
  269. #define NV_PRAMDAC_NVPLL_COEFF 0x00680500
  270. #define NV_PRAMDAC_MPLL_COEFF 0x00680504
  271. #define NV_PRAMDAC_VPLL_COEFF 0x00680508
  272. # define NV30_RAMDAC_ENABLE_VCO2 (8 << 4)
  273. #define NV_PRAMDAC_PLL_COEFF_SELECT 0x0068050c
  274. # define NV_PRAMDAC_PLL_COEFF_SELECT_USE_VPLL2_TRUE (4 << 0)
  275. # define NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_MPLL (1 << 8)
  276. # define NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_VPLL (2 << 8)
  277. # define NV_PRAMDAC_PLL_COEFF_SELECT_SOURCE_PROG_NVPLL (4 << 8)
  278. # define NV_PRAMDAC_PLL_COEFF_SELECT_PLL_SOURCE_VPLL2 (8 << 8)
  279. # define NV_PRAMDAC_PLL_COEFF_SELECT_TV_VSCLK1 (1 << 16)
  280. # define NV_PRAMDAC_PLL_COEFF_SELECT_TV_PCLK1 (2 << 16)
  281. # define NV_PRAMDAC_PLL_COEFF_SELECT_TV_VSCLK2 (4 << 16)
  282. # define NV_PRAMDAC_PLL_COEFF_SELECT_TV_PCLK2 (8 << 16)
  283. # define NV_PRAMDAC_PLL_COEFF_SELECT_TV_CLK_SOURCE_VIP (1 << 20)
  284. # define NV_PRAMDAC_PLL_COEFF_SELECT_VCLK_RATIO_DB2 (1 << 28)
  285. # define NV_PRAMDAC_PLL_COEFF_SELECT_VCLK2_RATIO_DB2 (2 << 28)
  286. #define NV_PRAMDAC_PLL_SETUP_CONTROL 0x00680510
  287. #define NV_RAMDAC_VPLL2 0x00680520
  288. #define NV_PRAMDAC_SEL_CLK 0x00680524
  289. #define NV_RAMDAC_DITHER_NV11 0x00680528
  290. #define NV_PRAMDAC_DACCLK 0x0068052c
  291. # define NV_PRAMDAC_DACCLK_SEL_DACCLK (1 << 0)
  292. #define NV_RAMDAC_NVPLL_B 0x00680570
  293. #define NV_RAMDAC_MPLL_B 0x00680574
  294. #define NV_RAMDAC_VPLL_B 0x00680578
  295. #define NV_RAMDAC_VPLL2_B 0x0068057c
  296. # define NV31_RAMDAC_ENABLE_VCO2 (8 << 28)
  297. #define NV_PRAMDAC_580 0x00680580
  298. # define NV_RAMDAC_580_VPLL1_ACTIVE (1 << 8)
  299. # define NV_RAMDAC_580_VPLL2_ACTIVE (1 << 28)
  300. #define NV_PRAMDAC_GENERAL_CONTROL 0x00680600
  301. # define NV_PRAMDAC_GENERAL_CONTROL_PIXMIX_ON (3 << 4)
  302. # define NV_PRAMDAC_GENERAL_CONTROL_VGA_STATE_SEL (1 << 8)
  303. # define NV_PRAMDAC_GENERAL_CONTROL_ALT_MODE_SEL (1 << 12)
  304. # define NV_PRAMDAC_GENERAL_CONTROL_TERMINATION_75OHM (2 << 16)
  305. # define NV_PRAMDAC_GENERAL_CONTROL_BPC_8BITS (1 << 20)
  306. # define NV_PRAMDAC_GENERAL_CONTROL_PIPE_LONG (2 << 28)
  307. #define NV_PRAMDAC_TEST_CONTROL 0x00680608
  308. # define NV_PRAMDAC_TEST_CONTROL_TP_INS_EN_ASSERTED (1 << 12)
  309. # define NV_PRAMDAC_TEST_CONTROL_PWRDWN_DAC_OFF (1 << 16)
  310. # define NV_PRAMDAC_TEST_CONTROL_SENSEB_ALLHI (1 << 28)
  311. #define NV_PRAMDAC_TESTPOINT_DATA 0x00680610
  312. # define NV_PRAMDAC_TESTPOINT_DATA_NOTBLANK (8 << 28)
  313. #define NV_PRAMDAC_630 0x00680630
  314. #define NV_PRAMDAC_634 0x00680634
  315. #define NV_PRAMDAC_TV_SETUP 0x00680700
  316. #define NV_PRAMDAC_TV_VTOTAL 0x00680720
  317. #define NV_PRAMDAC_TV_VSKEW 0x00680724
  318. #define NV_PRAMDAC_TV_VSYNC_DELAY 0x00680728
  319. #define NV_PRAMDAC_TV_HTOTAL 0x0068072c
  320. #define NV_PRAMDAC_TV_HSKEW 0x00680730
  321. #define NV_PRAMDAC_TV_HSYNC_DELAY 0x00680734
  322. #define NV_PRAMDAC_TV_HSYNC_DELAY2 0x00680738
  323. #define NV_PRAMDAC_TV_SETUP 0x00680700
  324. #define NV_PRAMDAC_FP_VDISPLAY_END 0x00680800
  325. #define NV_PRAMDAC_FP_VTOTAL 0x00680804
  326. #define NV_PRAMDAC_FP_VCRTC 0x00680808
  327. #define NV_PRAMDAC_FP_VSYNC_START 0x0068080c
  328. #define NV_PRAMDAC_FP_VSYNC_END 0x00680810
  329. #define NV_PRAMDAC_FP_VVALID_START 0x00680814
  330. #define NV_PRAMDAC_FP_VVALID_END 0x00680818
  331. #define NV_PRAMDAC_FP_HDISPLAY_END 0x00680820
  332. #define NV_PRAMDAC_FP_HTOTAL 0x00680824
  333. #define NV_PRAMDAC_FP_HCRTC 0x00680828
  334. #define NV_PRAMDAC_FP_HSYNC_START 0x0068082c
  335. #define NV_PRAMDAC_FP_HSYNC_END 0x00680830
  336. #define NV_PRAMDAC_FP_HVALID_START 0x00680834
  337. #define NV_PRAMDAC_FP_HVALID_END 0x00680838
  338. #define NV_RAMDAC_FP_DITHER 0x0068083c
  339. #define NV_PRAMDAC_FP_TG_CONTROL 0x00680848
  340. # define NV_PRAMDAC_FP_TG_CONTROL_VSYNC_POS (1 << 0)
  341. # define NV_PRAMDAC_FP_TG_CONTROL_VSYNC_DISABLE (2 << 0)
  342. # define NV_PRAMDAC_FP_TG_CONTROL_HSYNC_POS (1 << 4)
  343. # define NV_PRAMDAC_FP_TG_CONTROL_HSYNC_DISABLE (2 << 4)
  344. # define NV_PRAMDAC_FP_TG_CONTROL_MODE_SCALE (0 << 8)
  345. # define NV_PRAMDAC_FP_TG_CONTROL_MODE_CENTER (1 << 8)
  346. # define NV_PRAMDAC_FP_TG_CONTROL_MODE_NATIVE (2 << 8)
  347. # define NV_PRAMDAC_FP_TG_CONTROL_READ_PROG (1 << 20)
  348. # define NV_PRAMDAC_FP_TG_CONTROL_WIDTH_12 (1 << 24)
  349. # define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_POS (1 << 28)
  350. # define NV_PRAMDAC_FP_TG_CONTROL_DISPEN_DISABLE (2 << 28)
  351. #define NV_PRAMDAC_FP_MARGIN_COLOR 0x0068084c
  352. #define NV_PRAMDAC_850 0x00680850
  353. #define NV_PRAMDAC_85C 0x0068085c
  354. #define NV_PRAMDAC_FP_DEBUG_0 0x00680880
  355. # define NV_PRAMDAC_FP_DEBUG_0_XSCALE_ENABLE (1 << 0)
  356. # define NV_PRAMDAC_FP_DEBUG_0_YSCALE_ENABLE (1 << 4)
  357. /* This doesn't seem to be essential for tmds, but still often set */
  358. # define NV_RAMDAC_FP_DEBUG_0_TMDS_ENABLED (8 << 4)
  359. # define NV_PRAMDAC_FP_DEBUG_0_XINTERP_BILINEAR (1 << 8)
  360. # define NV_PRAMDAC_FP_DEBUG_0_YINTERP_BILINEAR (1 << 12)
  361. # define NV_PRAMDAC_FP_DEBUG_0_XWEIGHT_ROUND (1 << 20)
  362. # define NV_PRAMDAC_FP_DEBUG_0_YWEIGHT_ROUND (1 << 24)
  363. # define NV_PRAMDAC_FP_DEBUG_0_PWRDOWN_FPCLK (1 << 28)
  364. #define NV_PRAMDAC_FP_DEBUG_1 0x00680884
  365. # define NV_PRAMDAC_FP_DEBUG_1_XSCALE_VALUE 11:0
  366. # define NV_PRAMDAC_FP_DEBUG_1_XSCALE_TESTMODE_ENABLE (1 << 12)
  367. # define NV_PRAMDAC_FP_DEBUG_1_YSCALE_VALUE 27:16
  368. # define NV_PRAMDAC_FP_DEBUG_1_YSCALE_TESTMODE_ENABLE (1 << 28)
  369. #define NV_PRAMDAC_FP_DEBUG_2 0x00680888
  370. #define NV_PRAMDAC_FP_DEBUG_3 0x0068088C
  371. /* see NV_PRAMDAC_INDIR_TMDS in rules.xml */
  372. #define NV_PRAMDAC_FP_TMDS_CONTROL 0x006808b0
  373. # define NV_PRAMDAC_FP_TMDS_CONTROL_WRITE_DISABLE (1 << 16)
  374. #define NV_PRAMDAC_FP_TMDS_DATA 0x006808b4
  375. #define NV_PRAMDAC_8C0 0x006808c0
  376. /* Some kind of switch */
  377. #define NV_PRAMDAC_900 0x00680900
  378. #define NV_PRAMDAC_A20 0x00680A20
  379. #define NV_PRAMDAC_A24 0x00680A24
  380. #define NV_PRAMDAC_A34 0x00680A34
  381. #define NV_PRAMDAC_CTV 0x00680c00
  382. /* names fabricated from NV_USER_DAC info */
  383. #define NV_PRMDIO_PIXEL_MASK 0x006813c6
  384. # define NV_PRMDIO_PIXEL_MASK_MASK 0xff
  385. #define NV_PRMDIO_READ_MODE_ADDRESS 0x006813c7
  386. #define NV_PRMDIO_WRITE_MODE_ADDRESS 0x006813c8
  387. #define NV_PRMDIO_PALETTE_DATA 0x006813c9
  388. #define NV_PGRAPH_DEBUG_0 0x00400080
  389. #define NV_PGRAPH_DEBUG_1 0x00400084
  390. #define NV_PGRAPH_DEBUG_2_NV04 0x00400088
  391. #define NV_PGRAPH_DEBUG_2 0x00400620
  392. #define NV_PGRAPH_DEBUG_3 0x0040008c
  393. #define NV_PGRAPH_DEBUG_4 0x00400090
  394. #define NV_PGRAPH_INTR 0x00400100
  395. #define NV_PGRAPH_INTR_EN 0x00400140
  396. #define NV_PGRAPH_CTX_CONTROL 0x00400144
  397. #define NV_PGRAPH_CTX_CONTROL_NV04 0x00400170
  398. #define NV_PGRAPH_ABS_UCLIP_XMIN 0x0040053C
  399. #define NV_PGRAPH_ABS_UCLIP_YMIN 0x00400540
  400. #define NV_PGRAPH_ABS_UCLIP_XMAX 0x00400544
  401. #define NV_PGRAPH_ABS_UCLIP_YMAX 0x00400548
  402. #define NV_PGRAPH_BETA_AND 0x00400608
  403. #define NV_PGRAPH_LIMIT_VIOL_PIX 0x00400610
  404. #define NV_PGRAPH_BOFFSET0 0x00400640
  405. #define NV_PGRAPH_BOFFSET1 0x00400644
  406. #define NV_PGRAPH_BOFFSET2 0x00400648
  407. #define NV_PGRAPH_BLIMIT0 0x00400684
  408. #define NV_PGRAPH_BLIMIT1 0x00400688
  409. #define NV_PGRAPH_BLIMIT2 0x0040068c
  410. #define NV_PGRAPH_STATUS 0x00400700
  411. #define NV_PGRAPH_SURFACE 0x00400710
  412. #define NV_PGRAPH_STATE 0x00400714
  413. #define NV_PGRAPH_FIFO 0x00400720
  414. #define NV_PGRAPH_PATTERN_SHAPE 0x00400810
  415. #define NV_PGRAPH_TILE 0x00400b00
  416. #define NV_PVIDEO_INTR_EN 0x00008140
  417. #define NV_PVIDEO_BUFFER 0x00008700
  418. #define NV_PVIDEO_STOP 0x00008704
  419. #define NV_PVIDEO_UVPLANE_BASE(buff) (0x00008800+(buff)*4)
  420. #define NV_PVIDEO_UVPLANE_LIMIT(buff) (0x00008808+(buff)*4)
  421. #define NV_PVIDEO_UVPLANE_OFFSET_BUFF(buff) (0x00008820+(buff)*4)
  422. #define NV_PVIDEO_BASE(buff) (0x00008900+(buff)*4)
  423. #define NV_PVIDEO_LIMIT(buff) (0x00008908+(buff)*4)
  424. #define NV_PVIDEO_LUMINANCE(buff) (0x00008910+(buff)*4)
  425. #define NV_PVIDEO_CHROMINANCE(buff) (0x00008918+(buff)*4)
  426. #define NV_PVIDEO_OFFSET_BUFF(buff) (0x00008920+(buff)*4)
  427. #define NV_PVIDEO_SIZE_IN(buff) (0x00008928+(buff)*4)
  428. #define NV_PVIDEO_POINT_IN(buff) (0x00008930+(buff)*4)
  429. #define NV_PVIDEO_DS_DX(buff) (0x00008938+(buff)*4)
  430. #define NV_PVIDEO_DT_DY(buff) (0x00008940+(buff)*4)
  431. #define NV_PVIDEO_POINT_OUT(buff) (0x00008948+(buff)*4)
  432. #define NV_PVIDEO_SIZE_OUT(buff) (0x00008950+(buff)*4)
  433. #define NV_PVIDEO_FORMAT(buff) (0x00008958+(buff)*4)
  434. # define NV_PVIDEO_FORMAT_PLANAR (1 << 0)
  435. # define NV_PVIDEO_FORMAT_COLOR_LE_CR8YB8CB8YA8 (1 << 16)
  436. # define NV_PVIDEO_FORMAT_DISPLAY_COLOR_KEY (1 << 20)
  437. # define NV_PVIDEO_FORMAT_MATRIX_ITURBT709 (1 << 24)
  438. #define NV_PVIDEO_COLOR_KEY 0x00008B00
  439. /* NV04 overlay defines from VIDIX & Haiku */
  440. #define NV_PVIDEO_INTR_EN_0 0x00680140
  441. #define NV_PVIDEO_STEP_SIZE 0x00680200
  442. #define NV_PVIDEO_CONTROL_Y 0x00680204
  443. #define NV_PVIDEO_CONTROL_X 0x00680208
  444. #define NV_PVIDEO_BUFF0_START_ADDRESS 0x0068020c
  445. #define NV_PVIDEO_BUFF0_PITCH_LENGTH 0x00680214
  446. #define NV_PVIDEO_BUFF0_OFFSET 0x0068021c
  447. #define NV_PVIDEO_BUFF1_START_ADDRESS 0x00680210
  448. #define NV_PVIDEO_BUFF1_PITCH_LENGTH 0x00680218
  449. #define NV_PVIDEO_BUFF1_OFFSET 0x00680220
  450. #define NV_PVIDEO_OE_STATE 0x00680224
  451. #define NV_PVIDEO_SU_STATE 0x00680228
  452. #define NV_PVIDEO_RM_STATE 0x0068022c
  453. #define NV_PVIDEO_WINDOW_START 0x00680230
  454. #define NV_PVIDEO_WINDOW_SIZE 0x00680234
  455. #define NV_PVIDEO_FIFO_THRES_SIZE 0x00680238
  456. #define NV_PVIDEO_FIFO_BURST_LENGTH 0x0068023c
  457. #define NV_PVIDEO_KEY 0x00680240
  458. #define NV_PVIDEO_OVERLAY 0x00680244
  459. #define NV_PVIDEO_RED_CSC_OFFSET 0x00680280
  460. #define NV_PVIDEO_GREEN_CSC_OFFSET 0x00680284
  461. #define NV_PVIDEO_BLUE_CSC_OFFSET 0x00680288
  462. #define NV_PVIDEO_CSC_ADJUST 0x0068028c
  463. #endif