xref: /haiku/headers/private/graphics/radeon_hd/radeon_reg.h (revision 25a7b01d15612846f332751841da3579db313082)
16da3f7d4SAlexander von Gluck IV /*
26da3f7d4SAlexander von Gluck IV  * Copyright 2000 ATI Technologies Inc., Markham, Ontario, and
36da3f7d4SAlexander von Gluck IV  *                VA Linux Systems Inc., Fremont, California.
46da3f7d4SAlexander von Gluck IV  *
56da3f7d4SAlexander von Gluck IV  * All Rights Reserved.
66da3f7d4SAlexander von Gluck IV  *
76da3f7d4SAlexander von Gluck IV  * Permission is hereby granted, free of charge, to any person obtaining
86da3f7d4SAlexander von Gluck IV  * a copy of this software and associated documentation files (the
96da3f7d4SAlexander von Gluck IV  * "Software"), to deal in the Software without restriction, including
106da3f7d4SAlexander von Gluck IV  * without limitation on the rights to use, copy, modify, merge,
116da3f7d4SAlexander von Gluck IV  * publish, distribute, sublicense, and/or sell copies of the Software,
126da3f7d4SAlexander von Gluck IV  * and to permit persons to whom the Software is furnished to do so,
136da3f7d4SAlexander von Gluck IV  * subject to the following conditions:
146da3f7d4SAlexander von Gluck IV  *
156da3f7d4SAlexander von Gluck IV  * The above copyright notice and this permission notice (including the
166da3f7d4SAlexander von Gluck IV  * next paragraph) shall be included in all copies or substantial
176da3f7d4SAlexander von Gluck IV  * portions of the Software.
186da3f7d4SAlexander von Gluck IV  *
196da3f7d4SAlexander von Gluck IV  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
206da3f7d4SAlexander von Gluck IV  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
216da3f7d4SAlexander von Gluck IV  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
226da3f7d4SAlexander von Gluck IV  * NON-INFRINGEMENT.  IN NO EVENT SHALL ATI, VA LINUX SYSTEMS AND/OR
236da3f7d4SAlexander von Gluck IV  * THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
246da3f7d4SAlexander von Gluck IV  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
256da3f7d4SAlexander von Gluck IV  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
266da3f7d4SAlexander von Gluck IV  * DEALINGS IN THE SOFTWARE.
27*f8af3174SAlexander von Gluck IV  *
286da3f7d4SAlexander von Gluck IV  * Authors:
296da3f7d4SAlexander von Gluck IV  *   Kevin E. Martin <martin@xfree86.org>
306da3f7d4SAlexander von Gluck IV  *   Rickard E. Faith <faith@valinux.com>
316da3f7d4SAlexander von Gluck IV  *   Alan Hourihane <alanh@fairlite.demon.co.uk>
326da3f7d4SAlexander von Gluck IV  *
336da3f7d4SAlexander von Gluck IV  * References:
346da3f7d4SAlexander von Gluck IV  *
356da3f7d4SAlexander von Gluck IV  * !!!! FIXME !!!!
366da3f7d4SAlexander von Gluck IV  *   RAGE 128 VR/ RAGE 128 GL Register Reference Manual (Technical
376da3f7d4SAlexander von Gluck IV  *   Reference Manual P/N RRG-G04100-C Rev. 0.04), ATI Technologies: April
386da3f7d4SAlexander von Gluck IV  *   1999.
396da3f7d4SAlexander von Gluck IV  *
406da3f7d4SAlexander von Gluck IV  * !!!! FIXME !!!!
416da3f7d4SAlexander von Gluck IV  *   RAGE 128 Software Development Manual (Technical Reference Manual P/N
426da3f7d4SAlexander von Gluck IV  *   SDK-G04000 Rev. 0.01), ATI Technologies: June 1999.
436da3f7d4SAlexander von Gluck IV  *
446da3f7d4SAlexander von Gluck IV  */
456da3f7d4SAlexander von Gluck IV 
466da3f7d4SAlexander von Gluck IV /* !!!! FIXME !!!!  NOTE: THIS FILE HAS BEEN CONVERTED FROM r128_reg.h
476da3f7d4SAlexander von Gluck IV  * AND CONTAINS REGISTERS AND REGISTER DEFINITIONS THAT ARE NOT CORRECT
486da3f7d4SAlexander von Gluck IV  * ON THE RADEON.  A FULL AUDIT OF THIS CODE IS NEEDED!  */
49*f8af3174SAlexander von Gluck IV #ifndef __RADEON_REG_H_
50*f8af3174SAlexander von Gluck IV #define __RADEON_REG_H_
51*f8af3174SAlexander von Gluck IV 
526da3f7d4SAlexander von Gluck IV 
536da3f7d4SAlexander von Gluck IV #define RADEON_MC_AGP_LOCATION		0x014c
546da3f7d4SAlexander von Gluck IV #define		RADEON_MC_AGP_START_MASK	0x0000FFFF
556da3f7d4SAlexander von Gluck IV #define		RADEON_MC_AGP_START_SHIFT	0
566da3f7d4SAlexander von Gluck IV #define		RADEON_MC_AGP_TOP_MASK		0xFFFF0000
576da3f7d4SAlexander von Gluck IV #define		RADEON_MC_AGP_TOP_SHIFT		16
586da3f7d4SAlexander von Gluck IV #define RADEON_MC_FB_LOCATION		0x0148
596da3f7d4SAlexander von Gluck IV #define		RADEON_MC_FB_START_MASK		0x0000FFFF
606da3f7d4SAlexander von Gluck IV #define		RADEON_MC_FB_START_SHIFT	0
616da3f7d4SAlexander von Gluck IV #define		RADEON_MC_FB_TOP_MASK		0xFFFF0000
626da3f7d4SAlexander von Gluck IV #define		RADEON_MC_FB_TOP_SHIFT		16
636da3f7d4SAlexander von Gluck IV #define RADEON_AGP_BASE_2		0x015c /* r200+ only */
646da3f7d4SAlexander von Gluck IV #define RADEON_AGP_BASE			0x0170
656da3f7d4SAlexander von Gluck IV 
666da3f7d4SAlexander von Gluck IV /* Registers for 2D/Video/Overlay */
676da3f7d4SAlexander von Gluck IV #define RADEON_ADAPTER_ID                   0x0f2c /* PCI */
686da3f7d4SAlexander von Gluck IV #define RADEON_AGP_CNTL                     0x0174
696da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_256MB   (0x00 << 0)
706da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_128MB   (0x20 << 0)
716da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_64MB    (0x30 << 0)
726da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_32MB    (0x38 << 0)
736da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_16MB    (0x3c << 0)
746da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_8MB     (0x3e << 0)
756da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_4MB     (0x3f << 0)
766da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_APER_SIZE_MASK    (0x3f << 0)
776da3f7d4SAlexander von Gluck IV #define RADEON_STATUS_PCI_CONFIG            0x06
786da3f7d4SAlexander von Gluck IV #       define RADEON_CAP_LIST              0x100000
796da3f7d4SAlexander von Gluck IV #define RADEON_CAPABILITIES_PTR_PCI_CONFIG  0x34 /* offset in PCI config*/
806da3f7d4SAlexander von Gluck IV #       define RADEON_CAP_PTR_MASK          0xfc /* mask off reserved bits of CAP_PTR */
816da3f7d4SAlexander von Gluck IV #       define RADEON_CAP_ID_NULL           0x00 /* End of capability list */
826da3f7d4SAlexander von Gluck IV #       define RADEON_CAP_ID_AGP            0x02 /* AGP capability ID */
836da3f7d4SAlexander von Gluck IV #       define RADEON_CAP_ID_EXP            0x10 /* PCI Express */
846da3f7d4SAlexander von Gluck IV #define RADEON_AGP_COMMAND                  0x0f60 /* PCI */
856da3f7d4SAlexander von Gluck IV #define RADEON_AGP_COMMAND_PCI_CONFIG       0x0060 /* offset in PCI config*/
866da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_ENABLE            (1<<8)
876da3f7d4SAlexander von Gluck IV #define RADEON_AGP_PLL_CNTL                 0x000b /* PLL */
886da3f7d4SAlexander von Gluck IV #define RADEON_AGP_STATUS                   0x0f5c /* PCI */
896da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_1X_MODE           0x01
906da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_2X_MODE           0x02
916da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_4X_MODE           0x04
926da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_FW_MODE           0x10
936da3f7d4SAlexander von Gluck IV #       define RADEON_AGP_MODE_MASK         0x17
946da3f7d4SAlexander von Gluck IV #       define RADEON_AGPv3_MODE            0x08
956da3f7d4SAlexander von Gluck IV #       define RADEON_AGPv3_4X_MODE         0x01
966da3f7d4SAlexander von Gluck IV #       define RADEON_AGPv3_8X_MODE         0x02
976da3f7d4SAlexander von Gluck IV #define RADEON_ATTRDR                       0x03c1 /* VGA */
986da3f7d4SAlexander von Gluck IV #define RADEON_ATTRDW                       0x03c0 /* VGA */
996da3f7d4SAlexander von Gluck IV #define RADEON_ATTRX                        0x03c0 /* VGA */
1006da3f7d4SAlexander von Gluck IV #define RADEON_AUX_SC_CNTL                  0x1660
1016da3f7d4SAlexander von Gluck IV #       define RADEON_AUX1_SC_EN            (1 << 0)
1026da3f7d4SAlexander von Gluck IV #       define RADEON_AUX1_SC_MODE_OR       (0 << 1)
1036da3f7d4SAlexander von Gluck IV #       define RADEON_AUX1_SC_MODE_NAND     (1 << 1)
1046da3f7d4SAlexander von Gluck IV #       define RADEON_AUX2_SC_EN            (1 << 2)
1056da3f7d4SAlexander von Gluck IV #       define RADEON_AUX2_SC_MODE_OR       (0 << 3)
1066da3f7d4SAlexander von Gluck IV #       define RADEON_AUX2_SC_MODE_NAND     (1 << 3)
1076da3f7d4SAlexander von Gluck IV #       define RADEON_AUX3_SC_EN            (1 << 4)
1086da3f7d4SAlexander von Gluck IV #       define RADEON_AUX3_SC_MODE_OR       (0 << 5)
1096da3f7d4SAlexander von Gluck IV #       define RADEON_AUX3_SC_MODE_NAND     (1 << 5)
1106da3f7d4SAlexander von Gluck IV #define RADEON_AUX1_SC_BOTTOM               0x1670
1116da3f7d4SAlexander von Gluck IV #define RADEON_AUX1_SC_LEFT                 0x1664
1126da3f7d4SAlexander von Gluck IV #define RADEON_AUX1_SC_RIGHT                0x1668
1136da3f7d4SAlexander von Gluck IV #define RADEON_AUX1_SC_TOP                  0x166c
1146da3f7d4SAlexander von Gluck IV #define RADEON_AUX2_SC_BOTTOM               0x1680
1156da3f7d4SAlexander von Gluck IV #define RADEON_AUX2_SC_LEFT                 0x1674
1166da3f7d4SAlexander von Gluck IV #define RADEON_AUX2_SC_RIGHT                0x1678
1176da3f7d4SAlexander von Gluck IV #define RADEON_AUX2_SC_TOP                  0x167c
1186da3f7d4SAlexander von Gluck IV #define RADEON_AUX3_SC_BOTTOM               0x1690
1196da3f7d4SAlexander von Gluck IV #define RADEON_AUX3_SC_LEFT                 0x1684
1206da3f7d4SAlexander von Gluck IV #define RADEON_AUX3_SC_RIGHT                0x1688
1216da3f7d4SAlexander von Gluck IV #define RADEON_AUX3_SC_TOP                  0x168c
1226da3f7d4SAlexander von Gluck IV #define RADEON_AUX_WINDOW_HORZ_CNTL         0x02d8
1236da3f7d4SAlexander von Gluck IV #define RADEON_AUX_WINDOW_VERT_CNTL         0x02dc
1246da3f7d4SAlexander von Gluck IV 
1256da3f7d4SAlexander von Gluck IV #define RADEON_BASE_CODE                    0x0f0b
1266da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_0_SCRATCH               0x0010
1276da3f7d4SAlexander von Gluck IV #       define RADEON_FP_PANEL_SCALABLE     (1 << 16)
1286da3f7d4SAlexander von Gluck IV #       define RADEON_FP_PANEL_SCALE_EN     (1 << 17)
1296da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CHIP_SCALE_EN      (1 << 18)
1306da3f7d4SAlexander von Gluck IV #       define RADEON_DRIVER_BRIGHTNESS_EN  (1 << 26)
1316da3f7d4SAlexander von Gluck IV #       define RADEON_DISPLAY_ROT_MASK      (3 << 28)
1326da3f7d4SAlexander von Gluck IV #       define RADEON_DISPLAY_ROT_00        (0 << 28)
1336da3f7d4SAlexander von Gluck IV #       define RADEON_DISPLAY_ROT_90        (1 << 28)
1346da3f7d4SAlexander von Gluck IV #       define RADEON_DISPLAY_ROT_180       (2 << 28)
1356da3f7d4SAlexander von Gluck IV #       define RADEON_DISPLAY_ROT_270       (3 << 28)
1366da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_1_SCRATCH               0x0014
1376da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_2_SCRATCH               0x0018
1386da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_3_SCRATCH               0x001c
1396da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_4_SCRATCH               0x0020
1406da3f7d4SAlexander von Gluck IV #       define RADEON_CRT1_ATTACHED_MASK    (3 << 0)
1416da3f7d4SAlexander von Gluck IV #       define RADEON_CRT1_ATTACHED_MONO    (1 << 0)
1426da3f7d4SAlexander von Gluck IV #       define RADEON_CRT1_ATTACHED_COLOR   (2 << 0)
1436da3f7d4SAlexander von Gluck IV #       define RADEON_LCD1_ATTACHED         (1 << 2)
1446da3f7d4SAlexander von Gluck IV #       define RADEON_DFP1_ATTACHED         (1 << 3)
1456da3f7d4SAlexander von Gluck IV #       define RADEON_TV1_ATTACHED_MASK     (3 << 4)
1466da3f7d4SAlexander von Gluck IV #       define RADEON_TV1_ATTACHED_COMP     (1 << 4)
1476da3f7d4SAlexander von Gluck IV #       define RADEON_TV1_ATTACHED_SVIDEO   (2 << 4)
1486da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_ATTACHED_MASK    (3 << 8)
1496da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_ATTACHED_MONO    (1 << 8)
1506da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_ATTACHED_COLOR   (2 << 8)
1516da3f7d4SAlexander von Gluck IV #       define RADEON_DFP2_ATTACHED         (1 << 11)
1526da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_5_SCRATCH               0x0024
1536da3f7d4SAlexander von Gluck IV #       define RADEON_LCD1_ON               (1 << 0)
1546da3f7d4SAlexander von Gluck IV #       define RADEON_CRT1_ON               (1 << 1)
1556da3f7d4SAlexander von Gluck IV #       define RADEON_TV1_ON                (1 << 2)
1566da3f7d4SAlexander von Gluck IV #       define RADEON_DFP1_ON               (1 << 3)
1576da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_ON               (1 << 5)
1586da3f7d4SAlexander von Gluck IV #       define RADEON_CV1_ON                (1 << 6)
1596da3f7d4SAlexander von Gluck IV #       define RADEON_DFP2_ON               (1 << 7)
1606da3f7d4SAlexander von Gluck IV #       define RADEON_LCD1_CRTC_MASK        (1 << 8)
1616da3f7d4SAlexander von Gluck IV #       define RADEON_LCD1_CRTC_SHIFT       8
1626da3f7d4SAlexander von Gluck IV #       define RADEON_CRT1_CRTC_MASK        (1 << 9)
1636da3f7d4SAlexander von Gluck IV #       define RADEON_CRT1_CRTC_SHIFT       9
1646da3f7d4SAlexander von Gluck IV #       define RADEON_TV1_CRTC_MASK         (1 << 10)
1656da3f7d4SAlexander von Gluck IV #       define RADEON_TV1_CRTC_SHIFT        10
1666da3f7d4SAlexander von Gluck IV #       define RADEON_DFP1_CRTC_MASK        (1 << 11)
1676da3f7d4SAlexander von Gluck IV #       define RADEON_DFP1_CRTC_SHIFT       11
1686da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_CRTC_MASK        (1 << 12)
1696da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_CRTC_SHIFT       12
1706da3f7d4SAlexander von Gluck IV #       define RADEON_CV1_CRTC_MASK         (1 << 13)
1716da3f7d4SAlexander von Gluck IV #       define RADEON_CV1_CRTC_SHIFT        13
1726da3f7d4SAlexander von Gluck IV #       define RADEON_DFP2_CRTC_MASK        (1 << 14)
1736da3f7d4SAlexander von Gluck IV #       define RADEON_DFP2_CRTC_SHIFT       14
1746da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_LCD1          (1 << 16)
1756da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_CRT1          (1 << 17)
1766da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_TV1           (1 << 18)
1776da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_DFP1          (1 << 19)
1786da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_CRT2          (1 << 21)
1796da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_TV2           (1 << 22)
1806da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_REQ_DFP2          (1 << 23)
1816da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_6_SCRATCH               0x0028
1826da3f7d4SAlexander von Gluck IV #       define RADEON_ACC_MODE_CHANGE       (1 << 2)
1836da3f7d4SAlexander von Gluck IV #       define RADEON_EXT_DESKTOP_MODE      (1 << 3)
1846da3f7d4SAlexander von Gluck IV #       define RADEON_LCD_DPMS_ON           (1 << 20)
1856da3f7d4SAlexander von Gluck IV #       define RADEON_CRT_DPMS_ON           (1 << 21)
1866da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DPMS_ON            (1 << 22)
1876da3f7d4SAlexander von Gluck IV #       define RADEON_DFP_DPMS_ON           (1 << 23)
1886da3f7d4SAlexander von Gluck IV #       define RADEON_DPMS_MASK             (3 << 24)
1896da3f7d4SAlexander von Gluck IV #       define RADEON_DPMS_ON               (0 << 24)
1906da3f7d4SAlexander von Gluck IV #       define RADEON_DPMS_STANDBY          (1 << 24)
1916da3f7d4SAlexander von Gluck IV #       define RADEON_DPMS_SUSPEND          (2 << 24)
1926da3f7d4SAlexander von Gluck IV #       define RADEON_DPMS_OFF              (3 << 24)
1936da3f7d4SAlexander von Gluck IV #       define RADEON_SCREEN_BLANKING       (1 << 26)
1946da3f7d4SAlexander von Gluck IV #       define RADEON_DRIVER_CRITICAL       (1 << 27)
1956da3f7d4SAlexander von Gluck IV #       define RADEON_DISPLAY_SWITCHING_DIS (1 << 30)
1966da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_7_SCRATCH               0x002c
1976da3f7d4SAlexander von Gluck IV #       define RADEON_SYS_HOTKEY            (1 << 10)
1986da3f7d4SAlexander von Gluck IV #       define RADEON_DRV_LOADED            (1 << 12)
1996da3f7d4SAlexander von Gluck IV #define RADEON_BIOS_ROM                     0x0f30 /* PCI */
2006da3f7d4SAlexander von Gluck IV #define RADEON_BIST                         0x0f0f /* PCI */
2016da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA0                  0x1480
2026da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA1                  0x1484
2036da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA10                 0x14a8
2046da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA11                 0x14ac
2056da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA12                 0x14b0
2066da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA13                 0x14b4
2076da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA14                 0x14b8
2086da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA15                 0x14bc
2096da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA16                 0x14c0
2106da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA17                 0x14c4
2116da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA18                 0x14c8
2126da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA19                 0x14cc
2136da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA2                  0x1488
2146da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA20                 0x14d0
2156da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA21                 0x14d4
2166da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA22                 0x14d8
2176da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA23                 0x14dc
2186da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA24                 0x14e0
2196da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA25                 0x14e4
2206da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA26                 0x14e8
2216da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA27                 0x14ec
2226da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA28                 0x14f0
2236da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA29                 0x14f4
2246da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA3                  0x148c
2256da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA30                 0x14f8
2266da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA31                 0x14fc
2276da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA32                 0x1500
2286da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA33                 0x1504
2296da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA34                 0x1508
2306da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA35                 0x150c
2316da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA36                 0x1510
2326da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA37                 0x1514
2336da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA38                 0x1518
2346da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA39                 0x151c
2356da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA4                  0x1490
2366da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA40                 0x1520
2376da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA41                 0x1524
2386da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA42                 0x1528
2396da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA43                 0x152c
2406da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA44                 0x1530
2416da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA45                 0x1534
2426da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA46                 0x1538
2436da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA47                 0x153c
2446da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA48                 0x1540
2456da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA49                 0x1544
2466da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA5                  0x1494
2476da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA50                 0x1548
2486da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA51                 0x154c
2496da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA52                 0x1550
2506da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA53                 0x1554
2516da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA54                 0x1558
2526da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA55                 0x155c
2536da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA56                 0x1560
2546da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA57                 0x1564
2556da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA58                 0x1568
2566da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA59                 0x156c
2576da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA6                  0x1498
2586da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA60                 0x1570
2596da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA61                 0x1574
2606da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA62                 0x1578
2616da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA63                 0x157c
2626da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA7                  0x149c
2636da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA8                  0x14a0
2646da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_DATA9                  0x14a4
2656da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_SCALE                  0x1470
2666da3f7d4SAlexander von Gluck IV #define RADEON_BRUSH_Y_X                    0x1474
2676da3f7d4SAlexander von Gluck IV #define RADEON_BUS_CNTL                     0x0030
2686da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_MASTER_DIS         (1 << 6)
2696da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_BIOS_DIS_ROM       (1 << 12)
2706da3f7d4SAlexander von Gluck IV #	define RS600_BUS_MASTER_DIS	     (1 << 14)
2716da3f7d4SAlexander von Gluck IV #	define RS600_MSI_REARM		     (1 << 20) /* rs600/rs690/rs740 */
2726da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_RD_DISCARD_EN      (1 << 24)
2736da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_RD_ABORT_EN        (1 << 25)
2746da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_MSTR_DISCONNECT_EN (1 << 28)
2756da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_WRT_BURST          (1 << 29)
2766da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_READ_BURST         (1 << 30)
2776da3f7d4SAlexander von Gluck IV #define RADEON_BUS_CNTL1                    0x0034
2786da3f7d4SAlexander von Gluck IV #       define RADEON_BUS_WAIT_ON_LOCK_EN    (1 << 4)
2796da3f7d4SAlexander von Gluck IV #define RV370_BUS_CNTL                      0x004c
2806da3f7d4SAlexander von Gluck IV #       define RV370_BUS_BIOS_DIS_ROM        (1 << 2)
2816da3f7d4SAlexander von Gluck IV /* rv370/rv380, rv410, r423/r430/r480, r5xx */
2826da3f7d4SAlexander von Gluck IV #define RADEON_MSI_REARM_EN		    0x0160
2836da3f7d4SAlexander von Gluck IV #	define RV370_MSI_REARM_EN	     (1 << 0)
2846da3f7d4SAlexander von Gluck IV 
2856da3f7d4SAlexander von Gluck IV /* #define RADEON_PCIE_INDEX                   0x0030 */
2866da3f7d4SAlexander von Gluck IV /* #define RADEON_PCIE_DATA                    0x0034 */
2876da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_LC_LINK_WIDTH_CNTL             0xa2 /* PCIE */
2886da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_SHIFT     0
2896da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_MASK      0x7
2906da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X0        0
2916da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X1        1
2926da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X2        2
2936da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X4        3
2946da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X8        4
2956da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X12       5
2966da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_X16       6
2976da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_RD_SHIFT  4
2986da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_LINK_WIDTH_RD_MASK   0x70
2996da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_RECONFIG_NOW         (1 << 8)
3006da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_RECONFIG_LATER       (1 << 9)
3016da3f7d4SAlexander von Gluck IV #       define RADEON_PCIE_LC_SHORT_RECONFIG_EN    (1 << 10)
3026da3f7d4SAlexander von Gluck IV #       define R600_PCIE_LC_RECONFIG_ARC_MISSING_ESCAPE   (1 << 7)
3036da3f7d4SAlexander von Gluck IV #       define R600_PCIE_LC_RENEGOTIATION_SUPPORT  (1 << 9)
3046da3f7d4SAlexander von Gluck IV #       define R600_PCIE_LC_RENEGOTIATE_EN         (1 << 10)
3056da3f7d4SAlexander von Gluck IV #       define R600_PCIE_LC_SHORT_RECONFIG_EN      (1 << 11)
3066da3f7d4SAlexander von Gluck IV #       define R600_PCIE_LC_UPCONFIGURE_SUPPORT    (1 << 12)
3076da3f7d4SAlexander von Gluck IV #       define R600_PCIE_LC_UPCONFIGURE_DIS        (1 << 13)
3086da3f7d4SAlexander von Gluck IV 
3096da3f7d4SAlexander von Gluck IV #define R600_TARGET_AND_CURRENT_PROFILE_INDEX      0x70c
3106da3f7d4SAlexander von Gluck IV #define R700_TARGET_AND_CURRENT_PROFILE_INDEX      0x66c
3116da3f7d4SAlexander von Gluck IV 
3126da3f7d4SAlexander von Gluck IV #define RADEON_CACHE_CNTL                   0x1724
3136da3f7d4SAlexander von Gluck IV #define RADEON_CACHE_LINE                   0x0f0c /* PCI */
3146da3f7d4SAlexander von Gluck IV #define RADEON_CAPABILITIES_ID              0x0f50 /* PCI */
3156da3f7d4SAlexander von Gluck IV #define RADEON_CAPABILITIES_PTR             0x0f34 /* PCI */
3166da3f7d4SAlexander von Gluck IV #define RADEON_CLK_PIN_CNTL                 0x0001 /* PLL */
3176da3f7d4SAlexander von Gluck IV #       define RADEON_DONT_USE_XTALIN       (1 << 4)
3186da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_DYN_START_CNTL   (1 << 15)
3196da3f7d4SAlexander von Gluck IV #define RADEON_CLOCK_CNTL_DATA              0x000c
3206da3f7d4SAlexander von Gluck IV #define RADEON_CLOCK_CNTL_INDEX             0x0008
3216da3f7d4SAlexander von Gluck IV #       define RADEON_PLL_WR_EN             (1 << 7)
3226da3f7d4SAlexander von Gluck IV #       define RADEON_PLL_DIV_SEL           (3 << 8)
3236da3f7d4SAlexander von Gluck IV #       define RADEON_PLL2_DIV_SEL_MASK     (~(3 << 8))
3246da3f7d4SAlexander von Gluck IV #define RADEON_CLK_PWRMGT_CNTL              0x0014
3256da3f7d4SAlexander von Gluck IV #       define RADEON_ENGIN_DYNCLK_MODE     (1 << 12)
3266da3f7d4SAlexander von Gluck IV #       define RADEON_ACTIVE_HILO_LAT_MASK  (3 << 13)
3276da3f7d4SAlexander von Gluck IV #       define RADEON_ACTIVE_HILO_LAT_SHIFT 13
3286da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DYN_STOP_LAT_MASK (1 << 12)
3296da3f7d4SAlexander von Gluck IV #       define RADEON_MC_BUSY               (1 << 16)
3306da3f7d4SAlexander von Gluck IV #       define RADEON_DLL_READY             (1 << 19)
3316da3f7d4SAlexander von Gluck IV #       define RADEON_CG_NO1_DEBUG_0        (1 << 24)
3326da3f7d4SAlexander von Gluck IV #       define RADEON_CG_NO1_DEBUG_MASK     (0x1f << 24)
3336da3f7d4SAlexander von Gluck IV #       define RADEON_DYN_STOP_MODE_MASK    (7 << 21)
3346da3f7d4SAlexander von Gluck IV #       define RADEON_TVPLL_PWRMGT_OFF      (1 << 30)
3356da3f7d4SAlexander von Gluck IV #       define RADEON_TVCLK_TURNOFF         (1 << 31)
3366da3f7d4SAlexander von Gluck IV #define RADEON_PLL_PWRMGT_CNTL              0x0015 /* PLL */
3376da3f7d4SAlexander von Gluck IV #	define RADEON_PM_MODE_SEL           (1 << 13)
3386da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_BYPASS_DISABLE    (1 << 20)
3396da3f7d4SAlexander von Gluck IV #define RADEON_CLR_CMP_CLR_3D               0x1a24
3406da3f7d4SAlexander von Gluck IV #define RADEON_CLR_CMP_CLR_DST              0x15c8
3416da3f7d4SAlexander von Gluck IV #define RADEON_CLR_CMP_CLR_SRC              0x15c4
3426da3f7d4SAlexander von Gluck IV #define RADEON_CLR_CMP_CNTL                 0x15c0
3436da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_CMP_EQ_COLOR      (4 <<  0)
3446da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_CMP_NEQ_COLOR     (5 <<  0)
3456da3f7d4SAlexander von Gluck IV #       define RADEON_CLR_CMP_SRC_SOURCE    (1 << 24)
3466da3f7d4SAlexander von Gluck IV #define RADEON_CLR_CMP_MASK                 0x15cc
3476da3f7d4SAlexander von Gluck IV #       define RADEON_CLR_CMP_MSK           0xffffffff
3486da3f7d4SAlexander von Gluck IV #define RADEON_CLR_CMP_MASK_3D              0x1A28
3496da3f7d4SAlexander von Gluck IV #define RADEON_COMMAND                      0x0f04 /* PCI */
3506da3f7d4SAlexander von Gluck IV #define RADEON_COMPOSITE_SHADOW_ID          0x1a0c
3516da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_APER_0_BASE           0x0100
3526da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_APER_1_BASE           0x0104
3536da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_APER_SIZE             0x0108
3546da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_BONDS                 0x00e8
3556da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_CNTL                  0x00e0
3566da3f7d4SAlexander von Gluck IV #       define RADEON_CFG_VGA_RAM_EN        (1 << 8)
3576da3f7d4SAlexander von Gluck IV #       define RADEON_CFG_VGA_IO_DIS        (1 << 9)
3586da3f7d4SAlexander von Gluck IV #       define RADEON_CFG_ATI_REV_A11       (0   << 16)
3596da3f7d4SAlexander von Gluck IV #       define RADEON_CFG_ATI_REV_A12       (1   << 16)
3606da3f7d4SAlexander von Gluck IV #       define RADEON_CFG_ATI_REV_A13       (2   << 16)
3616da3f7d4SAlexander von Gluck IV #       define RADEON_CFG_ATI_REV_ID_MASK   (0xf << 16)
3626da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_MEMSIZE               0x00f8
3636da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_MEMSIZE_EMBEDDED      0x0114
3646da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_REG_1_BASE            0x010c
3656da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_REG_APER_SIZE         0x0110
3666da3f7d4SAlexander von Gluck IV #define RADEON_CONFIG_XSTRAP                0x00e4
3676da3f7d4SAlexander von Gluck IV #define RADEON_CONSTANT_COLOR_C             0x1d34
3686da3f7d4SAlexander von Gluck IV #       define RADEON_CONSTANT_COLOR_MASK   0x00ffffff
3696da3f7d4SAlexander von Gluck IV #       define RADEON_CONSTANT_COLOR_ONE    0x00ffffff
3706da3f7d4SAlexander von Gluck IV #       define RADEON_CONSTANT_COLOR_ZERO   0x00000000
3716da3f7d4SAlexander von Gluck IV #define RADEON_CRC_CMDFIFO_ADDR             0x0740
3726da3f7d4SAlexander von Gluck IV #define RADEON_CRC_CMDFIFO_DOUT             0x0744
3736da3f7d4SAlexander von Gluck IV #define RADEON_GRPH_BUFFER_CNTL             0x02f0
3746da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_START_REQ_MASK          (0x7f)
3756da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_START_REQ_SHIFT         0
3766da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_STOP_REQ_MASK           (0x7f<<8)
3776da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_STOP_REQ_SHIFT          8
3786da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_CRITICAL_POINT_MASK     (0x7f<<16)
3796da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_CRITICAL_POINT_SHIFT    16
3806da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_CRITICAL_CNTL           (1<<28)
3816da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_BUFFER_SIZE             (1<<29)
3826da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_CRITICAL_AT_SOF         (1<<30)
3836da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH_STOP_CNTL               (1<<31)
3846da3f7d4SAlexander von Gluck IV #define RADEON_GRPH2_BUFFER_CNTL            0x03f0
3856da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_START_REQ_MASK         (0x7f)
3866da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_START_REQ_SHIFT         0
3876da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_STOP_REQ_MASK          (0x7f<<8)
3886da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_STOP_REQ_SHIFT         8
3896da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_CRITICAL_POINT_MASK    (0x7f<<16)
3906da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_CRITICAL_POINT_SHIFT   16
3916da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_CRITICAL_CNTL          (1<<28)
3926da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_BUFFER_SIZE            (1<<29)
3936da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_CRITICAL_AT_SOF        (1<<30)
3946da3f7d4SAlexander von Gluck IV #       define RADEON_GRPH2_STOP_CNTL              (1<<31)
3956da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_CRNT_FRAME              0x0214
3966da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_EXT_CNTL                0x0054
3976da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_VGA_XOVERSCAN    (1 <<  0)
3986da3f7d4SAlexander von Gluck IV #       define RADEON_VGA_ATI_LINEAR        (1 <<  3)
3996da3f7d4SAlexander von Gluck IV #       define RADEON_XCRT_CNT_EN           (1 <<  6)
4006da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_HSYNC_DIS        (1 <<  8)
4016da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_VSYNC_DIS        (1 <<  9)
4026da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_DISPLAY_DIS      (1 << 10)
4036da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_SYNC_TRISTAT     (1 << 11)
4046da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CRT_ON           (1 << 15)
4056da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_EXT_CNTL_DPMS_BYTE      0x0055
4066da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_HSYNC_DIS_BYTE   (1 <<  0)
4076da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_VSYNC_DIS_BYTE   (1 <<  1)
4086da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_DISPLAY_DIS_BYTE (1 <<  2)
4096da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_GEN_CNTL                0x0050
4106da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_DBL_SCAN_EN      (1 <<  0)
4116da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_INTERLACE_EN     (1 <<  1)
4126da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CSYNC_EN         (1 <<  4)
4136da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_ICON_EN          (1 << 15)
4146da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CUR_EN           (1 << 16)
4156da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_VSTAT_MODE_MASK  (3 << 17)
4166da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CUR_MODE_MASK    (7 << 20)
4176da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CUR_MODE_SHIFT   20
4186da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CUR_MODE_MONO    0
4196da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CUR_MODE_24BPP   2
4206da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_EXT_DISP_EN      (1 << 24)
4216da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_EN               (1 << 25)
4226da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_DISP_REQ_EN_B    (1 << 26)
4236da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_GEN_CNTL               0x03f8
4246da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_DBL_SCAN_EN     (1 <<  0)
4256da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_INTERLACE_EN    (1 <<  1)
4266da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_SYNC_TRISTAT    (1 <<  4)
4276da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_HSYNC_TRISTAT   (1 <<  5)
4286da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_VSYNC_TRISTAT   (1 <<  6)
4296da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_CRT2_ON         (1 <<  7)
4306da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_PIX_WIDTH_SHIFT 8
4316da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_PIX_WIDTH_MASK  (0xf << 8)
4326da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_ICON_EN         (1 << 15)
4336da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_CUR_EN          (1 << 16)
4346da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_CUR_MODE_MASK   (7 << 20)
4356da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_DISP_DIS        (1 << 23)
4366da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_EN              (1 << 25)
4376da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_DISP_REQ_EN_B   (1 << 26)
4386da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_CSYNC_EN        (1 << 27)
4396da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_HSYNC_DIS       (1 << 28)
4406da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_VSYNC_DIS       (1 << 29)
4416da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_MORE_CNTL               0x27c
4426da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_AUTO_HORZ_CENTER_EN (1<<2)
4436da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_AUTO_VERT_CENTER_EN (1<<3)
4446da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_CUTOFF_ACTIVE_EN (1<<4)
4456da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_CUTOFF_ACTIVE_EN (1<<5)
4466da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_GUI_TRIG_VLINE          0x0218
4476da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_H_SYNC_STRT_WID         0x0204
4486da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_SYNC_STRT_PIX        (0x07  <<  0)
4496da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_SYNC_STRT_CHAR       (0x3ff <<  3)
4506da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_SYNC_STRT_CHAR_SHIFT 3
4516da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_SYNC_WID             (0x3f  << 16)
4526da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_SYNC_WID_SHIFT       16
4536da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_SYNC_POL             (1     << 23)
4546da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_H_SYNC_STRT_WID        0x0304
4556da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_SYNC_STRT_PIX        (0x07  <<  0)
4566da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_SYNC_STRT_CHAR       (0x3ff <<  3)
4576da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_SYNC_STRT_CHAR_SHIFT 3
4586da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_SYNC_WID             (0x3f  << 16)
4596da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_SYNC_WID_SHIFT       16
4606da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_SYNC_POL             (1     << 23)
4616da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_H_TOTAL_DISP            0x0200
4626da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_TOTAL          (0x03ff << 0)
4636da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_TOTAL_SHIFT    0
4646da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_DISP           (0x01ff << 16)
4656da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_H_DISP_SHIFT     16
4666da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_H_TOTAL_DISP           0x0300
4676da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_TOTAL         (0x03ff << 0)
4686da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_TOTAL_SHIFT   0
4696da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_DISP          (0x01ff << 16)
4706da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_H_DISP_SHIFT    16
4716da3f7d4SAlexander von Gluck IV 
4726da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_OFFSET_RIGHT	    0x0220
4736da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_OFFSET                  0x0224
4746da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_OFFSET__GUI_TRIG_OFFSET (1<<30)
4756da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_OFFSET__OFFSET_LOCK	   (1<<31)
4766da3f7d4SAlexander von Gluck IV 
4776da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_OFFSET                 0x0324
4786da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC2_OFFSET__GUI_TRIG_OFFSET (1<<30)
4796da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC2_OFFSET__OFFSET_LOCK	    (1<<31)
4806da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_OFFSET_CNTL             0x0228
4816da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_TILE_LINE_SHIFT              0
4826da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_TILE_LINE_RIGHT_SHIFT        4
4836da3f7d4SAlexander von Gluck IV #	define R300_CRTC_X_Y_MODE_EN_RIGHT		(1 << 6)
4846da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_MASK   (3 << 7)
4856da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_AUTO   (0 << 7)
4866da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_SINGLE (1 << 7)
4876da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DOUBLE (2 << 7)
4886da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_RIGHT_DIS    (3 << 7)
4896da3f7d4SAlexander von Gluck IV #	define R300_CRTC_X_Y_MODE_EN			(1 << 9)
4906da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_MASK		(3 << 10)
4916da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_AUTO		(0 << 10)
4926da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_SINGLE	(1 << 10)
4936da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_DOUBLE	(2 << 10)
4946da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_BUFFER_DIS		(3 << 10)
4956da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_EN_RIGHT		(1 << 12)
4966da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MICRO_TILE_EN			(1 << 13)
4976da3f7d4SAlexander von Gluck IV #	define R300_CRTC_MACRO_TILE_EN_RIGHT		(1 << 14)
4986da3f7d4SAlexander von Gluck IV #       define R300_CRTC_MACRO_TILE_EN                  (1 << 15)
4996da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_TILE_EN_RIGHT                (1 << 14)
5006da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_TILE_EN                      (1 << 15)
5016da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_OFFSET_FLIP_CNTL             (1 << 16)
5026da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_STEREO_OFFSET_EN             (1 << 17)
5036da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_GUI_TRIG_OFFSET_LEFT_EN      (1 << 28)
5046da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_GUI_TRIG_OFFSET_RIGHT_EN     (1 << 29)
5056da3f7d4SAlexander von Gluck IV 
5066da3f7d4SAlexander von Gluck IV #define R300_CRTC_TILE_X0_Y0	            0x0350
5076da3f7d4SAlexander von Gluck IV #define R300_CRTC2_TILE_X0_Y0	            0x0358
5086da3f7d4SAlexander von Gluck IV 
5096da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_OFFSET_CNTL            0x0328
5106da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_OFFSET_FLIP_CNTL (1 << 16)
5116da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_TILE_EN         (1 << 15)
5126da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_PITCH                   0x022c
5136da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_PITCH__SHIFT		 0
5146da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_PITCH__RIGHT_SHIFT	16
5156da3f7d4SAlexander von Gluck IV 
5166da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_PITCH                  0x032c
5176da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_STATUS                  0x005c
5186da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_VBLANK_SAVE      (1 <<  1)
5196da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_VBLANK_SAVE_CLEAR  (1 <<  1)
5206da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_STATUS                  0x03fc
5216da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_VBLANK_SAVE      (1 <<  1)
5226da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_VBLANK_SAVE_CLEAR  (1 <<  1)
5236da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_V_SYNC_STRT_WID         0x020c
5246da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_SYNC_STRT        (0x7ff <<  0)
5256da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_SYNC_STRT_SHIFT  0
5266da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_SYNC_WID         (0x1f  << 16)
5276da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_SYNC_WID_SHIFT   16
5286da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_SYNC_POL         (1     << 23)
5296da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_V_SYNC_STRT_WID        0x030c
5306da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_SYNC_STRT       (0x7ff <<  0)
5316da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_SYNC_STRT_SHIFT 0
5326da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_SYNC_WID        (0x1f  << 16)
5336da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_SYNC_WID_SHIFT  16
5346da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_SYNC_POL        (1     << 23)
5356da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_V_TOTAL_DISP            0x0208
5366da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_TOTAL          (0x07ff << 0)
5376da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_TOTAL_SHIFT    0
5386da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_DISP           (0x07ff << 16)
5396da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_V_DISP_SHIFT     16
5406da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_V_TOTAL_DISP           0x0308
5416da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_TOTAL         (0x07ff << 0)
5426da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_TOTAL_SHIFT   0
5436da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_DISP          (0x07ff << 16)
5446da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC2_V_DISP_SHIFT    16
5456da3f7d4SAlexander von Gluck IV #define RADEON_CRTC_VLINE_CRNT_VLINE        0x0210
5466da3f7d4SAlexander von Gluck IV #       define RADEON_CRTC_CRNT_VLINE_MASK  (0x7ff << 16)
5476da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_CRNT_FRAME             0x0314
5486da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_GUI_TRIG_VLINE         0x0318
5496da3f7d4SAlexander von Gluck IV #define RADEON_CRTC2_VLINE_CRNT_VLINE       0x0310
5506da3f7d4SAlexander von Gluck IV #define RADEON_CRTC8_DATA                   0x03d5 /* VGA, 0x3b5 */
5516da3f7d4SAlexander von Gluck IV #define RADEON_CRTC8_IDX                    0x03d4 /* VGA, 0x3b4 */
5526da3f7d4SAlexander von Gluck IV #define RADEON_CUR_CLR0                     0x026c
5536da3f7d4SAlexander von Gluck IV #define RADEON_CUR_CLR1                     0x0270
5546da3f7d4SAlexander von Gluck IV #define RADEON_CUR_HORZ_VERT_OFF            0x0268
5556da3f7d4SAlexander von Gluck IV #define RADEON_CUR_HORZ_VERT_POSN           0x0264
5566da3f7d4SAlexander von Gluck IV #define RADEON_CUR_OFFSET                   0x0260
5576da3f7d4SAlexander von Gluck IV #       define RADEON_CUR_LOCK              (1 << 31)
5586da3f7d4SAlexander von Gluck IV #define RADEON_CUR2_CLR0                    0x036c
5596da3f7d4SAlexander von Gluck IV #define RADEON_CUR2_CLR1                    0x0370
5606da3f7d4SAlexander von Gluck IV #define RADEON_CUR2_HORZ_VERT_OFF           0x0368
5616da3f7d4SAlexander von Gluck IV #define RADEON_CUR2_HORZ_VERT_POSN          0x0364
5626da3f7d4SAlexander von Gluck IV #define RADEON_CUR2_OFFSET                  0x0360
5636da3f7d4SAlexander von Gluck IV #       define RADEON_CUR2_LOCK             (1 << 31)
5646da3f7d4SAlexander von Gluck IV 
5656da3f7d4SAlexander von Gluck IV #define RADEON_DAC_CNTL                     0x0058
5666da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_RANGE_CNTL        (3 <<  0)
5676da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_RANGE_CNTL_PS2    (2 <<  0)
5686da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_RANGE_CNTL_MASK   0x03
5696da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_BLANKING          (1 <<  2)
5706da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_CMP_EN            (1 <<  3)
5716da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_CMP_OUTPUT        (1 <<  7)
5726da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_8BIT_EN           (1 <<  8)
5736da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_TVO_EN            (1 << 10)
5746da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_VGA_ADR_EN        (1 << 13)
5756da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_PDWN              (1 << 15)
5766da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_MASK_ALL          (0xff << 24)
5776da3f7d4SAlexander von Gluck IV #define RADEON_DAC_CNTL2                    0x007c
5786da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_TV_CLK_SEL       (0 <<  1)
5796da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_DAC_CLK_SEL      (1 <<  0)
5806da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_DAC2_CLK_SEL     (1 <<  1)
5816da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_PALETTE_ACC_CTL  (1 <<  5)
5826da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_CMP_EN           (1 <<  7)
5836da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_CMP_OUT_R        (1 <<  8)
5846da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_CMP_OUT_G        (1 <<  9)
5856da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_CMP_OUT_B        (1 << 10)
5866da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_CMP_OUTPUT       (1 << 11)
5876da3f7d4SAlexander von Gluck IV #define RADEON_DAC_EXT_CNTL                 0x0280
5886da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_FORCE_BLANK_OFF_EN (1 << 0)
5896da3f7d4SAlexander von Gluck IV #       define RADEON_DAC2_FORCE_DATA_EN      (1 << 1)
5906da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_BLANK_OFF_EN  (1 << 4)
5916da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_EN       (1 << 5)
5926da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_SEL_MASK (3 << 6)
5936da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_SEL_R    (0 << 6)
5946da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_SEL_G    (1 << 6)
5956da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_SEL_B    (2 << 6)
5966da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_SEL_RGB  (3 << 6)
5976da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_MASK   0x0003ff00
5986da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_FORCE_DATA_SHIFT  8
5996da3f7d4SAlexander von Gluck IV #define RADEON_DAC_MACRO_CNTL               0x0d04
6006da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_PDWN_R            (1 << 16)
6016da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_PDWN_G            (1 << 17)
6026da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_PDWN_B            (1 << 18)
6036da3f7d4SAlexander von Gluck IV #define RADEON_DISP_PWR_MAN                 0x0d08
6046da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_PWR_MAN_D3_CRTC_EN      (1 << 0)
6056da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_PWR_MAN_D3_CRTC2_EN     (1 << 4)
6066da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_PWR_MAN_DPMS_ON  (0 << 8)
6076da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_PWR_MAN_DPMS_STANDBY    (1 << 8)
6086da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_PWR_MAN_DPMS_SUSPEND    (2 << 8)
6096da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_PWR_MAN_DPMS_OFF (3 << 8)
6106da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D3_RST           (1 << 16)
6116da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D3_REG_RST       (1 << 17)
6126da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D3_GRPH_RST      (1 << 18)
6136da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D3_SUBPIC_RST    (1 << 19)
6146da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D3_OV0_RST       (1 << 20)
6156da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D1D2_GRPH_RST    (1 << 21)
6166da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D1D2_SUBPIC_RST  (1 << 22)
6176da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_D1D2_OV0_RST     (1 << 23)
6186da3f7d4SAlexander von Gluck IV #       define RADEON_DIG_TMDS_ENABLE_RST   (1 << 24)
6196da3f7d4SAlexander von Gluck IV #       define RADEON_TV_ENABLE_RST         (1 << 25)
6206da3f7d4SAlexander von Gluck IV #       define RADEON_AUTO_PWRUP_EN         (1 << 26)
6216da3f7d4SAlexander von Gluck IV #define RADEON_TV_DAC_CNTL                  0x088c
6226da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_NBLANK         (1 << 0)
6236da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_NHOLD          (1 << 1)
6246da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_PEDESTAL       (1 <<  2)
6256da3f7d4SAlexander von Gluck IV #       define RADEON_TV_MONITOR_DETECT_EN  (1 <<  4)
6266da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_CMPOUT         (1 <<  5)
6276da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_STD_MASK       (3 <<  8)
6286da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_STD_PAL        (0 <<  8)
6296da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_STD_NTSC       (1 <<  8)
6306da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_STD_PS2        (2 <<  8)
6316da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_STD_RS343      (3 <<  8)
6326da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_BGSLEEP        (1 <<  6)
6336da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_BGADJ_MASK     (0xf <<  16)
6346da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_BGADJ_SHIFT    16
6356da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_DACADJ_MASK    (0xf <<  20)
6366da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_DACADJ_SHIFT   20
6376da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_RDACPD         (1 <<  24)
6386da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_GDACPD         (1 <<  25)
6396da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_BDACPD         (1 <<  26)
6406da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_RDACDET        (1 << 29)
6416da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_GDACDET        (1 << 30)
6426da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DAC_BDACDET        (1 << 31)
6436da3f7d4SAlexander von Gluck IV #       define R420_TV_DAC_DACADJ_MASK      (0x1f <<  20)
6446da3f7d4SAlexander von Gluck IV #       define R420_TV_DAC_RDACPD           (1 <<  25)
6456da3f7d4SAlexander von Gluck IV #       define R420_TV_DAC_GDACPD           (1 <<  26)
6466da3f7d4SAlexander von Gluck IV #       define R420_TV_DAC_BDACPD           (1 <<  27)
6476da3f7d4SAlexander von Gluck IV #       define R420_TV_DAC_TVENABLE         (1 <<  28)
6486da3f7d4SAlexander von Gluck IV #define RADEON_DISP_HW_DEBUG                0x0d14
6496da3f7d4SAlexander von Gluck IV #       define RADEON_CRT2_DISP1_SEL        (1 <<  5)
6506da3f7d4SAlexander von Gluck IV #define RADEON_DISP_OUTPUT_CNTL             0x0d64
6516da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DAC_SOURCE_MASK  0x03
6526da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DAC2_SOURCE_MASK  0x0c
6536da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DAC_SOURCE_CRTC2 0x01
6546da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DAC_SOURCE_RMX   0x02
6556da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DAC_SOURCE_LTU   0x03
6566da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_DAC2_SOURCE_CRTC2 0x04
6576da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TVDAC_SOURCE_MASK  (0x03 << 2)
6586da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TVDAC_SOURCE_CRTC  0x0
6596da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TVDAC_SOURCE_CRTC2 (0x01 << 2)
6606da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TVDAC_SOURCE_RMX   (0x02 << 2)
6616da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TVDAC_SOURCE_LTU   (0x03 << 2)
6626da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TRANS_MATRIX_MASK  (0x03 << 4)
6636da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TRANS_MATRIX_ALPHA_MSB (0x00 << 4)
6646da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TRANS_MATRIX_GRAPHICS  (0x01 << 4)
6656da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TRANS_MATRIX_VIDEO     (0x02 << 4)
6666da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TV_SOURCE_CRTC   (1 << 16) /* crtc1 or crtc2 */
6676da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TV_SOURCE_LTU    (0 << 16) /* linear transform unit */
6686da3f7d4SAlexander von Gluck IV #define RADEON_DISP_TV_OUT_CNTL             0x0d6c
6696da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TV_PATH_SRC_CRTC2 (1 << 16)
6706da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TV_PATH_SRC_CRTC1 (0 << 16)
6716da3f7d4SAlexander von Gluck IV #define RADEON_DAC_CRC_SIG                  0x02cc
6726da3f7d4SAlexander von Gluck IV #define RADEON_DAC_DATA                     0x03c9 /* VGA */
6736da3f7d4SAlexander von Gluck IV #define RADEON_DAC_MASK                     0x03c6 /* VGA */
6746da3f7d4SAlexander von Gluck IV #define RADEON_DAC_R_INDEX                  0x03c7 /* VGA */
6756da3f7d4SAlexander von Gluck IV #define RADEON_DAC_W_INDEX                  0x03c8 /* VGA */
6766da3f7d4SAlexander von Gluck IV #define RADEON_DDA_CONFIG                   0x02e0
6776da3f7d4SAlexander von Gluck IV #define RADEON_DDA_ON_OFF                   0x02e4
6786da3f7d4SAlexander von Gluck IV #define RADEON_DEFAULT_OFFSET               0x16e0
6796da3f7d4SAlexander von Gluck IV #define RADEON_DEFAULT_PITCH                0x16e4
6806da3f7d4SAlexander von Gluck IV #define RADEON_DEFAULT_SC_BOTTOM_RIGHT      0x16e8
6816da3f7d4SAlexander von Gluck IV #       define RADEON_DEFAULT_SC_RIGHT_MAX  (0x1fff <<  0)
6826da3f7d4SAlexander von Gluck IV #       define RADEON_DEFAULT_SC_BOTTOM_MAX (0x1fff << 16)
6836da3f7d4SAlexander von Gluck IV #define RADEON_DESTINATION_3D_CLR_CMP_VAL   0x1820
6846da3f7d4SAlexander von Gluck IV #define RADEON_DESTINATION_3D_CLR_CMP_MSK   0x1824
6856da3f7d4SAlexander von Gluck IV #define RADEON_DEVICE_ID                    0x0f02 /* PCI */
6866da3f7d4SAlexander von Gluck IV #define RADEON_DISP_MISC_CNTL               0x0d00
6876da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_GRPH_PP    (1 << 0)
6886da3f7d4SAlexander von Gluck IV #define RADEON_DISP_MERGE_CNTL		  0x0d60
6896da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_ALPHA_MODE_MASK  0x03
6906da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_ALPHA_MODE_KEY   0
6916da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_ALPHA_MODE_PER_PIXEL 1
6926da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_ALPHA_MODE_GLOBAL 2
6936da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_RGB_OFFSET_EN    (1 << 8)
6946da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_GRPH_ALPHA_MASK  (0xff << 16)
6956da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_OV0_ALPHA_MASK   (0xff << 24)
6966da3f7d4SAlexander von Gluck IV #	define RADEON_DISP_LIN_TRANS_BYPASS (0x01 << 9)
6976da3f7d4SAlexander von Gluck IV #define RADEON_DISP2_MERGE_CNTL		    0x0d68
6986da3f7d4SAlexander von Gluck IV #       define RADEON_DISP2_RGB_OFFSET_EN   (1 << 8)
6996da3f7d4SAlexander von Gluck IV #define RADEON_DISP_LIN_TRANS_GRPH_A        0x0d80
7006da3f7d4SAlexander von Gluck IV #define RADEON_DISP_LIN_TRANS_GRPH_B        0x0d84
7016da3f7d4SAlexander von Gluck IV #define RADEON_DISP_LIN_TRANS_GRPH_C        0x0d88
7026da3f7d4SAlexander von Gluck IV #define RADEON_DISP_LIN_TRANS_GRPH_D        0x0d8c
7036da3f7d4SAlexander von Gluck IV #define RADEON_DISP_LIN_TRANS_GRPH_E        0x0d90
7046da3f7d4SAlexander von Gluck IV #define RADEON_DISP_LIN_TRANS_GRPH_F        0x0d98
7056da3f7d4SAlexander von Gluck IV #define RADEON_DP_BRUSH_BKGD_CLR            0x1478
7066da3f7d4SAlexander von Gluck IV #define RADEON_DP_BRUSH_FRGD_CLR            0x147c
7076da3f7d4SAlexander von Gluck IV #define RADEON_DP_CNTL                      0x16c0
7086da3f7d4SAlexander von Gluck IV #       define RADEON_DST_X_LEFT_TO_RIGHT   (1 <<  0)
7096da3f7d4SAlexander von Gluck IV #       define RADEON_DST_Y_TOP_TO_BOTTOM   (1 <<  1)
7106da3f7d4SAlexander von Gluck IV #       define RADEON_DP_DST_TILE_LINEAR    (0 <<  3)
7116da3f7d4SAlexander von Gluck IV #       define RADEON_DP_DST_TILE_MACRO     (1 <<  3)
7126da3f7d4SAlexander von Gluck IV #       define RADEON_DP_DST_TILE_MICRO     (2 <<  3)
7136da3f7d4SAlexander von Gluck IV #       define RADEON_DP_DST_TILE_BOTH      (3 <<  3)
7146da3f7d4SAlexander von Gluck IV #define RADEON_DP_CNTL_XDIR_YDIR_YMAJOR     0x16d0
7156da3f7d4SAlexander von Gluck IV #       define RADEON_DST_Y_MAJOR             (1 <<  2)
7166da3f7d4SAlexander von Gluck IV #       define RADEON_DST_Y_DIR_TOP_TO_BOTTOM (1 << 15)
7176da3f7d4SAlexander von Gluck IV #       define RADEON_DST_X_DIR_LEFT_TO_RIGHT (1 << 31)
7186da3f7d4SAlexander von Gluck IV #define RADEON_DP_DATATYPE                  0x16c4
7196da3f7d4SAlexander von Gluck IV #       define RADEON_HOST_BIG_ENDIAN_EN    (1 << 29)
7206da3f7d4SAlexander von Gluck IV #define RADEON_DP_GUI_MASTER_CNTL           0x146c
7216da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_SRC_PITCH_OFFSET_CNTL   (1    <<  0)
7226da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_PITCH_OFFSET_CNTL   (1    <<  1)
7236da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_SRC_CLIPPING            (1    <<  2)
7246da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_CLIPPING            (1    <<  3)
7256da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_DATATYPE_MASK     (0x0f <<  4)
7266da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_8X8_MONO_FG_BG    (0    <<  4)
7276da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_8X8_MONO_FG_LA    (1    <<  4)
7286da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_1X8_MONO_FG_BG    (4    <<  4)
7296da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_1X8_MONO_FG_LA    (5    <<  4)
7306da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_32x1_MONO_FG_BG   (6    <<  4)
7316da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_32x1_MONO_FG_LA   (7    <<  4)
7326da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_32x32_MONO_FG_BG  (8    <<  4)
7336da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_32x32_MONO_FG_LA  (9    <<  4)
7346da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_8x8_COLOR         (10   <<  4)
7356da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_1X8_COLOR         (12   <<  4)
7366da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_SOLID_COLOR       (13   <<  4)
7376da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BRUSH_NONE              (15   <<  4)
7386da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_8BPP_CI             (2    <<  8)
7396da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_15BPP               (3    <<  8)
7406da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_16BPP               (4    <<  8)
7416da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_24BPP               (5    <<  8)
7426da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_32BPP               (6    <<  8)
7436da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_8BPP_RGB            (7    <<  8)
7446da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_Y8                  (8    <<  8)
7456da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_RGB8                (9    <<  8)
7466da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_VYUY                (11   <<  8)
7476da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_YVYU                (12   <<  8)
7486da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_AYUV444             (14   <<  8)
7496da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_ARGB4444            (15   <<  8)
7506da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_DATATYPE_MASK       (0x0f <<  8)
7516da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_DST_DATATYPE_SHIFT      8
7526da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_SRC_DATATYPE_MASK       (3    << 12)
7536da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_SRC_DATATYPE_MONO_FG_BG (0    << 12)
7546da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_SRC_DATATYPE_MONO_FG_LA (1    << 12)
7556da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_SRC_DATATYPE_COLOR      (3    << 12)
7566da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BYTE_PIX_ORDER          (1    << 14)
7576da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BYTE_MSB_TO_LSB         (0    << 14)
7586da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_BYTE_LSB_TO_MSB         (1    << 14)
7596da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_CONVERSION_TEMP         (1    << 15)
7606da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_CONVERSION_TEMP_6500    (0    << 15)
7616da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_CONVERSION_TEMP_9300    (1    << 15)
7626da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_ROP3_MASK               (0xff << 16)
7636da3f7d4SAlexander von Gluck IV #       define RADEON_DP_SRC_SOURCE_MASK          (7    << 24)
7646da3f7d4SAlexander von Gluck IV #       define RADEON_DP_SRC_SOURCE_MEMORY        (2    << 24)
7656da3f7d4SAlexander von Gluck IV #       define RADEON_DP_SRC_SOURCE_HOST_DATA     (3    << 24)
7666da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_3D_FCN_EN               (1    << 27)
7676da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_CLR_CMP_CNTL_DIS        (1    << 28)
7686da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_AUX_CLIP_DIS            (1    << 29)
7696da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_WR_MSK_DIS              (1    << 30)
7706da3f7d4SAlexander von Gluck IV #       define RADEON_GMC_LD_BRUSH_Y_X            (1    << 31)
7716da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_ZERO             0x00000000
7726da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSa              0x00880000
7736da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_SDna             0x00440000
7746da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_S                0x00cc0000
7756da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSna             0x00220000
7766da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_D                0x00aa0000
7776da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSx              0x00660000
7786da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSo              0x00ee0000
7796da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSon             0x00110000
7806da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSxn             0x00990000
7816da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_Dn               0x00550000
7826da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_SDno             0x00dd0000
7836da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_Sn               0x00330000
7846da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSno             0x00bb0000
7856da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DSan             0x00770000
7866da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_ONE              0x00ff0000
7876da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPa              0x00a00000
7886da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_PDna             0x00500000
7896da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_P                0x00f00000
7906da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPna             0x000a0000
7916da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_D                0x00aa0000
7926da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPx              0x005a0000
7936da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPo              0x00fa0000
7946da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPon             0x00050000
7956da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_PDxn             0x00a50000
7966da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_PDno             0x00f50000
7976da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_Pn               0x000f0000
7986da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPno             0x00af0000
7996da3f7d4SAlexander von Gluck IV #       define RADEON_ROP3_DPan             0x005f0000
8006da3f7d4SAlexander von Gluck IV #define RADEON_DP_GUI_MASTER_CNTL_C         0x1c84
8016da3f7d4SAlexander von Gluck IV #define RADEON_DP_MIX                       0x16c8
8026da3f7d4SAlexander von Gluck IV #define RADEON_DP_SRC_BKGD_CLR              0x15dc
8036da3f7d4SAlexander von Gluck IV #define RADEON_DP_SRC_FRGD_CLR              0x15d8
8046da3f7d4SAlexander von Gluck IV #define RADEON_DP_WRITE_MASK                0x16cc
8056da3f7d4SAlexander von Gluck IV #define RADEON_DST_BRES_DEC                 0x1630
8066da3f7d4SAlexander von Gluck IV #define RADEON_DST_BRES_ERR                 0x1628
8076da3f7d4SAlexander von Gluck IV #define RADEON_DST_BRES_INC                 0x162c
8086da3f7d4SAlexander von Gluck IV #define RADEON_DST_BRES_LNTH                0x1634
8096da3f7d4SAlexander von Gluck IV #define RADEON_DST_BRES_LNTH_SUB            0x1638
8106da3f7d4SAlexander von Gluck IV #define RADEON_DST_HEIGHT                   0x1410
8116da3f7d4SAlexander von Gluck IV #define RADEON_DST_HEIGHT_WIDTH             0x143c
8126da3f7d4SAlexander von Gluck IV #define RADEON_DST_HEIGHT_WIDTH_8           0x158c
8136da3f7d4SAlexander von Gluck IV #define RADEON_DST_HEIGHT_WIDTH_BW          0x15b4
8146da3f7d4SAlexander von Gluck IV #define RADEON_DST_HEIGHT_Y                 0x15a0
8156da3f7d4SAlexander von Gluck IV #define RADEON_DST_LINE_START               0x1600
8166da3f7d4SAlexander von Gluck IV #define RADEON_DST_LINE_END                 0x1604
8176da3f7d4SAlexander von Gluck IV #define RADEON_DST_LINE_PATCOUNT            0x1608
8186da3f7d4SAlexander von Gluck IV #       define RADEON_BRES_CNTL_SHIFT       8
8196da3f7d4SAlexander von Gluck IV #define RADEON_DST_OFFSET                   0x1404
8206da3f7d4SAlexander von Gluck IV #define RADEON_DST_PITCH                    0x1408
8216da3f7d4SAlexander von Gluck IV #define RADEON_DST_PITCH_OFFSET             0x142c
8226da3f7d4SAlexander von Gluck IV #define RADEON_DST_PITCH_OFFSET_C           0x1c80
8236da3f7d4SAlexander von Gluck IV #       define RADEON_PITCH_SHIFT           21
8246da3f7d4SAlexander von Gluck IV #       define RADEON_DST_TILE_LINEAR       (0 << 30)
8256da3f7d4SAlexander von Gluck IV #       define RADEON_DST_TILE_MACRO        (1 << 30)
8266da3f7d4SAlexander von Gluck IV #       define RADEON_DST_TILE_MICRO        (2 << 30)
8276da3f7d4SAlexander von Gluck IV #       define RADEON_DST_TILE_BOTH         (3 << 30)
8286da3f7d4SAlexander von Gluck IV #define RADEON_DST_WIDTH                    0x140c
8296da3f7d4SAlexander von Gluck IV #define RADEON_DST_WIDTH_HEIGHT             0x1598
8306da3f7d4SAlexander von Gluck IV #define RADEON_DST_WIDTH_X                  0x1588
8316da3f7d4SAlexander von Gluck IV #define RADEON_DST_WIDTH_X_INCY             0x159c
8326da3f7d4SAlexander von Gluck IV #define RADEON_DST_X                        0x141c
8336da3f7d4SAlexander von Gluck IV #define RADEON_DST_X_SUB                    0x15a4
8346da3f7d4SAlexander von Gluck IV #define RADEON_DST_X_Y                      0x1594
8356da3f7d4SAlexander von Gluck IV #define RADEON_DST_Y                        0x1420
8366da3f7d4SAlexander von Gluck IV #define RADEON_DST_Y_SUB                    0x15a8
8376da3f7d4SAlexander von Gluck IV #define RADEON_DST_Y_X                      0x1438
8386da3f7d4SAlexander von Gluck IV 
8396da3f7d4SAlexander von Gluck IV #define RADEON_FCP_CNTL                     0x0910
8406da3f7d4SAlexander von Gluck IV #      define RADEON_FCP0_SRC_PCICLK             0
8416da3f7d4SAlexander von Gluck IV #      define RADEON_FCP0_SRC_PCLK               1
8426da3f7d4SAlexander von Gluck IV #      define RADEON_FCP0_SRC_PCLKb              2
8436da3f7d4SAlexander von Gluck IV #      define RADEON_FCP0_SRC_HREF               3
8446da3f7d4SAlexander von Gluck IV #      define RADEON_FCP0_SRC_GND                4
8456da3f7d4SAlexander von Gluck IV #      define RADEON_FCP0_SRC_HREFb              5
8466da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_1                      0x1704
8476da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_2                      0x1708
8486da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_3                      0x170c
8496da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_4                      0x1710
8506da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_5                      0x1714
8516da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_6                      0x1718
8526da3f7d4SAlexander von Gluck IV #define RADEON_FLUSH_7                      0x171c
8536da3f7d4SAlexander von Gluck IV #define RADEON_FOG_3D_TABLE_START           0x1810
8546da3f7d4SAlexander von Gluck IV #define RADEON_FOG_3D_TABLE_END             0x1814
8556da3f7d4SAlexander von Gluck IV #define RADEON_FOG_3D_TABLE_DENSITY         0x181c
8566da3f7d4SAlexander von Gluck IV #define RADEON_FOG_TABLE_INDEX              0x1a14
8576da3f7d4SAlexander von Gluck IV #define RADEON_FOG_TABLE_DATA               0x1a18
8586da3f7d4SAlexander von Gluck IV #define RADEON_FP_CRTC_H_TOTAL_DISP         0x0250
8596da3f7d4SAlexander von Gluck IV #define RADEON_FP_CRTC_V_TOTAL_DISP         0x0254
8606da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_H_TOTAL_MASK      0x000003ff
8616da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_H_DISP_MASK       0x01ff0000
8626da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_V_TOTAL_MASK      0x00000fff
8636da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_V_DISP_MASK       0x0fff0000
8646da3f7d4SAlexander von Gluck IV #       define RADEON_FP_H_SYNC_STRT_CHAR_MASK  0x00001ff8
8656da3f7d4SAlexander von Gluck IV #       define RADEON_FP_H_SYNC_WID_MASK        0x003f0000
8666da3f7d4SAlexander von Gluck IV #       define RADEON_FP_V_SYNC_STRT_MASK       0x00000fff
8676da3f7d4SAlexander von Gluck IV #       define RADEON_FP_V_SYNC_WID_MASK        0x001f0000
8686da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_H_TOTAL_SHIFT     0x00000000
8696da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_H_DISP_SHIFT      0x00000010
8706da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_V_TOTAL_SHIFT     0x00000000
8716da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_V_DISP_SHIFT      0x00000010
8726da3f7d4SAlexander von Gluck IV #       define RADEON_FP_H_SYNC_STRT_CHAR_SHIFT 0x00000003
8736da3f7d4SAlexander von Gluck IV #       define RADEON_FP_H_SYNC_WID_SHIFT       0x00000010
8746da3f7d4SAlexander von Gluck IV #       define RADEON_FP_V_SYNC_STRT_SHIFT      0x00000000
8756da3f7d4SAlexander von Gluck IV #       define RADEON_FP_V_SYNC_WID_SHIFT       0x00000010
8766da3f7d4SAlexander von Gluck IV #define RADEON_FP_GEN_CNTL                  0x0284
8776da3f7d4SAlexander von Gluck IV #       define RADEON_FP_FPON                  (1 <<  0)
8786da3f7d4SAlexander von Gluck IV #       define RADEON_FP_BLANK_EN              (1 <<  1)
8796da3f7d4SAlexander von Gluck IV #       define RADEON_FP_TMDS_EN               (1 <<  2)
8806da3f7d4SAlexander von Gluck IV #       define RADEON_FP_PANEL_FORMAT          (1 <<  3)
8816da3f7d4SAlexander von Gluck IV #       define RADEON_FP_EN_TMDS               (1 <<  7)
8826da3f7d4SAlexander von Gluck IV #       define RADEON_FP_DETECT_SENSE          (1 <<  8)
8836da3f7d4SAlexander von Gluck IV #       define RADEON_FP_DETECT_INT_POL        (1 <<  9)
8846da3f7d4SAlexander von Gluck IV #       define R200_FP_SOURCE_SEL_MASK         (3 <<  10)
8856da3f7d4SAlexander von Gluck IV #       define R200_FP_SOURCE_SEL_CRTC1        (0 <<  10)
8866da3f7d4SAlexander von Gluck IV #       define R200_FP_SOURCE_SEL_CRTC2        (1 <<  10)
8876da3f7d4SAlexander von Gluck IV #       define R200_FP_SOURCE_SEL_RMX          (2 <<  10)
8886da3f7d4SAlexander von Gluck IV #       define R200_FP_SOURCE_SEL_TRANS        (3 <<  10)
8896da3f7d4SAlexander von Gluck IV #       define RADEON_FP_SEL_CRTC1             (0 << 13)
8906da3f7d4SAlexander von Gluck IV #       define RADEON_FP_SEL_CRTC2             (1 << 13)
8916da3f7d4SAlexander von Gluck IV #       define R300_HPD_SEL(x)                 ((x) << 13)
8926da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_DONT_SHADOW_HPAR (1 << 15)
8936da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_DONT_SHADOW_VPAR (1 << 16)
8946da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_DONT_SHADOW_HEND (1 << 17)
8956da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_USE_SHADOW_VEND  (1 << 18)
8966da3f7d4SAlexander von Gluck IV #       define RADEON_FP_RMX_HVSYNC_CONTROL_EN (1 << 20)
8976da3f7d4SAlexander von Gluck IV #       define RADEON_FP_DFP_SYNC_SEL          (1 << 21)
8986da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRTC_LOCK_8DOT        (1 << 22)
8996da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRT_SYNC_SEL          (1 << 23)
9006da3f7d4SAlexander von Gluck IV #       define RADEON_FP_USE_SHADOW_EN         (1 << 24)
9016da3f7d4SAlexander von Gluck IV #       define RADEON_FP_CRT_SYNC_ALT          (1 << 26)
9026da3f7d4SAlexander von Gluck IV #define RADEON_FP2_GEN_CNTL                 0x0288
9036da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_BLANK_EN             (1 <<  1)
9046da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_ON                   (1 <<  2)
9056da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_PANEL_FORMAT         (1 <<  3)
9066da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_DETECT_SENSE         (1 <<  8)
9076da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_DETECT_INT_POL       (1 <<  9)
9086da3f7d4SAlexander von Gluck IV #       define R200_FP2_SOURCE_SEL_MASK        (3 << 10)
9096da3f7d4SAlexander von Gluck IV #       define R200_FP2_SOURCE_SEL_CRTC1       (0 << 10)
9106da3f7d4SAlexander von Gluck IV #       define R200_FP2_SOURCE_SEL_CRTC2       (1 << 10)
9116da3f7d4SAlexander von Gluck IV #       define R200_FP2_SOURCE_SEL_RMX         (2 << 10)
9126da3f7d4SAlexander von Gluck IV #       define R200_FP2_SOURCE_SEL_TRANS_UNIT  (3 << 10)
9136da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_SRC_SEL_MASK         (3 << 13)
9146da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_SRC_SEL_CRTC2        (1 << 13)
9156da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_FP_POL               (1 << 16)
9166da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_LP_POL               (1 << 17)
9176da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_SCK_POL              (1 << 18)
9186da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_LCD_CNTL_MASK        (7 << 19)
9196da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_PAD_FLOP_EN          (1 << 22)
9206da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_CRC_EN               (1 << 23)
9216da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_CRC_READ_EN          (1 << 24)
9226da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_DVO_EN               (1 << 25)
9236da3f7d4SAlexander von Gluck IV #       define RADEON_FP2_DVO_RATE_SEL_SDR     (1 << 26)
9246da3f7d4SAlexander von Gluck IV #       define R200_FP2_DVO_RATE_SEL_SDR       (1 << 27)
9256da3f7d4SAlexander von Gluck IV #       define R300_FP2_DVO_CLOCK_MODE_SINGLE  (1 << 28)
9266da3f7d4SAlexander von Gluck IV #       define R300_FP2_DVO_DUAL_CHANNEL_EN    (1 << 29)
9276da3f7d4SAlexander von Gluck IV #define RADEON_FP_H_SYNC_STRT_WID           0x02c4
9286da3f7d4SAlexander von Gluck IV #define RADEON_FP_H2_SYNC_STRT_WID          0x03c4
9296da3f7d4SAlexander von Gluck IV #define RADEON_FP_HORZ_STRETCH              0x028c
9306da3f7d4SAlexander von Gluck IV #define RADEON_FP_HORZ2_STRETCH             0x038c
9316da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_STRETCH_RATIO_MASK 0xffff
9326da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_STRETCH_RATIO_MAX  4096
9336da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_PANEL_SIZE         (0x1ff   << 16)
9346da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_PANEL_SHIFT        16
9356da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_STRETCH_PIXREP     (0      << 25)
9366da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_STRETCH_BLEND      (1      << 26)
9376da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_STRETCH_ENABLE     (1      << 25)
9386da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_AUTO_RATIO         (1      << 27)
9396da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_FP_LOOP_STRETCH    (0x7    << 28)
9406da3f7d4SAlexander von Gluck IV #       define RADEON_HORZ_AUTO_RATIO_INC     (1      << 31)
9416da3f7d4SAlexander von Gluck IV #define RADEON_FP_HORZ_VERT_ACTIVE          0x0278
9426da3f7d4SAlexander von Gluck IV #define RADEON_FP_V_SYNC_STRT_WID           0x02c8
9436da3f7d4SAlexander von Gluck IV #define RADEON_FP_VERT_STRETCH              0x0290
9446da3f7d4SAlexander von Gluck IV #define RADEON_FP_V2_SYNC_STRT_WID          0x03c8
9456da3f7d4SAlexander von Gluck IV #define RADEON_FP_VERT2_STRETCH             0x0390
9466da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_PANEL_SIZE          (0xfff << 12)
9476da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_PANEL_SHIFT         12
9486da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_RATIO_MASK  0xfff
9496da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_RATIO_SHIFT 0
9506da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_RATIO_MAX   4096
9516da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_ENABLE      (1     << 25)
9526da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_LINEREP     (0     << 26)
9536da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_BLEND       (1     << 26)
9546da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_AUTO_RATIO_EN       (1     << 27)
9556da3f7d4SAlexander von Gluck IV #	define RADEON_VERT_AUTO_RATIO_INC      (1     << 31)
9566da3f7d4SAlexander von Gluck IV #       define RADEON_VERT_STRETCH_RESERVED    0x71000000
9576da3f7d4SAlexander von Gluck IV #define RS400_FP_2ND_GEN_CNTL               0x0384
9586da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_ON              (1 << 0)
9596da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_BLANK_EN        (1 << 1)
9606da3f7d4SAlexander von Gluck IV #       define RS400_TMDS_2ND_EN            (1 << 2)
9616da3f7d4SAlexander von Gluck IV #       define RS400_PANEL_FORMAT_2ND       (1 << 3)
9626da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_EN_TMDS         (1 << 7)
9636da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_DETECT_SENSE    (1 << 8)
9646da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_SOURCE_SEL_MASK        (3 << 10)
9656da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_SOURCE_SEL_CRTC1       (0 << 10)
9666da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_SOURCE_SEL_CRTC2       (1 << 10)
9676da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_SOURCE_SEL_RMX         (2 << 10)
9686da3f7d4SAlexander von Gluck IV #       define RS400_FP_2ND_DETECT_EN       (1 << 12)
9696da3f7d4SAlexander von Gluck IV #       define RS400_HPD_2ND_SEL            (1 << 13)
9706da3f7d4SAlexander von Gluck IV #define RS400_FP2_2_GEN_CNTL                0x0388
9716da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_BLANK_EN         (1 << 1)
9726da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_ON               (1 << 2)
9736da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_PANEL_FORMAT     (1 << 3)
9746da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_DETECT_SENSE     (1 << 8)
9756da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_SOURCE_SEL_MASK        (3 << 10)
9766da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_SOURCE_SEL_CRTC1       (0 << 10)
9776da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_SOURCE_SEL_CRTC2       (1 << 10)
9786da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_SOURCE_SEL_RMX         (2 << 10)
9796da3f7d4SAlexander von Gluck IV #       define RS400_FP2_2_DVO2_EN          (1 << 25)
9806da3f7d4SAlexander von Gluck IV #define RS400_TMDS2_CNTL                    0x0394
9816da3f7d4SAlexander von Gluck IV #define RS400_TMDS2_TRANSMITTER_CNTL        0x03a4
9826da3f7d4SAlexander von Gluck IV #       define RS400_TMDS2_PLLEN            (1 << 0)
9836da3f7d4SAlexander von Gluck IV #       define RS400_TMDS2_PLLRST           (1 << 1)
9846da3f7d4SAlexander von Gluck IV 
9856da3f7d4SAlexander von Gluck IV #define RADEON_GEN_INT_CNTL                 0x0040
9866da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_VBLANK_MASK		(1 << 0)
9876da3f7d4SAlexander von Gluck IV #	define RADEON_FP_DETECT_MASK		(1 << 4)
9886da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC2_VBLANK_MASK		(1 << 9)
9896da3f7d4SAlexander von Gluck IV #	define RADEON_FP2_DETECT_MASK		(1 << 10)
9906da3f7d4SAlexander von Gluck IV #	define RADEON_GUI_IDLE_MASK		(1 << 19)
9916da3f7d4SAlexander von Gluck IV #	define RADEON_SW_INT_ENABLE		(1 << 25)
9926da3f7d4SAlexander von Gluck IV #define RADEON_GEN_INT_STATUS               0x0044
9936da3f7d4SAlexander von Gluck IV #	define AVIVO_DISPLAY_INT_STATUS		(1 << 0)
9946da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_VBLANK_STAT		(1 << 0)
9956da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC_VBLANK_STAT_ACK	(1 << 0)
9966da3f7d4SAlexander von Gluck IV #	define RADEON_FP_DETECT_STAT		(1 << 4)
9976da3f7d4SAlexander von Gluck IV #	define RADEON_FP_DETECT_STAT_ACK	(1 << 4)
9986da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC2_VBLANK_STAT		(1 << 9)
9996da3f7d4SAlexander von Gluck IV #	define RADEON_CRTC2_VBLANK_STAT_ACK	(1 << 9)
10006da3f7d4SAlexander von Gluck IV #	define RADEON_FP2_DETECT_STAT		(1 << 10)
10016da3f7d4SAlexander von Gluck IV #	define RADEON_FP2_DETECT_STAT_ACK	(1 << 10)
10026da3f7d4SAlexander von Gluck IV #	define RADEON_GUI_IDLE_STAT		(1 << 19)
10036da3f7d4SAlexander von Gluck IV #	define RADEON_GUI_IDLE_STAT_ACK		(1 << 19)
10046da3f7d4SAlexander von Gluck IV #	define RADEON_SW_INT_FIRE		(1 << 26)
10056da3f7d4SAlexander von Gluck IV #	define RADEON_SW_INT_TEST		(1 << 25)
10066da3f7d4SAlexander von Gluck IV #	define RADEON_SW_INT_TEST_ACK		(1 << 25)
10076da3f7d4SAlexander von Gluck IV #define RADEON_GENENB                       0x03c3 /* VGA */
10086da3f7d4SAlexander von Gluck IV #define RADEON_GENFC_RD                     0x03ca /* VGA */
10096da3f7d4SAlexander von Gluck IV #define RADEON_GENFC_WT                     0x03da /* VGA, 0x03ba */
10106da3f7d4SAlexander von Gluck IV #define RADEON_GENMO_RD                     0x03cc /* VGA */
10116da3f7d4SAlexander von Gluck IV #define RADEON_GENMO_WT                     0x03c2 /* VGA */
10126da3f7d4SAlexander von Gluck IV #define RADEON_GENS0                        0x03c2 /* VGA */
10136da3f7d4SAlexander von Gluck IV #define RADEON_GENS1                        0x03da /* VGA, 0x03ba */
10146da3f7d4SAlexander von Gluck IV #define RADEON_GPIO_MONID                   0x0068 /* DDC interface via I2C */ /* DDC3 */
10156da3f7d4SAlexander von Gluck IV #define RADEON_GPIO_MONIDB                  0x006c
10166da3f7d4SAlexander von Gluck IV #define RADEON_GPIO_CRT2_DDC                0x006c
10176da3f7d4SAlexander von Gluck IV #define RADEON_GPIO_DVI_DDC                 0x0064 /* DDC2 */
10186da3f7d4SAlexander von Gluck IV #define RADEON_GPIO_VGA_DDC                 0x0060 /* DDC1 */
10196da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_A_0              (1 <<  0)
10206da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_A_1              (1 <<  1)
10216da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_Y_0              (1 <<  8)
10226da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_Y_1              (1 <<  9)
10236da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_Y_SHIFT_0        8
10246da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_Y_SHIFT_1        9
10256da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_EN_0             (1 << 16)
10266da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_EN_1             (1 << 17)
10276da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_MASK_0           (1 << 24) /*??*/
10286da3f7d4SAlexander von Gluck IV #       define RADEON_GPIO_MASK_1           (1 << 25) /*??*/
10296da3f7d4SAlexander von Gluck IV #define RADEON_GRPH8_DATA                   0x03cf /* VGA */
10306da3f7d4SAlexander von Gluck IV #define RADEON_GRPH8_IDX                    0x03ce /* VGA */
10316da3f7d4SAlexander von Gluck IV #define RADEON_GUI_SCRATCH_REG0             0x15e0
10326da3f7d4SAlexander von Gluck IV #define RADEON_GUI_SCRATCH_REG1             0x15e4
10336da3f7d4SAlexander von Gluck IV #define RADEON_GUI_SCRATCH_REG2             0x15e8
10346da3f7d4SAlexander von Gluck IV #define RADEON_GUI_SCRATCH_REG3             0x15ec
10356da3f7d4SAlexander von Gluck IV #define RADEON_GUI_SCRATCH_REG4             0x15f0
10366da3f7d4SAlexander von Gluck IV #define RADEON_GUI_SCRATCH_REG5             0x15f4
10376da3f7d4SAlexander von Gluck IV 
10386da3f7d4SAlexander von Gluck IV #define RADEON_HEADER                       0x0f0e /* PCI */
10396da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA0                   0x17c0
10406da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA1                   0x17c4
10416da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA2                   0x17c8
10426da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA3                   0x17cc
10436da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA4                   0x17d0
10446da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA5                   0x17d4
10456da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA6                   0x17d8
10466da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA7                   0x17dc
10476da3f7d4SAlexander von Gluck IV #define RADEON_HOST_DATA_LAST               0x17e0
10486da3f7d4SAlexander von Gluck IV #define RADEON_HOST_PATH_CNTL               0x0130
10496da3f7d4SAlexander von Gluck IV #	define RADEON_HP_LIN_RD_CACHE_DIS   (1 << 24)
10506da3f7d4SAlexander von Gluck IV #	define RADEON_HDP_READ_BUFFER_INVALIDATE   (1 << 27)
10516da3f7d4SAlexander von Gluck IV #       define RADEON_HDP_SOFT_RESET        (1 << 26)
10526da3f7d4SAlexander von Gluck IV #       define RADEON_HDP_APER_CNTL         (1 << 23)
10536da3f7d4SAlexander von Gluck IV #define RADEON_HTOTAL_CNTL                  0x0009 /* PLL */
10546da3f7d4SAlexander von Gluck IV #       define RADEON_HTOT_CNTL_VGA_EN      (1 << 28)
10556da3f7d4SAlexander von Gluck IV #define RADEON_HTOTAL2_CNTL                 0x002e /* PLL */
10566da3f7d4SAlexander von Gluck IV 
10576da3f7d4SAlexander von Gluck IV        /* Multimedia I2C bus */
10586da3f7d4SAlexander von Gluck IV #define RADEON_I2C_CNTL_0		    0x0090
10596da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_DONE              (1 << 0)
10606da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_NACK              (1 << 1)
10616da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_HALT              (1 << 2)
10626da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_SOFT_RST          (1 << 5)
10636da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_DRIVE_EN          (1 << 6)
10646da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_DRIVE_SEL         (1 << 7)
10656da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_START             (1 << 8)
10666da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_STOP              (1 << 9)
10676da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_RECEIVE           (1 << 10)
10686da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_ABORT             (1 << 11)
10696da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_GO                (1 << 12)
10706da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_PRESCALE_SHIFT    16
10716da3f7d4SAlexander von Gluck IV #define RADEON_I2C_CNTL_1                   0x0094
10726da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_DATA_COUNT_SHIFT  0
10736da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_ADDR_COUNT_SHIFT  4
10746da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_INTRA_BYTE_DELAY_SHIFT   8
10756da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_SEL               (1 << 16)
10766da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_EN                (1 << 17)
10776da3f7d4SAlexander von Gluck IV #       define RADEON_I2C_TIME_LIMIT_SHIFT  24
10786da3f7d4SAlexander von Gluck IV #define RADEON_I2C_DATA			    0x0098
10796da3f7d4SAlexander von Gluck IV 
10806da3f7d4SAlexander von Gluck IV #define RADEON_DVI_I2C_CNTL_0		    0x02e0
10816da3f7d4SAlexander von Gluck IV #       define R200_DVI_I2C_PIN_SEL(x)      ((x) << 3)
10826da3f7d4SAlexander von Gluck IV #       define R200_SEL_DDC1                0 /* depends on asic */
10836da3f7d4SAlexander von Gluck IV #       define R200_SEL_DDC2                1 /* depends on asic */
10846da3f7d4SAlexander von Gluck IV #       define R200_SEL_DDC3                2 /* depends on asic */
10856da3f7d4SAlexander von Gluck IV #	define RADEON_SW_WANTS_TO_USE_DVI_I2C (1 << 13)
10866da3f7d4SAlexander von Gluck IV #	define RADEON_SW_CAN_USE_DVI_I2C      (1 << 13)
10876da3f7d4SAlexander von Gluck IV #	define RADEON_SW_DONE_USING_DVI_I2C   (1 << 14)
10886da3f7d4SAlexander von Gluck IV #	define RADEON_HW_NEEDS_DVI_I2C        (1 << 14)
10896da3f7d4SAlexander von Gluck IV #	define RADEON_ABORT_HW_DVI_I2C        (1 << 15)
10906da3f7d4SAlexander von Gluck IV #	define RADEON_HW_USING_DVI_I2C        (1 << 15)
10916da3f7d4SAlexander von Gluck IV #define RADEON_DVI_I2C_CNTL_1               0x02e4
10926da3f7d4SAlexander von Gluck IV #define RADEON_DVI_I2C_DATA		    0x02e8
10936da3f7d4SAlexander von Gluck IV 
10946da3f7d4SAlexander von Gluck IV #define RADEON_INTERRUPT_LINE               0x0f3c /* PCI */
10956da3f7d4SAlexander von Gluck IV #define RADEON_INTERRUPT_PIN                0x0f3d /* PCI */
10966da3f7d4SAlexander von Gluck IV #define RADEON_IO_BASE                      0x0f14 /* PCI */
10976da3f7d4SAlexander von Gluck IV 
10986da3f7d4SAlexander von Gluck IV #define RADEON_LATENCY                      0x0f0d /* PCI */
10996da3f7d4SAlexander von Gluck IV #define RADEON_LEAD_BRES_DEC                0x1608
11006da3f7d4SAlexander von Gluck IV #define RADEON_LEAD_BRES_LNTH               0x161c
11016da3f7d4SAlexander von Gluck IV #define RADEON_LEAD_BRES_LNTH_SUB           0x1624
11026da3f7d4SAlexander von Gluck IV #define RADEON_LVDS_GEN_CNTL                0x02d0
11036da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_ON               (1   <<  0)
11046da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_DISPLAY_DIS      (1   <<  1)
11056da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_PANEL_TYPE       (1   <<  2)
11066da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_PANEL_FORMAT     (1   <<  3)
11076da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_NO_FM            (0   <<  4)
11086da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_2_GREY           (1   <<  4)
11096da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_4_GREY           (2   <<  4)
11106da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_RST_FM           (1   <<  6)
11116da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_EN               (1   <<  7)
11126da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_BL_MOD_LEVEL_SHIFT 8
11136da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_BL_MOD_LEVEL_MASK (0xff << 8)
11146da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_BL_MOD_EN        (1   << 16)
11156da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_BL_CLK_SEL       (1   << 17)
11166da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_DIGON            (1   << 18)
11176da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_BLON             (1   << 19)
11186da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_FP_POL_LOW       (1   << 20)
11196da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_LP_POL_LOW       (1   << 21)
11206da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_DTM_POL_LOW      (1   << 22)
11216da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_SEL_CRTC2        (1   << 23)
11226da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_FPDI_EN          (1   << 27)
11236da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_HSYNC_DELAY_SHIFT        28
11246da3f7d4SAlexander von Gluck IV #define RADEON_LVDS_PLL_CNTL                0x02d4
11256da3f7d4SAlexander von Gluck IV #       define RADEON_HSYNC_DELAY_SHIFT     28
11266da3f7d4SAlexander von Gluck IV #       define RADEON_HSYNC_DELAY_MASK      (0xf << 28)
11276da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_PLL_EN           (1   << 16)
11286da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_PLL_RESET        (1   << 17)
11296da3f7d4SAlexander von Gluck IV #       define R300_LVDS_SRC_SEL_MASK       (3   << 18)
11306da3f7d4SAlexander von Gluck IV #       define R300_LVDS_SRC_SEL_CRTC1      (0   << 18)
11316da3f7d4SAlexander von Gluck IV #       define R300_LVDS_SRC_SEL_CRTC2      (1   << 18)
11326da3f7d4SAlexander von Gluck IV #       define R300_LVDS_SRC_SEL_RMX        (2   << 18)
11336da3f7d4SAlexander von Gluck IV #define RADEON_LVDS_SS_GEN_CNTL             0x02ec
11346da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_PWRSEQ_DELAY1_SHIFT     16
11356da3f7d4SAlexander von Gluck IV #       define RADEON_LVDS_PWRSEQ_DELAY2_SHIFT     20
11366da3f7d4SAlexander von Gluck IV 
11376da3f7d4SAlexander von Gluck IV #define RADEON_MAX_LATENCY                  0x0f3f /* PCI */
11386da3f7d4SAlexander von Gluck IV #define RADEON_DISPLAY_BASE_ADDR            0x23c
11396da3f7d4SAlexander von Gluck IV #define RADEON_DISPLAY2_BASE_ADDR           0x33c
11406da3f7d4SAlexander von Gluck IV #define RADEON_OV0_BASE_ADDR                0x43c
11416da3f7d4SAlexander von Gluck IV #define RADEON_NB_TOM                       0x15c
11426da3f7d4SAlexander von Gluck IV #define R300_MC_INIT_MISC_LAT_TIMER         0x180
11436da3f7d4SAlexander von Gluck IV #       define R300_MC_DISP0R_INIT_LAT_SHIFT 8
11446da3f7d4SAlexander von Gluck IV #       define R300_MC_DISP0R_INIT_LAT_MASK  0xf
11456da3f7d4SAlexander von Gluck IV #       define R300_MC_DISP1R_INIT_LAT_SHIFT 12
11466da3f7d4SAlexander von Gluck IV #       define R300_MC_DISP1R_INIT_LAT_MASK  0xf
11476da3f7d4SAlexander von Gluck IV #define RADEON_MCLK_CNTL                    0x0012 /* PLL */
11486da3f7d4SAlexander von Gluck IV #       define RADEON_MCLKA_SRC_SEL_MASK    0x7
11496da3f7d4SAlexander von Gluck IV #       define RADEON_FORCEON_MCLKA         (1 << 16)
11506da3f7d4SAlexander von Gluck IV #       define RADEON_FORCEON_MCLKB         (1 << 17)
11516da3f7d4SAlexander von Gluck IV #       define RADEON_FORCEON_YCLKA         (1 << 18)
11526da3f7d4SAlexander von Gluck IV #       define RADEON_FORCEON_YCLKB         (1 << 19)
11536da3f7d4SAlexander von Gluck IV #       define RADEON_FORCEON_MC            (1 << 20)
11546da3f7d4SAlexander von Gluck IV #       define RADEON_FORCEON_AIC           (1 << 21)
11556da3f7d4SAlexander von Gluck IV #       define R300_DISABLE_MC_MCLKA        (1 << 21)
11566da3f7d4SAlexander von Gluck IV #       define R300_DISABLE_MC_MCLKB        (1 << 21)
11576da3f7d4SAlexander von Gluck IV #define RADEON_MCLK_MISC                    0x001f /* PLL */
11586da3f7d4SAlexander von Gluck IV #       define RADEON_MC_MCLK_MAX_DYN_STOP_LAT (1 << 12)
11596da3f7d4SAlexander von Gluck IV #       define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1 << 13)
11606da3f7d4SAlexander von Gluck IV #       define RADEON_MC_MCLK_DYN_ENABLE    (1 << 14)
11616da3f7d4SAlexander von Gluck IV #       define RADEON_IO_MCLK_DYN_ENABLE    (1 << 15)
11626da3f7d4SAlexander von Gluck IV 
11636da3f7d4SAlexander von Gluck IV #define RADEON_GPIOPAD_MASK                 0x0198
11646da3f7d4SAlexander von Gluck IV #define RADEON_GPIOPAD_A		    0x019c
11656da3f7d4SAlexander von Gluck IV #define RADEON_GPIOPAD_EN                   0x01a0
11666da3f7d4SAlexander von Gluck IV #define RADEON_GPIOPAD_Y                    0x01a4
11676da3f7d4SAlexander von Gluck IV #define RADEON_MDGPIO_MASK                  0x01a8
11686da3f7d4SAlexander von Gluck IV #define RADEON_MDGPIO_A                     0x01ac
11696da3f7d4SAlexander von Gluck IV #define RADEON_MDGPIO_EN                    0x01b0
11706da3f7d4SAlexander von Gluck IV #define RADEON_MDGPIO_Y                     0x01b4
11716da3f7d4SAlexander von Gluck IV 
11726da3f7d4SAlexander von Gluck IV #define RADEON_MEM_ADDR_CONFIG              0x0148
11736da3f7d4SAlexander von Gluck IV #define RADEON_MEM_BASE                     0x0f10 /* PCI */
11746da3f7d4SAlexander von Gluck IV #define RADEON_MEM_CNTL                     0x0140
11756da3f7d4SAlexander von Gluck IV #       define RADEON_MEM_NUM_CHANNELS_MASK 0x01
11766da3f7d4SAlexander von Gluck IV #       define RADEON_MEM_USE_B_CH_ONLY     (1 <<  1)
11776da3f7d4SAlexander von Gluck IV #       define RV100_HALF_MODE              (1 <<  3)
11786da3f7d4SAlexander von Gluck IV #       define R300_MEM_NUM_CHANNELS_MASK   0x03
11796da3f7d4SAlexander von Gluck IV #       define R300_MEM_USE_CD_CH_ONLY      (1 <<  2)
11806da3f7d4SAlexander von Gluck IV #define RADEON_MEM_TIMING_CNTL              0x0144 /* EXT_MEM_CNTL */
11816da3f7d4SAlexander von Gluck IV #define RADEON_MEM_INIT_LAT_TIMER           0x0154
11826da3f7d4SAlexander von Gluck IV #define RADEON_MEM_INTF_CNTL                0x014c
11836da3f7d4SAlexander von Gluck IV #define RADEON_MEM_SDRAM_MODE_REG           0x0158
11846da3f7d4SAlexander von Gluck IV #       define RADEON_SDRAM_MODE_MASK       0xffff0000
11856da3f7d4SAlexander von Gluck IV #       define RADEON_B3MEM_RESET_MASK      0x6fffffff
11866da3f7d4SAlexander von Gluck IV #       define RADEON_MEM_CFG_TYPE_DDR      (1 << 30)
11876da3f7d4SAlexander von Gluck IV #define RADEON_MEM_STR_CNTL                 0x0150
11886da3f7d4SAlexander von Gluck IV #       define RADEON_MEM_PWRUP_COMPL_A     (1 <<  0)
11896da3f7d4SAlexander von Gluck IV #       define RADEON_MEM_PWRUP_COMPL_B     (1 <<  1)
11906da3f7d4SAlexander von Gluck IV #       define R300_MEM_PWRUP_COMPL_C       (1 <<  2)
11916da3f7d4SAlexander von Gluck IV #       define R300_MEM_PWRUP_COMPL_D       (1 <<  3)
11926da3f7d4SAlexander von Gluck IV #       define RADEON_MEM_PWRUP_COMPLETE    0x03
11936da3f7d4SAlexander von Gluck IV #       define R300_MEM_PWRUP_COMPLETE      0x0f
11946da3f7d4SAlexander von Gluck IV #define RADEON_MC_STATUS                    0x0150
11956da3f7d4SAlexander von Gluck IV #       define RADEON_MC_IDLE               (1 << 2)
11966da3f7d4SAlexander von Gluck IV #       define R300_MC_IDLE                 (1 << 4)
11976da3f7d4SAlexander von Gluck IV #define RADEON_MEM_VGA_RP_SEL               0x003c
11986da3f7d4SAlexander von Gluck IV #define RADEON_MEM_VGA_WP_SEL               0x0038
11996da3f7d4SAlexander von Gluck IV #define RADEON_MIN_GRANT                    0x0f3e /* PCI */
12006da3f7d4SAlexander von Gluck IV #define RADEON_MM_DATA                      0x0004
12016da3f7d4SAlexander von Gluck IV #define RADEON_MM_INDEX                     0x0000
12026da3f7d4SAlexander von Gluck IV #	define RADEON_MM_APER		(1 << 31)
12036da3f7d4SAlexander von Gluck IV #define RADEON_MPLL_CNTL                    0x000e /* PLL */
12046da3f7d4SAlexander von Gluck IV #define RADEON_MPP_TB_CONFIG                0x01c0 /* ? */
12056da3f7d4SAlexander von Gluck IV #define RADEON_MPP_GP_CONFIG                0x01c8 /* ? */
12066da3f7d4SAlexander von Gluck IV #define RADEON_SEPROM_CNTL1                 0x01c0
12076da3f7d4SAlexander von Gluck IV #       define RADEON_SCK_PRESCALE_SHIFT    24
12086da3f7d4SAlexander von Gluck IV #       define RADEON_SCK_PRESCALE_MASK     (0xff << 24)
12096da3f7d4SAlexander von Gluck IV #define R300_MC_IND_INDEX                   0x01f8
12106da3f7d4SAlexander von Gluck IV #       define R300_MC_IND_ADDR_MASK        0x3f
12116da3f7d4SAlexander von Gluck IV #       define R300_MC_IND_WR_EN            (1 << 8)
12126da3f7d4SAlexander von Gluck IV #define R300_MC_IND_DATA                    0x01fc
12136da3f7d4SAlexander von Gluck IV #define R300_MC_READ_CNTL_AB                0x017c
12146da3f7d4SAlexander von Gluck IV #       define R300_MEM_RBS_POSITION_A_MASK 0x03
12156da3f7d4SAlexander von Gluck IV #define R300_MC_READ_CNTL_CD_mcind	    0x24
12166da3f7d4SAlexander von Gluck IV #       define R300_MEM_RBS_POSITION_C_MASK 0x03
12176da3f7d4SAlexander von Gluck IV 
12186da3f7d4SAlexander von Gluck IV #define RADEON_N_VIF_COUNT                  0x0248
12196da3f7d4SAlexander von Gluck IV 
12206da3f7d4SAlexander von Gluck IV #define RADEON_OV0_AUTO_FLIP_CNTL           0x0470
12216da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_NUM        0x00000007
12226da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_SOFT_REPEAT_FIELD   0x00000008
12236da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_SOFT_BUF_ODD        0x00000010
12246da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_IGNORE_REPEAT_FIELD 0x00000020
12256da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_SOFT_EOF_TOGGLE     0x00000040
12266da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_VID_PORT_SELECT     0x00000300
12276da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_P1_FIRST_LINE_EVEN  0x00010000
12286da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_EVEN_DOWN     0x00040000
12296da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_SHIFT_ODD_DOWN      0x00080000
12306da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_AUTO_FLIP_CNTL_FIELD_POL_SOURCE    0x00800000
12316da3f7d4SAlexander von Gluck IV 
12326da3f7d4SAlexander von Gluck IV #define RADEON_OV0_COLOUR_CNTL              0x04E0
12336da3f7d4SAlexander von Gluck IV #define RADEON_OV0_DEINTERLACE_PATTERN      0x0474
12346da3f7d4SAlexander von Gluck IV #define RADEON_OV0_EXCLUSIVE_HORZ           0x0408
12356da3f7d4SAlexander von Gluck IV #       define  RADEON_EXCL_HORZ_START_MASK        0x000000ff
12366da3f7d4SAlexander von Gluck IV #       define  RADEON_EXCL_HORZ_END_MASK          0x0000ff00
12376da3f7d4SAlexander von Gluck IV #       define  RADEON_EXCL_HORZ_BACK_PORCH_MASK   0x00ff0000
12386da3f7d4SAlexander von Gluck IV #       define  RADEON_EXCL_HORZ_EXCLUSIVE_EN      0x80000000
12396da3f7d4SAlexander von Gluck IV #define RADEON_OV0_EXCLUSIVE_VERT           0x040C
12406da3f7d4SAlexander von Gluck IV #       define  RADEON_EXCL_VERT_START_MASK        0x000003ff
12416da3f7d4SAlexander von Gluck IV #       define  RADEON_EXCL_VERT_END_MASK          0x03ff0000
12426da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FILTER_CNTL              0x04A0
12436da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_PROGRAMMABLE_COEF            0x0
12446da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_HC_COEF_HORZ_Y               0x1
12456da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_HC_COEF_HORZ_UV              0x2
12466da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_HC_COEF_VERT_Y               0x4
12476da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_HC_COEF_VERT_UV              0x8
12486da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_HARDCODED_COEF               0xf
12496da3f7d4SAlexander von Gluck IV #       define RADEON_FILTER_COEF_MASK                    0xf
12506da3f7d4SAlexander von Gluck IV 
12516da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FOUR_TAP_COEF_0          0x04B0
12526da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FOUR_TAP_COEF_1          0x04B4
12536da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FOUR_TAP_COEF_2          0x04B8
12546da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FOUR_TAP_COEF_3          0x04BC
12556da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FOUR_TAP_COEF_4          0x04C0
12566da3f7d4SAlexander von Gluck IV #define RADEON_OV0_FLAG_CNTL                0x04DC
12576da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_000_00F            0x0d40
12586da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_010_01F            0x0d44
12596da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_020_03F            0x0d48
12606da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_040_07F            0x0d4c
12616da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_080_0BF            0x0e00
12626da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_0C0_0FF            0x0e04
12636da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_100_13F            0x0e08
12646da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_140_17F            0x0e0c
12656da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_180_1BF            0x0e10
12666da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_1C0_1FF            0x0e14
12676da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_200_23F            0x0e18
12686da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_240_27F            0x0e1c
12696da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_280_2BF            0x0e20
12706da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_2C0_2FF            0x0e24
12716da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_300_33F            0x0e28
12726da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_340_37F            0x0e2c
12736da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_380_3BF            0x0d50
12746da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GAMMA_3C0_3FF            0x0d54
12756da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GRAPHICS_KEY_CLR_LOW     0x04EC
12766da3f7d4SAlexander von Gluck IV #define RADEON_OV0_GRAPHICS_KEY_CLR_HIGH    0x04F0
12776da3f7d4SAlexander von Gluck IV #define RADEON_OV0_H_INC                    0x0480
12786da3f7d4SAlexander von Gluck IV #define RADEON_OV0_KEY_CNTL                 0x04F4
12796da3f7d4SAlexander von Gluck IV #       define  RADEON_VIDEO_KEY_FN_MASK    0x00000003L
12806da3f7d4SAlexander von Gluck IV #       define  RADEON_VIDEO_KEY_FN_FALSE   0x00000000L
12816da3f7d4SAlexander von Gluck IV #       define  RADEON_VIDEO_KEY_FN_TRUE    0x00000001L
12826da3f7d4SAlexander von Gluck IV #       define  RADEON_VIDEO_KEY_FN_EQ      0x00000002L
12836da3f7d4SAlexander von Gluck IV #       define  RADEON_VIDEO_KEY_FN_NE      0x00000003L
12846da3f7d4SAlexander von Gluck IV #       define  RADEON_GRAPHIC_KEY_FN_MASK  0x00000030L
12856da3f7d4SAlexander von Gluck IV #       define  RADEON_GRAPHIC_KEY_FN_FALSE 0x00000000L
12866da3f7d4SAlexander von Gluck IV #       define  RADEON_GRAPHIC_KEY_FN_TRUE  0x00000010L
12876da3f7d4SAlexander von Gluck IV #       define  RADEON_GRAPHIC_KEY_FN_EQ    0x00000020L
12886da3f7d4SAlexander von Gluck IV #       define  RADEON_GRAPHIC_KEY_FN_NE    0x00000030L
12896da3f7d4SAlexander von Gluck IV #       define  RADEON_CMP_MIX_MASK         0x00000100L
12906da3f7d4SAlexander von Gluck IV #       define  RADEON_CMP_MIX_OR           0x00000000L
12916da3f7d4SAlexander von Gluck IV #       define  RADEON_CMP_MIX_AND          0x00000100L
12926da3f7d4SAlexander von Gluck IV #define RADEON_OV0_LIN_TRANS_A              0x0d20
12936da3f7d4SAlexander von Gluck IV #define RADEON_OV0_LIN_TRANS_B              0x0d24
12946da3f7d4SAlexander von Gluck IV #define RADEON_OV0_LIN_TRANS_C              0x0d28
12956da3f7d4SAlexander von Gluck IV #define RADEON_OV0_LIN_TRANS_D              0x0d2c
12966da3f7d4SAlexander von Gluck IV #define RADEON_OV0_LIN_TRANS_E              0x0d30
12976da3f7d4SAlexander von Gluck IV #define RADEON_OV0_LIN_TRANS_F              0x0d34
12986da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P1_BLANK_LINES_AT_TOP    0x0430
12996da3f7d4SAlexander von Gluck IV #       define  RADEON_P1_BLNK_LN_AT_TOP_M1_MASK   0x00000fffL
13006da3f7d4SAlexander von Gluck IV #       define  RADEON_P1_ACTIVE_LINES_M1          0x0fff0000L
13016da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P1_H_ACCUM_INIT          0x0488
13026da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P1_V_ACCUM_INIT          0x0428
13036da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L
13046da3f7d4SAlexander von Gluck IV #       define  RADEON_OV0_P1_V_ACCUM_INIT_MASK    0x01ff8000L
13056da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P1_X_START_END           0x0494
13066da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P2_X_START_END           0x0498
13076da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P23_BLANK_LINES_AT_TOP   0x0434
13086da3f7d4SAlexander von Gluck IV #       define  RADEON_P23_BLNK_LN_AT_TOP_M1_MASK  0x000007ffL
13096da3f7d4SAlexander von Gluck IV #       define  RADEON_P23_ACTIVE_LINES_M1         0x07ff0000L
13106da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P23_H_ACCUM_INIT         0x048C
13116da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P23_V_ACCUM_INIT         0x042C
13126da3f7d4SAlexander von Gluck IV #define RADEON_OV0_P3_X_START_END           0x049C
13136da3f7d4SAlexander von Gluck IV #define RADEON_OV0_REG_LOAD_CNTL            0x0410
13146da3f7d4SAlexander von Gluck IV #       define  RADEON_REG_LD_CTL_LOCK                 0x00000001L
13156da3f7d4SAlexander von Gluck IV #       define  RADEON_REG_LD_CTL_VBLANK_DURING_LOCK   0x00000002L
13166da3f7d4SAlexander von Gluck IV #       define  RADEON_REG_LD_CTL_STALL_GUI_UNTIL_FLIP 0x00000004L
13176da3f7d4SAlexander von Gluck IV #       define  RADEON_REG_LD_CTL_LOCK_READBACK        0x00000008L
13186da3f7d4SAlexander von Gluck IV #       define  RADEON_REG_LD_CTL_FLIP_READBACK        0x00000010L
13196da3f7d4SAlexander von Gluck IV #define RADEON_OV0_SCALE_CNTL               0x0420
13206da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_HORZ_PICK_NEAREST    0x00000004L
13216da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_VERT_PICK_NEAREST    0x00000008L
13226da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SIGNED_UV            0x00000010L
13236da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_GAMMA_SEL_MASK       0x00000060L
13246da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_GAMMA_SEL_BRIGHT     0x00000000L
13256da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_GAMMA_SEL_G22        0x00000020L
13266da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_GAMMA_SEL_G18        0x00000040L
13276da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_GAMMA_SEL_G14        0x00000060L
13286da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_COMCORE_SHIFT_UP_ONE 0x00000080L
13296da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SURFAC_FORMAT        0x00000f00L
13306da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_15BPP         0x00000300L
13316da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_16BPP         0x00000400L
13326da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_32BPP         0x00000600L
13336da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_YUV9          0x00000900L
13346da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_YUV12         0x00000A00L
13356da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_VYUY422       0x00000B00L
13366da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOURCE_YVYU422       0x00000C00L
13376da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_ADAPTIVE_DEINT       0x00001000L
13386da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_TEMPORAL_DEINT       0x00002000L
13396da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_CRTC_SEL             0x00004000L
13406da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SMART_SWITCH         0x00008000L
13416da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_BURST_PER_PLANE      0x007F0000L
13426da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_DOUBLE_BUFFER        0x01000000L
13436da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_DIS_LIMIT            0x08000000L
13446da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_LIN_TRANS_BYPASS     0x10000000L
13456da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_INT_EMU              0x20000000L
13466da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_ENABLE               0x40000000L
13476da3f7d4SAlexander von Gluck IV #       define  RADEON_SCALER_SOFT_RESET           0x80000000L
13486da3f7d4SAlexander von Gluck IV #define RADEON_OV0_STEP_BY                  0x0484
13496da3f7d4SAlexander von Gluck IV #define RADEON_OV0_TEST                     0x04F8
13506da3f7d4SAlexander von Gluck IV #define RADEON_OV0_V_INC                    0x0424
13516da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF_PITCH0_VALUE     0x0460
13526da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF_PITCH1_VALUE     0x0464
13536da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF0_BASE_ADRS       0x0440
13546da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF0_PITCH_SEL          0x00000001L
13556da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF0_TILE_ADRS          0x00000002L
13566da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF0_BASE_ADRS_MASK     0x03fffff0L
13576da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF0_1ST_LINE_LSBS_MASK 0x48000000L
13586da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF1_BASE_ADRS       0x0444
13596da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF1_PITCH_SEL          0x00000001L
13606da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF1_TILE_ADRS          0x00000002L
13616da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF1_BASE_ADRS_MASK     0x03fffff0L
13626da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF1_1ST_LINE_LSBS_MASK 0x48000000L
13636da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF2_BASE_ADRS       0x0448
13646da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF2_PITCH_SEL          0x00000001L
13656da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF2_TILE_ADRS          0x00000002L
13666da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF2_BASE_ADRS_MASK     0x03fffff0L
13676da3f7d4SAlexander von Gluck IV #       define  RADEON_VIF_BUF2_1ST_LINE_LSBS_MASK 0x48000000L
13686da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF3_BASE_ADRS       0x044C
13696da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF4_BASE_ADRS       0x0450
13706da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VID_BUF5_BASE_ADRS       0x0454
13716da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VIDEO_KEY_CLR_HIGH       0x04E8
13726da3f7d4SAlexander von Gluck IV #define RADEON_OV0_VIDEO_KEY_CLR_LOW        0x04E4
13736da3f7d4SAlexander von Gluck IV #define RADEON_OV0_Y_X_START                0x0400
13746da3f7d4SAlexander von Gluck IV #define RADEON_OV0_Y_X_END                  0x0404
13756da3f7d4SAlexander von Gluck IV #define RADEON_OV1_Y_X_START                0x0600
13766da3f7d4SAlexander von Gluck IV #define RADEON_OV1_Y_X_END                  0x0604
13776da3f7d4SAlexander von Gluck IV #define RADEON_OVR_CLR                      0x0230
13786da3f7d4SAlexander von Gluck IV #define RADEON_OVR_WID_LEFT_RIGHT           0x0234
13796da3f7d4SAlexander von Gluck IV #define RADEON_OVR_WID_TOP_BOTTOM           0x0238
13806da3f7d4SAlexander von Gluck IV #define RADEON_OVR2_CLR                     0x0330
13816da3f7d4SAlexander von Gluck IV #define RADEON_OVR2_WID_LEFT_RIGHT          0x0334
13826da3f7d4SAlexander von Gluck IV #define RADEON_OVR2_WID_TOP_BOTTOM          0x0338
13836da3f7d4SAlexander von Gluck IV 
13846da3f7d4SAlexander von Gluck IV /* first capture unit */
13856da3f7d4SAlexander von Gluck IV 
13866da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_BUF0_OFFSET           0x0920
13876da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_BUF1_OFFSET           0x0924
13886da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_BUF0_EVEN_OFFSET      0x0928
13896da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_BUF1_EVEN_OFFSET      0x092C
13906da3f7d4SAlexander von Gluck IV 
13916da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_BUF_PITCH             0x0930
13926da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_V_WINDOW              0x0934
13936da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_H_WINDOW              0x0938
13946da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VBI0_OFFSET           0x093C
13956da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VBI1_OFFSET           0x0940
13966da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VBI_V_WINDOW          0x0944
13976da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VBI_H_WINDOW          0x0948
13986da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_PORT_MODE_CNTL        0x094C
13996da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_TRIG_CNTL             0x0950
14006da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_DEBUG                 0x0954
14016da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_CONFIG                0x0958
14026da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_CONTINUOS          0x00000001
14036da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_START_FIELD_EVEN   0x00000002
14046da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_START_BUF_GET      0x00000004
14056da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_START_BUF_SET      0x00000008
14066da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_BUF_TYPE_ALT       0x00000010
14076da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_BUF_TYPE_FRAME     0x00000020
14086da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_ONESHOT_MODE_FRAME 0x00000040
14096da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_BUF_MODE_DOUBLE    0x00000080
14106da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_BUF_MODE_TRIPLE    0x00000100
14116da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_MIRROR_EN          0x00000200
14126da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_ONESHOT_MIRROR_EN  0x00000400
14136da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VIDEO_SIGNED_UV    0x00000800
14146da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_ANC_DECODE_EN      0x00001000
14156da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VBI_EN             0x00002000
14166da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_SOFT_PULL_DOWN_EN  0x00004000
14176da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VIP_EXTEND_FLAG_EN 0x00008000
14186da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_FAKE_FIELD_EN      0x00010000
14196da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_ODD_ONE_MORE_LINE  0x00020000
14206da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_EVEN_ONE_MORE_LINE 0x00040000
14216da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_HORZ_DIVIDE_2      0x00080000
14226da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_HORZ_DIVIDE_4      0x00100000
14236da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VERT_DIVIDE_2      0x00200000
14246da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VERT_DIVIDE_4      0x00400000
14256da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_FORMAT_BROOKTREE   0x00000000
14266da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_FORMAT_CCIR656     0x00800000
14276da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_FORMAT_ZV          0x01000000
14286da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_FORMAT_VIP         0x01800000
14296da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_FORMAT_TRANSPORT   0x02000000
14306da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_HORZ_DECIMATOR     0x04000000
14316da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VIDEO_IN_YVYU422   0x00000000
14326da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VIDEO_IN_VYUY422   0x20000000
14336da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VBI_DIVIDE_2       0x40000000
14346da3f7d4SAlexander von Gluck IV #       define RADEON_CAP0_CONFIG_VBI_DIVIDE_4       0x80000000
14356da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_ANC_ODD_OFFSET        0x095C
14366da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_ANC_EVEN_OFFSET       0x0960
14376da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_ANC_H_WINDOW          0x0964
14386da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VIDEO_SYNC_TEST       0x0968
14396da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_ONESHOT_BUF_OFFSET    0x096C
14406da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_BUF_STATUS            0x0970
14416da3f7d4SAlexander von Gluck IV /* #define RADEON_CAP0_DWNSC_XRATIO       0x0978 */
14426da3f7d4SAlexander von Gluck IV /* #define RADEON_CAP0_XSHARPNESS                 0x097C */
14436da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VBI2_OFFSET           0x0980
14446da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_VBI3_OFFSET           0x0984
14456da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_ANC2_OFFSET           0x0988
14466da3f7d4SAlexander von Gluck IV #define RADEON_CAP0_ANC3_OFFSET           0x098C
14476da3f7d4SAlexander von Gluck IV #define RADEON_VID_BUFFER_CONTROL         0x0900
14486da3f7d4SAlexander von Gluck IV 
14496da3f7d4SAlexander von Gluck IV /* second capture unit */
14506da3f7d4SAlexander von Gluck IV 
14516da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_BUF0_OFFSET           0x0990
14526da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_BUF1_OFFSET           0x0994
14536da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_BUF0_EVEN_OFFSET      0x0998
14546da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_BUF1_EVEN_OFFSET      0x099C
14556da3f7d4SAlexander von Gluck IV 
14566da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_BUF_PITCH             0x09A0
14576da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_V_WINDOW              0x09A4
14586da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_H_WINDOW              0x09A8
14596da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_VBI_ODD_OFFSET        0x09AC
14606da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_VBI_EVEN_OFFSET       0x09B0
14616da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_VBI_V_WINDOW                  0x09B4
14626da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_VBI_H_WINDOW                  0x09B8
14636da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_PORT_MODE_CNTL        0x09BC
14646da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_TRIG_CNTL             0x09C0
14656da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_DEBUG                         0x09C4
14666da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_CONFIG                0x09C8
14676da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_ANC_ODD_OFFSET        0x09CC
14686da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_ANC_EVEN_OFFSET       0x09D0
14696da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_ANC_H_WINDOW                  0x09D4
14706da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_VIDEO_SYNC_TEST       0x09D8
14716da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_ONESHOT_BUF_OFFSET    0x09DC
14726da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_BUF_STATUS            0x09E0
14736da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_DWNSC_XRATIO                  0x09E8
14746da3f7d4SAlexander von Gluck IV #define RADEON_CAP1_XSHARPNESS            0x09EC
14756da3f7d4SAlexander von Gluck IV 
14766da3f7d4SAlexander von Gluck IV /* misc multimedia registers */
14776da3f7d4SAlexander von Gluck IV 
14786da3f7d4SAlexander von Gluck IV #define RADEON_IDCT_RUNS                  0x1F80
14796da3f7d4SAlexander von Gluck IV #define RADEON_IDCT_LEVELS                0x1F84
14806da3f7d4SAlexander von Gluck IV #define RADEON_IDCT_CONTROL               0x1FBC
14816da3f7d4SAlexander von Gluck IV #define RADEON_IDCT_AUTH_CONTROL          0x1F88
14826da3f7d4SAlexander von Gluck IV #define RADEON_IDCT_AUTH                  0x1F8C
14836da3f7d4SAlexander von Gluck IV 
14846da3f7d4SAlexander von Gluck IV #define RADEON_P2PLL_CNTL                   0x002a /* P2PLL */
14856da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_RESET                (1 <<  0)
14866da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_SLEEP                (1 <<  1)
14876da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_PVG_MASK             (7 << 11)
14886da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_PVG_SHIFT            11
14896da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_ATOMIC_UPDATE_EN     (1 << 16)
14906da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
14916da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_ATOMIC_UPDATE_VSYNC  (1 << 18)
14926da3f7d4SAlexander von Gluck IV #define RADEON_P2PLL_DIV_0                  0x002c
14936da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_FB0_DIV_MASK    0x07ff
14946da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_POST0_DIV_MASK  0x00070000
14956da3f7d4SAlexander von Gluck IV #define RADEON_P2PLL_REF_DIV                0x002B /* PLL */
14966da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_REF_DIV_MASK    0x03ff
14976da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_ATOMIC_UPDATE_R (1 << 15) /* same as _W */
14986da3f7d4SAlexander von Gluck IV #       define RADEON_P2PLL_ATOMIC_UPDATE_W (1 << 15) /* same as _R */
14996da3f7d4SAlexander von Gluck IV #       define R300_PPLL_REF_DIV_ACC_MASK   (0x3ff << 18)
15006da3f7d4SAlexander von Gluck IV #       define R300_PPLL_REF_DIV_ACC_SHIFT  18
15016da3f7d4SAlexander von Gluck IV #define RADEON_PALETTE_DATA                 0x00b4
15026da3f7d4SAlexander von Gluck IV #define RADEON_PALETTE_30_DATA              0x00b8
15036da3f7d4SAlexander von Gluck IV #define RADEON_PALETTE_INDEX                0x00b0
15046da3f7d4SAlexander von Gluck IV #define RADEON_PCI_GART_PAGE                0x017c
15056da3f7d4SAlexander von Gluck IV #define RADEON_PIXCLKS_CNTL                 0x002d
15066da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_SRC_SEL_MASK     0x03
15076da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_SRC_SEL_CPUCLK   0x00
15086da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_SRC_SEL_PSCANCLK 0x01
15096da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_SRC_SEL_BYTECLK  0x02
15106da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_SRC_SEL_P2PLLCLK 0x03
15116da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_ALWAYS_ONb       (1<<6)
15126da3f7d4SAlexander von Gluck IV #       define RADEON_PIX2CLK_DAC_ALWAYS_ONb   (1<<7)
15136da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_TV_SRC_SEL        (1 << 8)
15146da3f7d4SAlexander von Gluck IV #       define RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9)
15156da3f7d4SAlexander von Gluck IV #       define R300_DVOCLK_ALWAYS_ONb          (1 << 10)
15166da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_BLEND_ALWAYS_ONb  (1 << 11)
15176da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_GV_ALWAYS_ONb     (1 << 12)
15186da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13)
15196da3f7d4SAlexander von Gluck IV #       define R300_PIXCLK_DVO_ALWAYS_ONb      (1 << 13)
15206da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_LVDS_ALWAYS_ONb   (1 << 14)
15216da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_TMDS_ALWAYS_ONb   (1 << 15)
15226da3f7d4SAlexander von Gluck IV #       define R300_PIXCLK_TRANS_ALWAYS_ONb    (1 << 16)
15236da3f7d4SAlexander von Gluck IV #       define R300_PIXCLK_TVO_ALWAYS_ONb      (1 << 17)
15246da3f7d4SAlexander von Gluck IV #       define R300_P2G2CLK_ALWAYS_ONb         (1 << 18)
15256da3f7d4SAlexander von Gluck IV #       define R300_P2G2CLK_DAC_ALWAYS_ONb     (1 << 19)
15266da3f7d4SAlexander von Gluck IV #       define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23)
15276da3f7d4SAlexander von Gluck IV #define RADEON_PLANE_3D_MASK_C              0x1d44
15286da3f7d4SAlexander von Gluck IV #define RADEON_PLL_TEST_CNTL                0x0013 /* PLL */
15296da3f7d4SAlexander von Gluck IV #       define RADEON_PLL_MASK_READ_B          (1 << 9)
15306da3f7d4SAlexander von Gluck IV #define RADEON_PMI_CAP_ID                   0x0f5c /* PCI */
15316da3f7d4SAlexander von Gluck IV #define RADEON_PMI_DATA                     0x0f63 /* PCI */
15326da3f7d4SAlexander von Gluck IV #define RADEON_PMI_NXT_CAP_PTR              0x0f5d /* PCI */
15336da3f7d4SAlexander von Gluck IV #define RADEON_PMI_PMC_REG                  0x0f5e /* PCI */
15346da3f7d4SAlexander von Gluck IV #define RADEON_PMI_PMCSR_REG                0x0f60 /* PCI */
15356da3f7d4SAlexander von Gluck IV #define RADEON_PMI_REGISTER                 0x0f5c /* PCI */
15366da3f7d4SAlexander von Gluck IV #define RADEON_PPLL_CNTL                    0x0002 /* PLL */
15376da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_RESET                (1 <<  0)
15386da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_SLEEP                (1 <<  1)
15396da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_PVG_MASK             (7 << 11)
15406da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_PVG_SHIFT            11
15416da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_ATOMIC_UPDATE_EN     (1 << 16)
15426da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_VGA_ATOMIC_UPDATE_EN (1 << 17)
15436da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_ATOMIC_UPDATE_VSYNC  (1 << 18)
15446da3f7d4SAlexander von Gluck IV #define RADEON_PPLL_DIV_0                   0x0004 /* PLL */
15456da3f7d4SAlexander von Gluck IV #define RADEON_PPLL_DIV_1                   0x0005 /* PLL */
15466da3f7d4SAlexander von Gluck IV #define RADEON_PPLL_DIV_2                   0x0006 /* PLL */
15476da3f7d4SAlexander von Gluck IV #define RADEON_PPLL_DIV_3                   0x0007 /* PLL */
15486da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_FB3_DIV_MASK     0x07ff
15496da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_POST3_DIV_MASK   0x00070000
15506da3f7d4SAlexander von Gluck IV #define RADEON_PPLL_REF_DIV                 0x0003 /* PLL */
15516da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_REF_DIV_MASK     0x03ff
15526da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_ATOMIC_UPDATE_R  (1 << 15) /* same as _W */
15536da3f7d4SAlexander von Gluck IV #       define RADEON_PPLL_ATOMIC_UPDATE_W  (1 << 15) /* same as _R */
15546da3f7d4SAlexander von Gluck IV #define RADEON_PWR_MNGMT_CNTL_STATUS        0x0f60 /* PCI */
15556da3f7d4SAlexander von Gluck IV 
15566da3f7d4SAlexander von Gluck IV #define RADEON_RBBM_GUICNTL                 0x172c
15576da3f7d4SAlexander von Gluck IV #       define RADEON_HOST_DATA_SWAP_NONE   (0 << 0)
15586da3f7d4SAlexander von Gluck IV #       define RADEON_HOST_DATA_SWAP_16BIT  (1 << 0)
15596da3f7d4SAlexander von Gluck IV #       define RADEON_HOST_DATA_SWAP_32BIT  (2 << 0)
15606da3f7d4SAlexander von Gluck IV #       define RADEON_HOST_DATA_SWAP_HDW    (3 << 0)
15616da3f7d4SAlexander von Gluck IV #define RADEON_RBBM_SOFT_RESET              0x00f0
15626da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_CP         (1 <<  0)
15636da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_HI         (1 <<  1)
15646da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_SE         (1 <<  2)
15656da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_RE         (1 <<  3)
15666da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_PP         (1 <<  4)
15676da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_E2         (1 <<  5)
15686da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_RB         (1 <<  6)
15696da3f7d4SAlexander von Gluck IV #       define RADEON_SOFT_RESET_HDP        (1 <<  7)
15706da3f7d4SAlexander von Gluck IV #define RADEON_RBBM_STATUS                  0x0e40
15716da3f7d4SAlexander von Gluck IV #       define RADEON_RBBM_FIFOCNT_MASK     0x007f
15726da3f7d4SAlexander von Gluck IV #       define RADEON_RBBM_ACTIVE           (1 << 31)
15736da3f7d4SAlexander von Gluck IV #define RADEON_RB2D_DSTCACHE_CTLSTAT        0x342c
15746da3f7d4SAlexander von Gluck IV #       define RADEON_RB2D_DC_FLUSH         (3 << 0)
15756da3f7d4SAlexander von Gluck IV #       define RADEON_RB2D_DC_FREE          (3 << 2)
15766da3f7d4SAlexander von Gluck IV #       define RADEON_RB2D_DC_FLUSH_ALL     0xf
15776da3f7d4SAlexander von Gluck IV #       define RADEON_RB2D_DC_BUSY          (1 << 31)
15786da3f7d4SAlexander von Gluck IV #define RADEON_RB2D_DSTCACHE_MODE           0x3428
15796da3f7d4SAlexander von Gluck IV #define RADEON_DSTCACHE_CTLSTAT             0x1714
15806da3f7d4SAlexander von Gluck IV 
15816da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_ZCACHE_MODE             0x3250
15826da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_ZCACHE_CTLSTAT          0x3254
15836da3f7d4SAlexander von Gluck IV #       define RADEON_RB3D_ZC_FLUSH_ALL     0x5
15846da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_DSTCACHE_MODE           0x3258
15856da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_CACHE_ENABLE            (0)
15866da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_2D_CACHE_DISABLE        (1)
15876da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_3D_CACHE_DISABLE        (2)
15886da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_CACHE_DISABLE           (3)
15896da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_2D_CACHE_LINESIZE_128   (1 << 2)
15906da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_3D_CACHE_LINESIZE_128   (2 << 2)
15916da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_2D_CACHE_AUTOFLUSH      (1 << 8)
15926da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_3D_CACHE_AUTOFLUSH      (2 << 8)
15936da3f7d4SAlexander von Gluck IV # define R200_RB3D_DC_2D_CACHE_AUTOFREE         (1 << 10)
15946da3f7d4SAlexander von Gluck IV # define R200_RB3D_DC_3D_CACHE_AUTOFREE         (2 << 10)
15956da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_FORCE_RMW               (1 << 16)
15966da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_DISABLE_RI_FILL         (1 << 24)
15976da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_DISABLE_RI_READ         (1 << 25)
15986da3f7d4SAlexander von Gluck IV 
15996da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_DSTCACHE_CTLSTAT            0x325C
16006da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_FLUSH                   (3 << 0)
16016da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_FREE                    (3 << 2)
16026da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_FLUSH_ALL               0xf
16036da3f7d4SAlexander von Gluck IV # define RADEON_RB3D_DC_BUSY                    (1 << 31)
16046da3f7d4SAlexander von Gluck IV 
16056da3f7d4SAlexander von Gluck IV #define RADEON_REG_BASE                     0x0f18 /* PCI */
16066da3f7d4SAlexander von Gluck IV #define RADEON_REGPROG_INF                  0x0f09 /* PCI */
16076da3f7d4SAlexander von Gluck IV #define RADEON_REVISION_ID                  0x0f08 /* PCI */
16086da3f7d4SAlexander von Gluck IV 
16096da3f7d4SAlexander von Gluck IV #define RADEON_SC_BOTTOM                    0x164c
16106da3f7d4SAlexander von Gluck IV #define RADEON_SC_BOTTOM_RIGHT              0x16f0
16116da3f7d4SAlexander von Gluck IV #define RADEON_SC_BOTTOM_RIGHT_C            0x1c8c
16126da3f7d4SAlexander von Gluck IV #define RADEON_SC_LEFT                      0x1640
16136da3f7d4SAlexander von Gluck IV #define RADEON_SC_RIGHT                     0x1644
16146da3f7d4SAlexander von Gluck IV #define RADEON_SC_TOP                       0x1648
16156da3f7d4SAlexander von Gluck IV #define RADEON_SC_TOP_LEFT                  0x16ec
16166da3f7d4SAlexander von Gluck IV #define RADEON_SC_TOP_LEFT_C                0x1c88
16176da3f7d4SAlexander von Gluck IV #       define RADEON_SC_SIGN_MASK_LO       0x8000
16186da3f7d4SAlexander von Gluck IV #       define RADEON_SC_SIGN_MASK_HI       0x80000000
16196da3f7d4SAlexander von Gluck IV #define RADEON_M_SPLL_REF_FB_DIV            0x000a /* PLL */
16206da3f7d4SAlexander von Gluck IV #	define RADEON_M_SPLL_REF_DIV_SHIFT  0
16216da3f7d4SAlexander von Gluck IV #	define RADEON_M_SPLL_REF_DIV_MASK   0xff
16226da3f7d4SAlexander von Gluck IV #	define RADEON_MPLL_FB_DIV_SHIFT     8
16236da3f7d4SAlexander von Gluck IV #	define RADEON_MPLL_FB_DIV_MASK      0xff
16246da3f7d4SAlexander von Gluck IV #	define RADEON_SPLL_FB_DIV_SHIFT     16
16256da3f7d4SAlexander von Gluck IV #	define RADEON_SPLL_FB_DIV_MASK      0xff
16266da3f7d4SAlexander von Gluck IV #define RADEON_SPLL_CNTL                    0x000c /* PLL */
16276da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_SLEEP            (1 << 0)
16286da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_RESET            (1 << 1)
16296da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_PCP_MASK         0x7
16306da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_PCP_SHIFT        8
16316da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_PVG_MASK         0x7
16326da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_PVG_SHIFT        11
16336da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_PDC_MASK         0x3
16346da3f7d4SAlexander von Gluck IV #       define RADEON_SPLL_PDC_SHIFT        14
16356da3f7d4SAlexander von Gluck IV #define RADEON_SCLK_CNTL                    0x000d /* PLL */
16366da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_SRC_SEL_MASK     0x0007
16376da3f7d4SAlexander von Gluck IV #       define RADEON_DYN_STOP_LAT_MASK     0x00007ff8
16386da3f7d4SAlexander von Gluck IV #       define RADEON_CP_MAX_DYN_STOP_LAT   0x0008
16396da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCEON_MASK     0xffff8000
16406da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_DISP2      (1<<15)
16416da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_CP         (1<<16)
16426da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_HDP        (1<<17)
16436da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_DISP1      (1<<18)
16446da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_TOP        (1<<19)
16456da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_E2         (1<<20)
16466da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_SE         (1<<21)
16476da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_IDCT       (1<<22)
16486da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_VIP        (1<<23)
16496da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_RE         (1<<24)
16506da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_PB         (1<<25)
16516da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_TAM        (1<<26)
16526da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_TDM        (1<<27)
16536da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_RB         (1<<28)
16546da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_TV_SCLK    (1<<29)
16556da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_SUBPIC     (1<<30)
16566da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_FORCE_OV0        (1<<31)
16576da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_VAP          (1<<21)
16586da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_SR           (1<<25)
16596da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_PX           (1<<26)
16606da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_TX           (1<<27)
16616da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_US           (1<<28)
16626da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_SU           (1<<30)
16636da3f7d4SAlexander von Gluck IV #define R300_SCLK_CNTL2                     0x1e   /* PLL */
16646da3f7d4SAlexander von Gluck IV #       define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10)
16656da3f7d4SAlexander von Gluck IV #       define R300_SCLK_GA_MAX_DYN_STOP_LAT  (1<<11)
16666da3f7d4SAlexander von Gluck IV #       define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12)
16676da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_TCL          (1<<13)
16686da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_CBA          (1<<14)
16696da3f7d4SAlexander von Gluck IV #       define R300_SCLK_FORCE_GA           (1<<15)
16706da3f7d4SAlexander von Gluck IV #define RADEON_SCLK_MORE_CNTL               0x0035 /* PLL */
16716da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_MORE_MAX_DYN_STOP_LAT 0x0007
16726da3f7d4SAlexander von Gluck IV #       define RADEON_SCLK_MORE_FORCEON     0x0700
16736da3f7d4SAlexander von Gluck IV #define RADEON_SDRAM_MODE_REG               0x0158
16746da3f7d4SAlexander von Gluck IV #define RADEON_SEQ8_DATA                    0x03c5 /* VGA */
16756da3f7d4SAlexander von Gluck IV #define RADEON_SEQ8_IDX                     0x03c4 /* VGA */
16766da3f7d4SAlexander von Gluck IV #define RADEON_SNAPSHOT_F_COUNT             0x0244
16776da3f7d4SAlexander von Gluck IV #define RADEON_SNAPSHOT_VH_COUNTS           0x0240
16786da3f7d4SAlexander von Gluck IV #define RADEON_SNAPSHOT_VIF_COUNT           0x024c
16796da3f7d4SAlexander von Gluck IV #define RADEON_SRC_OFFSET                   0x15ac
16806da3f7d4SAlexander von Gluck IV #define RADEON_SRC_PITCH                    0x15b0
16816da3f7d4SAlexander von Gluck IV #define RADEON_SRC_PITCH_OFFSET             0x1428
16826da3f7d4SAlexander von Gluck IV #define RADEON_SRC_SC_BOTTOM                0x165c
16836da3f7d4SAlexander von Gluck IV #define RADEON_SRC_SC_BOTTOM_RIGHT          0x16f4
16846da3f7d4SAlexander von Gluck IV #define RADEON_SRC_SC_RIGHT                 0x1654
16856da3f7d4SAlexander von Gluck IV #define RADEON_SRC_X                        0x1414
16866da3f7d4SAlexander von Gluck IV #define RADEON_SRC_X_Y                      0x1590
16876da3f7d4SAlexander von Gluck IV #define RADEON_SRC_Y                        0x1418
16886da3f7d4SAlexander von Gluck IV #define RADEON_SRC_Y_X                      0x1434
16896da3f7d4SAlexander von Gluck IV #define RADEON_STATUS                       0x0f06 /* PCI */
16906da3f7d4SAlexander von Gluck IV #define RADEON_SUBPIC_CNTL                  0x0540 /* ? */
16916da3f7d4SAlexander von Gluck IV #define RADEON_SUB_CLASS                    0x0f0a /* PCI */
16926da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE_CNTL                 0x0b00
16936da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_TRANSLATION_DIS  (1 << 8)
16946da3f7d4SAlexander von Gluck IV #       define RADEON_NONSURF_AP0_SWP_16BPP (1 << 20)
16956da3f7d4SAlexander von Gluck IV #       define RADEON_NONSURF_AP0_SWP_32BPP (1 << 21)
16966da3f7d4SAlexander von Gluck IV #       define RADEON_NONSURF_AP1_SWP_16BPP (1 << 22)
16976da3f7d4SAlexander von Gluck IV #       define RADEON_NONSURF_AP1_SWP_32BPP (1 << 23)
16986da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE0_INFO                0x0b0c
16996da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_TILE_COLOR_MACRO (0 << 16)
17006da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_TILE_COLOR_BOTH  (1 << 16)
17016da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_TILE_DEPTH_32BPP (2 << 16)
17026da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_TILE_DEPTH_16BPP (3 << 16)
17036da3f7d4SAlexander von Gluck IV #       define R200_SURF_TILE_NONE          (0 << 16)
17046da3f7d4SAlexander von Gluck IV #       define R200_SURF_TILE_COLOR_MACRO   (1 << 16)
17056da3f7d4SAlexander von Gluck IV #       define R200_SURF_TILE_COLOR_MICRO   (2 << 16)
17066da3f7d4SAlexander von Gluck IV #       define R200_SURF_TILE_COLOR_BOTH    (3 << 16)
17076da3f7d4SAlexander von Gluck IV #       define R200_SURF_TILE_DEPTH_32BPP   (4 << 16)
17086da3f7d4SAlexander von Gluck IV #       define R200_SURF_TILE_DEPTH_16BPP   (5 << 16)
17096da3f7d4SAlexander von Gluck IV #       define R300_SURF_TILE_NONE          (0 << 16)
17106da3f7d4SAlexander von Gluck IV #       define R300_SURF_TILE_COLOR_MACRO   (1 << 16)
17116da3f7d4SAlexander von Gluck IV #       define R300_SURF_TILE_DEPTH_32BPP   (2 << 16)
17126da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_AP0_SWP_16BPP    (1 << 20)
17136da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_AP0_SWP_32BPP    (1 << 21)
17146da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_AP1_SWP_16BPP    (1 << 22)
17156da3f7d4SAlexander von Gluck IV #       define RADEON_SURF_AP1_SWP_32BPP    (1 << 23)
17166da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE0_LOWER_BOUND         0x0b04
17176da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE0_UPPER_BOUND         0x0b08
17186da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE1_INFO                0x0b1c
17196da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE1_LOWER_BOUND         0x0b14
17206da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE1_UPPER_BOUND         0x0b18
17216da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE2_INFO                0x0b2c
17226da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE2_LOWER_BOUND         0x0b24
17236da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE2_UPPER_BOUND         0x0b28
17246da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE3_INFO                0x0b3c
17256da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE3_LOWER_BOUND         0x0b34
17266da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE3_UPPER_BOUND         0x0b38
17276da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE4_INFO                0x0b4c
17286da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE4_LOWER_BOUND         0x0b44
17296da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE4_UPPER_BOUND         0x0b48
17306da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE5_INFO                0x0b5c
17316da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE5_LOWER_BOUND         0x0b54
17326da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE5_UPPER_BOUND         0x0b58
17336da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE6_INFO                0x0b6c
17346da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE6_LOWER_BOUND         0x0b64
17356da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE6_UPPER_BOUND         0x0b68
17366da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE7_INFO                0x0b7c
17376da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE7_LOWER_BOUND         0x0b74
17386da3f7d4SAlexander von Gluck IV #define RADEON_SURFACE7_UPPER_BOUND         0x0b78
17396da3f7d4SAlexander von Gluck IV #define RADEON_SW_SEMAPHORE                 0x013c
17406da3f7d4SAlexander von Gluck IV 
17416da3f7d4SAlexander von Gluck IV #define RADEON_TEST_DEBUG_CNTL              0x0120
17426da3f7d4SAlexander von Gluck IV #define RADEON_TEST_DEBUG_CNTL__TEST_DEBUG_OUT_EN 0x00000001
17436da3f7d4SAlexander von Gluck IV 
17446da3f7d4SAlexander von Gluck IV #define RADEON_TEST_DEBUG_MUX               0x0124
17456da3f7d4SAlexander von Gluck IV #define RADEON_TEST_DEBUG_OUT               0x012c
17466da3f7d4SAlexander von Gluck IV #define RADEON_TMDS_PLL_CNTL                0x02a8
17476da3f7d4SAlexander von Gluck IV #define RADEON_TMDS_TRANSMITTER_CNTL        0x02a4
17486da3f7d4SAlexander von Gluck IV #       define RADEON_TMDS_TRANSMITTER_PLLEN  1
17496da3f7d4SAlexander von Gluck IV #       define RADEON_TMDS_TRANSMITTER_PLLRST 2
17506da3f7d4SAlexander von Gluck IV #define RADEON_TRAIL_BRES_DEC               0x1614
17516da3f7d4SAlexander von Gluck IV #define RADEON_TRAIL_BRES_ERR               0x160c
17526da3f7d4SAlexander von Gluck IV #define RADEON_TRAIL_BRES_INC               0x1610
17536da3f7d4SAlexander von Gluck IV #define RADEON_TRAIL_X                      0x1618
17546da3f7d4SAlexander von Gluck IV #define RADEON_TRAIL_X_SUB                  0x1620
17556da3f7d4SAlexander von Gluck IV 
17566da3f7d4SAlexander von Gluck IV #define RADEON_VCLK_ECP_CNTL                0x0008 /* PLL */
17576da3f7d4SAlexander von Gluck IV #       define RADEON_VCLK_SRC_SEL_MASK     0x03
17586da3f7d4SAlexander von Gluck IV #       define RADEON_VCLK_SRC_SEL_CPUCLK   0x00
17596da3f7d4SAlexander von Gluck IV #       define RADEON_VCLK_SRC_SEL_PSCANCLK 0x01
17606da3f7d4SAlexander von Gluck IV #       define RADEON_VCLK_SRC_SEL_BYTECLK  0x02
17616da3f7d4SAlexander von Gluck IV #       define RADEON_VCLK_SRC_SEL_PPLLCLK  0x03
17626da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_ALWAYS_ONb     (1<<6)
17636da3f7d4SAlexander von Gluck IV #       define RADEON_PIXCLK_DAC_ALWAYS_ONb (1<<7)
17646da3f7d4SAlexander von Gluck IV #       define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23)
17656da3f7d4SAlexander von Gluck IV 
17666da3f7d4SAlexander von Gluck IV #define RADEON_VENDOR_ID                    0x0f00 /* PCI */
17676da3f7d4SAlexander von Gluck IV #define RADEON_VGA_DDA_CONFIG               0x02e8
17686da3f7d4SAlexander von Gluck IV #define RADEON_VGA_DDA_ON_OFF               0x02ec
17696da3f7d4SAlexander von Gluck IV #define RADEON_VID_BUFFER_CONTROL           0x0900
17706da3f7d4SAlexander von Gluck IV #define RADEON_VIDEOMUX_CNTL                0x0190
17716da3f7d4SAlexander von Gluck IV 
17726da3f7d4SAlexander von Gluck IV /* VIP bus */
17736da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH0_DATA                0x0c00
17746da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH1_DATA                0x0c04
17756da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH2_DATA                0x0c08
17766da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH3_DATA                0x0c0c
17776da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH0_ADDR                0x0c10
17786da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH1_ADDR                0x0c14
17796da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH2_ADDR                0x0c18
17806da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH3_ADDR                0x0c1c
17816da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH0_SBCNT               0x0c20
17826da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH1_SBCNT               0x0c24
17836da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH2_SBCNT               0x0c28
17846da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH3_SBCNT               0x0c2c
17856da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH0_ABCNT               0x0c30
17866da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH1_ABCNT               0x0c34
17876da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH2_ABCNT               0x0c38
17886da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CH3_ABCNT               0x0c3c
17896da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_CONTROL                 0x0c40
17906da3f7d4SAlexander von Gluck IV #       define RADEON_VIP_BUSY 0
17916da3f7d4SAlexander von Gluck IV #       define RADEON_VIP_IDLE 1
17926da3f7d4SAlexander von Gluck IV #       define RADEON_VIP_RESET 2
17936da3f7d4SAlexander von Gluck IV #       define RADEON_VIPH_EN               (1 << 21)
17946da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_DV_LAT                  0x0c44
17956da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_BM_CHUNK                0x0c48
17966da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_DV_INT                  0x0c4c
17976da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_TIMEOUT_STAT            0x0c50
17986da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_STAT 0x00000010
17996da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_TIMEOUT_STAT__VIPH_REG_AK   0x00000010
18006da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_TIMEOUT_STAT__VIPH_REGR_DIS 0x01000000
18016da3f7d4SAlexander von Gluck IV 
18026da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_REG_DATA                0x0084
18036da3f7d4SAlexander von Gluck IV #define RADEON_VIPH_REG_ADDR                0x0080
18046da3f7d4SAlexander von Gluck IV 
18056da3f7d4SAlexander von Gluck IV 
18066da3f7d4SAlexander von Gluck IV #define RADEON_WAIT_UNTIL                   0x1720
18076da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_CRTC_PFLIP       (1 << 0)
18086da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_RE_CRTC_VLINE    (1 << 1)
18096da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_FE_CRTC_VLINE    (1 << 2)
18106da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_CRTC_VLINE       (1 << 3)
18116da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_DMA_VID_IDLE     (1 << 8)
18126da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_DMA_GUI_IDLE     (1 << 9)
18136da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_CMDFIFO          (1 << 10) /* wait for CMDFIFO_ENTRIES */
18146da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_OV0_FLIP         (1 << 11)
18156da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_AGP_FLUSH        (1 << 13)
18166da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_2D_IDLE          (1 << 14)
18176da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_3D_IDLE          (1 << 15)
18186da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_2D_IDLECLEAN     (1 << 16)
18196da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_3D_IDLECLEAN     (1 << 17)
18206da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_HOST_IDLECLEAN   (1 << 18)
18216da3f7d4SAlexander von Gluck IV #       define RADEON_CMDFIFO_ENTRIES_SHIFT 10
18226da3f7d4SAlexander von Gluck IV #       define RADEON_CMDFIFO_ENTRIES_MASK  0x7f
18236da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_VAP_IDLE         (1 << 28)
18246da3f7d4SAlexander von Gluck IV #       define RADEON_WAIT_BOTH_CRTC_PFLIP  (1 << 30)
18256da3f7d4SAlexander von Gluck IV #       define RADEON_ENG_DISPLAY_SELECT_CRTC0    (0 << 31)
18266da3f7d4SAlexander von Gluck IV #       define RADEON_ENG_DISPLAY_SELECT_CRTC1    (1 << 31)
18276da3f7d4SAlexander von Gluck IV 
18286da3f7d4SAlexander von Gluck IV #define RADEON_X_MPLL_REF_FB_DIV            0x000a /* PLL */
18296da3f7d4SAlexander von Gluck IV #define RADEON_XCLK_CNTL                    0x000d /* PLL */
18306da3f7d4SAlexander von Gluck IV #define RADEON_XDLL_CNTL                    0x000c /* PLL */
18316da3f7d4SAlexander von Gluck IV #define RADEON_XPLL_CNTL                    0x000b /* PLL */
18326da3f7d4SAlexander von Gluck IV 
18336da3f7d4SAlexander von Gluck IV 
18346da3f7d4SAlexander von Gluck IV 
18356da3f7d4SAlexander von Gluck IV 				/* Registers for 3D/TCL */
18366da3f7d4SAlexander von Gluck IV #define RADEON_PP_BORDER_COLOR_0            0x1d40
18376da3f7d4SAlexander von Gluck IV #define RADEON_PP_BORDER_COLOR_1            0x1d44
18386da3f7d4SAlexander von Gluck IV #define RADEON_PP_BORDER_COLOR_2            0x1d48
18396da3f7d4SAlexander von Gluck IV #define RADEON_PP_CNTL                      0x1c38
18406da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_ENABLE        (1 <<  0)
18416da3f7d4SAlexander von Gluck IV #       define RADEON_SCISSOR_ENABLE        (1 <<  1)
18426da3f7d4SAlexander von Gluck IV #       define RADEON_PATTERN_ENABLE        (1 <<  2)
18436da3f7d4SAlexander von Gluck IV #       define RADEON_SHADOW_ENABLE         (1 <<  3)
18446da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_ENABLE_MASK       (0xf << 4)
18456da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_0_ENABLE          (1 <<  4)
18466da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_1_ENABLE          (1 <<  5)
18476da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_2_ENABLE          (1 <<  6)
18486da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_3_ENABLE          (1 <<  7)
18496da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_BLEND_ENABLE_MASK (0xf << 12)
18506da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_BLEND_0_ENABLE    (1 << 12)
18516da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_BLEND_1_ENABLE    (1 << 13)
18526da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_BLEND_2_ENABLE    (1 << 14)
18536da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_BLEND_3_ENABLE    (1 << 15)
18546da3f7d4SAlexander von Gluck IV #       define RADEON_PLANAR_YUV_ENABLE     (1 << 20)
18556da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_ENABLE       (1 << 21)
18566da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_ENABLE            (1 << 22)
18576da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_ENABLE     (1 << 23)
18586da3f7d4SAlexander von Gluck IV #       define RADEON_ANTI_ALIAS_NONE       (0 << 24)
18596da3f7d4SAlexander von Gluck IV #       define RADEON_ANTI_ALIAS_LINE       (1 << 24)
18606da3f7d4SAlexander von Gluck IV #       define RADEON_ANTI_ALIAS_POLY       (2 << 24)
18616da3f7d4SAlexander von Gluck IV #       define RADEON_ANTI_ALIAS_LINE_POLY  (3 << 24)
18626da3f7d4SAlexander von Gluck IV #       define RADEON_BUMP_MAP_ENABLE       (1 << 26)
18636da3f7d4SAlexander von Gluck IV #       define RADEON_BUMPED_MAP_T0         (0 << 27)
18646da3f7d4SAlexander von Gluck IV #       define RADEON_BUMPED_MAP_T1         (1 << 27)
18656da3f7d4SAlexander von Gluck IV #       define RADEON_BUMPED_MAP_T2         (2 << 27)
18666da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_3D_ENABLE_0       (1 << 29)
18676da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_3D_ENABLE_1       (1 << 30)
18686da3f7d4SAlexander von Gluck IV #       define RADEON_MC_ENABLE             (1 << 31)
18696da3f7d4SAlexander von Gluck IV #define RADEON_PP_FOG_COLOR                 0x1c18
18706da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_COLOR_MASK        0x00ffffff
18716da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_VERTEX            (0 << 24)
18726da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_TABLE             (1 << 24)
18736da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_USE_DEPTH         (0 << 25)
18746da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_USE_DIFFUSE_ALPHA (2 << 25)
18756da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_USE_SPEC_ALPHA    (3 << 25)
18766da3f7d4SAlexander von Gluck IV #define RADEON_PP_LUM_MATRIX                0x1d00
18776da3f7d4SAlexander von Gluck IV #define RADEON_PP_MISC                      0x1c14
18786da3f7d4SAlexander von Gluck IV #       define RADEON_REF_ALPHA_MASK        0x000000ff
18796da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_FAIL       (0 << 8)
18806da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_LESS       (1 << 8)
18816da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_LEQUAL     (2 << 8)
18826da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_EQUAL      (3 << 8)
18836da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_GEQUAL     (4 << 8)
18846da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_GREATER    (5 << 8)
18856da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_NEQUAL     (6 << 8)
18866da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_PASS       (7 << 8)
18876da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_TEST_OP_MASK    (7 << 8)
18886da3f7d4SAlexander von Gluck IV #       define RADEON_CHROMA_FUNC_FAIL      (0 << 16)
18896da3f7d4SAlexander von Gluck IV #       define RADEON_CHROMA_FUNC_PASS      (1 << 16)
18906da3f7d4SAlexander von Gluck IV #       define RADEON_CHROMA_FUNC_NEQUAL    (2 << 16)
18916da3f7d4SAlexander von Gluck IV #       define RADEON_CHROMA_FUNC_EQUAL     (3 << 16)
18926da3f7d4SAlexander von Gluck IV #       define RADEON_CHROMA_KEY_NEAREST    (0 << 18)
18936da3f7d4SAlexander von Gluck IV #       define RADEON_CHROMA_KEY_ZERO       (1 << 18)
18946da3f7d4SAlexander von Gluck IV #       define RADEON_SHADOW_ID_AUTO_INC    (1 << 20)
18956da3f7d4SAlexander von Gluck IV #       define RADEON_SHADOW_FUNC_EQUAL     (0 << 21)
18966da3f7d4SAlexander von Gluck IV #       define RADEON_SHADOW_FUNC_NEQUAL    (1 << 21)
18976da3f7d4SAlexander von Gluck IV #       define RADEON_SHADOW_PASS_1         (0 << 22)
18986da3f7d4SAlexander von Gluck IV #       define RADEON_SHADOW_PASS_2         (1 << 22)
18996da3f7d4SAlexander von Gluck IV #       define RADEON_RIGHT_HAND_CUBE_D3D   (0 << 24)
19006da3f7d4SAlexander von Gluck IV #       define RADEON_RIGHT_HAND_CUBE_OGL   (1 << 24)
19016da3f7d4SAlexander von Gluck IV #define RADEON_PP_ROT_MATRIX_0              0x1d58
19026da3f7d4SAlexander von Gluck IV #define RADEON_PP_ROT_MATRIX_1              0x1d5c
19036da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXFILTER_0                0x1c54
19046da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXFILTER_1                0x1c6c
19056da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXFILTER_2                0x1c84
19066da3f7d4SAlexander von Gluck IV #       define RADEON_MAG_FILTER_NEAREST                   (0  <<  0)
19076da3f7d4SAlexander von Gluck IV #       define RADEON_MAG_FILTER_LINEAR                    (1  <<  0)
19086da3f7d4SAlexander von Gluck IV #       define RADEON_MAG_FILTER_MASK                      (1  <<  0)
19096da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_NEAREST                   (0  <<  1)
19106da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_LINEAR                    (1  <<  1)
19116da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_NEAREST_MIP_NEAREST       (2  <<  1)
19126da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_NEAREST_MIP_LINEAR        (3  <<  1)
19136da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_LINEAR_MIP_NEAREST        (6  <<  1)
19146da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_LINEAR_MIP_LINEAR         (7  <<  1)
19156da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_ANISO_NEAREST             (8  <<  1)
19166da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_ANISO_LINEAR              (9  <<  1)
19176da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 <<  1)
19186da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR  (11 <<  1)
19196da3f7d4SAlexander von Gluck IV #       define RADEON_MIN_FILTER_MASK                      (15 <<  1)
19206da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_ANISO_1_TO_1                     (0  <<  5)
19216da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_ANISO_2_TO_1                     (1  <<  5)
19226da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_ANISO_4_TO_1                     (2  <<  5)
19236da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_ANISO_8_TO_1                     (3  <<  5)
19246da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_ANISO_16_TO_1                    (4  <<  5)
19256da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_ANISO_MASK                       (7  <<  5)
19266da3f7d4SAlexander von Gluck IV #       define RADEON_LOD_BIAS_MASK                        (0xff <<  8)
19276da3f7d4SAlexander von Gluck IV #       define RADEON_LOD_BIAS_SHIFT                       8
19286da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_MIP_LEVEL_MASK                   (0x0f << 16)
19296da3f7d4SAlexander von Gluck IV #       define RADEON_MAX_MIP_LEVEL_SHIFT                  16
19306da3f7d4SAlexander von Gluck IV #       define RADEON_YUV_TO_RGB                           (1  << 20)
19316da3f7d4SAlexander von Gluck IV #       define RADEON_YUV_TEMPERATURE_COOL                 (0  << 21)
19326da3f7d4SAlexander von Gluck IV #       define RADEON_YUV_TEMPERATURE_HOT                  (1  << 21)
19336da3f7d4SAlexander von Gluck IV #       define RADEON_YUV_TEMPERATURE_MASK                 (1  << 21)
19346da3f7d4SAlexander von Gluck IV #       define RADEON_WRAPEN_S                             (1  << 22)
19356da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_WRAP                         (0  << 23)
19366da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_MIRROR                       (1  << 23)
19376da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_CLAMP_LAST                   (2  << 23)
19386da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_MIRROR_CLAMP_LAST            (3  << 23)
19396da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_CLAMP_BORDER                 (4  << 23)
19406da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_MIRROR_CLAMP_BORDER          (5  << 23)
19416da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_CLAMP_GL                     (6  << 23)
19426da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_MIRROR_CLAMP_GL              (7  << 23)
19436da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_S_MASK                         (7  << 23)
19446da3f7d4SAlexander von Gluck IV #       define RADEON_WRAPEN_T                             (1  << 26)
19456da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_WRAP                         (0  << 27)
19466da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_MIRROR                       (1  << 27)
19476da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_CLAMP_LAST                   (2  << 27)
19486da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_MIRROR_CLAMP_LAST            (3  << 27)
19496da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_CLAMP_BORDER                 (4  << 27)
19506da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_MIRROR_CLAMP_BORDER          (5  << 27)
19516da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_CLAMP_GL                     (6  << 27)
19526da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_MIRROR_CLAMP_GL              (7  << 27)
19536da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_T_MASK                         (7  << 27)
19546da3f7d4SAlexander von Gluck IV #       define RADEON_BORDER_MODE_OGL                      (0  << 31)
19556da3f7d4SAlexander von Gluck IV #       define RADEON_BORDER_MODE_D3D                      (1  << 31)
19566da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXFORMAT_0                0x1c58
19576da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXFORMAT_1                0x1c70
19586da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXFORMAT_2                0x1c88
19596da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_I8                 (0  <<  0)
19606da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_AI88               (1  <<  0)
19616da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_RGB332             (2  <<  0)
19626da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ARGB1555           (3  <<  0)
19636da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_RGB565             (4  <<  0)
19646da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ARGB4444           (5  <<  0)
19656da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ARGB8888           (6  <<  0)
19666da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_RGBA8888           (7  <<  0)
19676da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_Y8                 (8  <<  0)
19686da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_VYUY422            (10 <<  0)
19696da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_YVYU422            (11 <<  0)
19706da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_DXT1               (12 <<  0)
19716da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_DXT23              (14 <<  0)
19726da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_DXT45              (15 <<  0)
19736da3f7d4SAlexander von Gluck IV #	define RADEON_TXFORMAT_SHADOW16           (16 <<  0)
19746da3f7d4SAlexander von Gluck IV #	define RADEON_TXFORMAT_SHADOW32           (17 <<  0)
19756da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_DUDV88             (18 <<  0)
19766da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_LDUDV655           (19 <<  0)
19776da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_LDUDUV8888         (20 <<  0)
19786da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_FORMAT_MASK        (31 <<  0)
19796da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_FORMAT_SHIFT       0
19806da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_APPLE_YUV_MODE     (1  <<  5)
19816da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ALPHA_IN_MAP       (1  <<  6)
19826da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_NON_POWER2         (1  <<  7)
19836da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_WIDTH_MASK         (15 <<  8)
19846da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_WIDTH_SHIFT        8
19856da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_HEIGHT_MASK        (15 << 12)
19866da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_HEIGHT_SHIFT       12
19876da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_F5_WIDTH_MASK      (15 << 16)
19886da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_F5_WIDTH_SHIFT     16
19896da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_F5_HEIGHT_MASK     (15 << 20)
19906da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_F5_HEIGHT_SHIFT    20
19916da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ST_ROUTE_STQ0      (0  << 24)
19926da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ST_ROUTE_MASK      (3  << 24)
19936da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ST_ROUTE_STQ1      (1  << 24)
19946da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ST_ROUTE_STQ2      (2  << 24)
19956da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ENDIAN_NO_SWAP     (0  << 26)
19966da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ENDIAN_16BPP_SWAP  (1  << 26)
19976da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ENDIAN_32BPP_SWAP  (2  << 26)
19986da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ENDIAN_HALFDW_SWAP (3  << 26)
19996da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_ALPHA_MASK_ENABLE  (1  << 28)
20006da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_CHROMA_KEY_ENABLE  (1  << 29)
20016da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_CUBIC_MAP_ENABLE   (1  << 30)
20026da3f7d4SAlexander von Gluck IV #       define RADEON_TXFORMAT_PERSPECTIVE_ENABLE (1  << 31)
20036da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_FACES_0             0x1d24
20046da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_FACES_1             0x1d28
20056da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_FACES_2             0x1d2c
20066da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_1_SHIFT          0
20076da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_1_SHIFT         4
20086da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_1_MASK           (0xf << 0)
20096da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_1_MASK          (0xf << 4)
20106da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_2_SHIFT          8
20116da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_2_SHIFT         12
20126da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_2_MASK           (0xf << 8)
20136da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_2_MASK          (0xf << 12)
20146da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_3_SHIFT          16
20156da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_3_SHIFT         20
20166da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_3_MASK           (0xf << 16)
20176da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_3_MASK          (0xf << 20)
20186da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_4_SHIFT          24
20196da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_4_SHIFT         28
20206da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_WIDTH_4_MASK           (0xf << 24)
20216da3f7d4SAlexander von Gluck IV #       define RADEON_FACE_HEIGHT_4_MASK          (0xf << 28)
20226da3f7d4SAlexander von Gluck IV 
20236da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXOFFSET_0                0x1c5c
20246da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXOFFSET_1                0x1c74
20256da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXOFFSET_2                0x1c8c
20266da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_ENDIAN_NO_SWAP     (0 << 0)
20276da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_ENDIAN_BYTE_SWAP   (1 << 0)
20286da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_ENDIAN_WORD_SWAP   (2 << 0)
20296da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_ENDIAN_HALFDW_SWAP (3 << 0)
20306da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_MACRO_LINEAR       (0 << 2)
20316da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_MACRO_TILE         (1 << 2)
20326da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_MICRO_LINEAR       (0 << 3)
20336da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_MICRO_TILE_X2      (1 << 3)
20346da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_MICRO_TILE_OPT     (2 << 3)
20356da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_OFFSET_MASK        0xffffffe0
20366da3f7d4SAlexander von Gluck IV #       define RADEON_TXO_OFFSET_SHIFT       5
20376da3f7d4SAlexander von Gluck IV 
20386da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T0_0         0x1dd0  /* bits [31:5] */
20396da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T0_1         0x1dd4
20406da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T0_2         0x1dd8
20416da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T0_3         0x1ddc
20426da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T0_4         0x1de0
20436da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T1_0         0x1e00
20446da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T1_1         0x1e04
20456da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T1_2         0x1e08
20466da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T1_3         0x1e0c
20476da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T1_4         0x1e10
20486da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T2_0         0x1e14
20496da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T2_1         0x1e18
20506da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T2_2         0x1e1c
20516da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T2_3         0x1e20
20526da3f7d4SAlexander von Gluck IV #define RADEON_PP_CUBIC_OFFSET_T2_4         0x1e24
20536da3f7d4SAlexander von Gluck IV 
20546da3f7d4SAlexander von Gluck IV #define RADEON_PP_TEX_SIZE_0                0x1d04  /* NPOT */
20556da3f7d4SAlexander von Gluck IV #define RADEON_PP_TEX_SIZE_1                0x1d0c
20566da3f7d4SAlexander von Gluck IV #define RADEON_PP_TEX_SIZE_2                0x1d14
20576da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_USIZE_MASK        (0x7ff << 0)
20586da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_USIZE_SHIFT       0
20596da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_VSIZE_MASK        (0x7ff << 16)
20606da3f7d4SAlexander von Gluck IV #       define RADEON_TEX_VSIZE_SHIFT       16
20616da3f7d4SAlexander von Gluck IV #       define RADEON_SIGNED_RGB_MASK       (1 << 30)
20626da3f7d4SAlexander von Gluck IV #       define RADEON_SIGNED_RGB_SHIFT      30
20636da3f7d4SAlexander von Gluck IV #       define RADEON_SIGNED_ALPHA_MASK     (1 << 31)
20646da3f7d4SAlexander von Gluck IV #       define RADEON_SIGNED_ALPHA_SHIFT    31
20656da3f7d4SAlexander von Gluck IV #define RADEON_PP_TEX_PITCH_0               0x1d08  /* NPOT */
20666da3f7d4SAlexander von Gluck IV #define RADEON_PP_TEX_PITCH_1               0x1d10  /* NPOT */
20676da3f7d4SAlexander von Gluck IV #define RADEON_PP_TEX_PITCH_2               0x1d18  /* NPOT */
20686da3f7d4SAlexander von Gluck IV /* note: bits 13-5: 32 byte aligned stride of texture map */
20696da3f7d4SAlexander von Gluck IV 
20706da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXCBLEND_0                0x1c60
20716da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXCBLEND_1                0x1c78
20726da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXCBLEND_2                0x1c90
20736da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_SHIFT          0
20746da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_MASK           (0x1f << 0)
20756da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_ZERO           (0    << 0)
20766da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_CURRENT_COLOR  (2    << 0)
20776da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_CURRENT_ALPHA  (3    << 0)
20786da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_DIFFUSE_COLOR  (4    << 0)
20796da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_DIFFUSE_ALPHA  (5    << 0)
20806da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_SPECULAR_COLOR (6    << 0)
20816da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_SPECULAR_ALPHA (7    << 0)
20826da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_TFACTOR_COLOR  (8    << 0)
20836da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_TFACTOR_ALPHA  (9    << 0)
20846da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T0_COLOR       (10   << 0)
20856da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T0_ALPHA       (11   << 0)
20866da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T1_COLOR       (12   << 0)
20876da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T1_ALPHA       (13   << 0)
20886da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T2_COLOR       (14   << 0)
20896da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T2_ALPHA       (15   << 0)
20906da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T3_COLOR       (16   << 0)
20916da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_A_T3_ALPHA       (17   << 0)
20926da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_SHIFT          5
20936da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_MASK           (0x1f << 5)
20946da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_ZERO           (0    << 5)
20956da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_CURRENT_COLOR  (2    << 5)
20966da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_CURRENT_ALPHA  (3    << 5)
20976da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_DIFFUSE_COLOR  (4    << 5)
20986da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_DIFFUSE_ALPHA  (5    << 5)
20996da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_SPECULAR_COLOR (6    << 5)
21006da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_SPECULAR_ALPHA (7    << 5)
21016da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_TFACTOR_COLOR  (8    << 5)
21026da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_TFACTOR_ALPHA  (9    << 5)
21036da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T0_COLOR       (10   << 5)
21046da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T0_ALPHA       (11   << 5)
21056da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T1_COLOR       (12   << 5)
21066da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T1_ALPHA       (13   << 5)
21076da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T2_COLOR       (14   << 5)
21086da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T2_ALPHA       (15   << 5)
21096da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T3_COLOR       (16   << 5)
21106da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_B_T3_ALPHA       (17   << 5)
21116da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_SHIFT          10
21126da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_MASK           (0x1f << 10)
21136da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_ZERO           (0    << 10)
21146da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_CURRENT_COLOR  (2    << 10)
21156da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_CURRENT_ALPHA  (3    << 10)
21166da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_DIFFUSE_COLOR  (4    << 10)
21176da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_DIFFUSE_ALPHA  (5    << 10)
21186da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_SPECULAR_COLOR (6    << 10)
21196da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_SPECULAR_ALPHA (7    << 10)
21206da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_TFACTOR_COLOR  (8    << 10)
21216da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_TFACTOR_ALPHA  (9    << 10)
21226da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T0_COLOR       (10   << 10)
21236da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T0_ALPHA       (11   << 10)
21246da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T1_COLOR       (12   << 10)
21256da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T1_ALPHA       (13   << 10)
21266da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T2_COLOR       (14   << 10)
21276da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T2_ALPHA       (15   << 10)
21286da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T3_COLOR       (16   << 10)
21296da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_C_T3_ALPHA       (17   << 10)
21306da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_A                 (1 << 15)
21316da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_A_SHIFT           15
21326da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_B                 (1 << 16)
21336da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_B_SHIFT           16
21346da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_C                 (1 << 17)
21356da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_C_SHIFT           17
21366da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_CTL_MASK             (7 << 18)
21376da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_CTL_ADD              (0 << 18)
21386da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_CTL_SUBTRACT         (1 << 18)
21396da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_CTL_ADDSIGNED        (2 << 18)
21406da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_CTL_BLEND            (3 << 18)
21416da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_CTL_DOT3             (4 << 18)
21426da3f7d4SAlexander von Gluck IV #       define RADEON_SCALE_SHIFT                21
21436da3f7d4SAlexander von Gluck IV #       define RADEON_SCALE_MASK                 (3 << 21)
21446da3f7d4SAlexander von Gluck IV #       define RADEON_SCALE_1X                   (0 << 21)
21456da3f7d4SAlexander von Gluck IV #       define RADEON_SCALE_2X                   (1 << 21)
21466da3f7d4SAlexander von Gluck IV #       define RADEON_SCALE_4X                   (2 << 21)
21476da3f7d4SAlexander von Gluck IV #       define RADEON_CLAMP_TX                   (1 << 23)
21486da3f7d4SAlexander von Gluck IV #       define RADEON_T0_EQ_TCUR                 (1 << 24)
21496da3f7d4SAlexander von Gluck IV #       define RADEON_T1_EQ_TCUR                 (1 << 25)
21506da3f7d4SAlexander von Gluck IV #       define RADEON_T2_EQ_TCUR                 (1 << 26)
21516da3f7d4SAlexander von Gluck IV #       define RADEON_T3_EQ_TCUR                 (1 << 27)
21526da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ARG_MASK             0x1f
21536da3f7d4SAlexander von Gluck IV #       define RADEON_COMP_ARG_SHIFT             15
21546da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXABLEND_0                0x1c64
21556da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXABLEND_1                0x1c7c
21566da3f7d4SAlexander von Gluck IV #define RADEON_PP_TXABLEND_2                0x1c94
21576da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_SHIFT          0
21586da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_MASK           (0xf << 0)
21596da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_ZERO           (0   << 0)
21606da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_CURRENT_ALPHA  (1   << 0)
21616da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_DIFFUSE_ALPHA  (2   << 0)
21626da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_SPECULAR_ALPHA (3   << 0)
21636da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_TFACTOR_ALPHA  (4   << 0)
21646da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_T0_ALPHA       (5   << 0)
21656da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_T1_ALPHA       (6   << 0)
21666da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_T2_ALPHA       (7   << 0)
21676da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_A_T3_ALPHA       (8   << 0)
21686da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_SHIFT          4
21696da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_MASK           (0xf << 4)
21706da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_ZERO           (0   << 4)
21716da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_CURRENT_ALPHA  (1   << 4)
21726da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_DIFFUSE_ALPHA  (2   << 4)
21736da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_SPECULAR_ALPHA (3   << 4)
21746da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_TFACTOR_ALPHA  (4   << 4)
21756da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_T0_ALPHA       (5   << 4)
21766da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_T1_ALPHA       (6   << 4)
21776da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_T2_ALPHA       (7   << 4)
21786da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_B_T3_ALPHA       (8   << 4)
21796da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_SHIFT          8
21806da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_MASK           (0xf << 8)
21816da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_ZERO           (0   << 8)
21826da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_CURRENT_ALPHA  (1   << 8)
21836da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_DIFFUSE_ALPHA  (2   << 8)
21846da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_SPECULAR_ALPHA (3   << 8)
21856da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_TFACTOR_ALPHA  (4   << 8)
21866da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_T0_ALPHA       (5   << 8)
21876da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_T1_ALPHA       (6   << 8)
21886da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_T2_ALPHA       (7   << 8)
21896da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_C_T3_ALPHA       (8   << 8)
21906da3f7d4SAlexander von Gluck IV #       define RADEON_DOT_ALPHA_DONT_REPLICATE   (1   << 9)
21916da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_ARG_MASK             0xf
21926da3f7d4SAlexander von Gluck IV 
21936da3f7d4SAlexander von Gluck IV #define RADEON_PP_TFACTOR_0                 0x1c68
21946da3f7d4SAlexander von Gluck IV #define RADEON_PP_TFACTOR_1                 0x1c80
21956da3f7d4SAlexander von Gluck IV #define RADEON_PP_TFACTOR_2                 0x1c98
21966da3f7d4SAlexander von Gluck IV 
21976da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_BLENDCNTL               0x1c20
21986da3f7d4SAlexander von Gluck IV #       define RADEON_COMB_FCN_MASK                    (3  << 12)
21996da3f7d4SAlexander von Gluck IV #       define RADEON_COMB_FCN_ADD_CLAMP               (0  << 12)
22006da3f7d4SAlexander von Gluck IV #       define RADEON_COMB_FCN_ADD_NOCLAMP             (1  << 12)
22016da3f7d4SAlexander von Gluck IV #       define RADEON_COMB_FCN_SUB_CLAMP               (2  << 12)
22026da3f7d4SAlexander von Gluck IV #       define RADEON_COMB_FCN_SUB_NOCLAMP             (3  << 12)
22036da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_ZERO                (32 << 16)
22046da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_ONE                 (33 << 16)
22056da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_SRC_COLOR           (34 << 16)
22066da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 16)
22076da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_DST_COLOR           (36 << 16)
22086da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 16)
22096da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_SRC_ALPHA           (38 << 16)
22106da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 16)
22116da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_DST_ALPHA           (40 << 16)
22126da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 16)
22136da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE  (42 << 16)
22146da3f7d4SAlexander von Gluck IV #       define RADEON_SRC_BLEND_MASK                   (63 << 16)
22156da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_ZERO                (32 << 24)
22166da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_ONE                 (33 << 24)
22176da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_SRC_COLOR           (34 << 24)
22186da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_COLOR (35 << 24)
22196da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_DST_COLOR           (36 << 24)
22206da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_ONE_MINUS_DST_COLOR (37 << 24)
22216da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_SRC_ALPHA           (38 << 24)
22226da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA (39 << 24)
22236da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_DST_ALPHA           (40 << 24)
22246da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_GL_ONE_MINUS_DST_ALPHA (41 << 24)
22256da3f7d4SAlexander von Gluck IV #       define RADEON_DST_BLEND_MASK                   (63 << 24)
22266da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_CNTL                    0x1c3c
22276da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_BLEND_ENABLE       (1  <<  0)
22286da3f7d4SAlexander von Gluck IV #       define RADEON_PLANE_MASK_ENABLE        (1  <<  1)
22296da3f7d4SAlexander von Gluck IV #       define RADEON_DITHER_ENABLE            (1  <<  2)
22306da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_ENABLE             (1  <<  3)
22316da3f7d4SAlexander von Gluck IV #       define RADEON_SCALE_DITHER_ENABLE      (1  <<  4)
22326da3f7d4SAlexander von Gluck IV #       define RADEON_DITHER_INIT              (1  <<  5)
22336da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_ENABLE               (1  <<  6)
22346da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ENABLE           (1  <<  7)
22356da3f7d4SAlexander von Gluck IV #       define RADEON_Z_ENABLE                 (1  <<  8)
22366da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTHXY_OFFSET_ENABLE    (1  <<  9)
22376da3f7d4SAlexander von Gluck IV #       define RADEON_RB3D_COLOR_FORMAT_SHIFT  10
22386da3f7d4SAlexander von Gluck IV 
22396da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_ARGB1555    3
22406da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_RGB565      4
22416da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_ARGB8888    6
22426da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_RGB332      7
22436da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_Y8          8
22446da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_RGB8        9
22456da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_YUV422_VYUY 11
22466da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_YUV422_YVYU 12
22476da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_aYUV444     14
22486da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_FORMAT_ARGB4444    15
22496da3f7d4SAlexander von Gluck IV 
22506da3f7d4SAlexander von Gluck IV #       define RADEON_CLRCMP_FLIP_ENABLE       (1  << 14)
22516da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_COLOROFFSET             0x1c40
22526da3f7d4SAlexander von Gluck IV #       define RADEON_COLOROFFSET_MASK      0xfffffff0
22536da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_COLORPITCH              0x1c48
22546da3f7d4SAlexander von Gluck IV #       define RADEON_COLORPITCH_MASK         0x000001ff8
22556da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_TILE_ENABLE       (1 << 16)
22566da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_MICROTILE_ENABLE  (1 << 17)
22576da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ENDIAN_NO_SWAP    (0 << 18)
22586da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ENDIAN_WORD_SWAP  (1 << 18)
22596da3f7d4SAlexander von Gluck IV #       define RADEON_COLOR_ENDIAN_DWORD_SWAP (2 << 18)
22606da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_DEPTHOFFSET             0x1c24
22616da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_DEPTHPITCH              0x1c28
22626da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTHPITCH_MASK         0x00001ff8
22636da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_ENDIAN_NO_SWAP    (0 << 18)
22646da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_ENDIAN_WORD_SWAP  (1 << 18)
22656da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_ENDIAN_DWORD_SWAP (2 << 18)
22666da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_PLANEMASK               0x1d84
22676da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_ROPCNTL                 0x1d80
22686da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_MASK              (15 << 8)
22696da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_CLEAR             (0  << 8)
22706da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_NOR               (1  << 8)
22716da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_AND_INVERTED      (2  << 8)
22726da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_COPY_INVERTED     (3  << 8)
22736da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_AND_REVERSE       (4  << 8)
22746da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_INVERT            (5  << 8)
22756da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_XOR               (6  << 8)
22766da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_NAND              (7  << 8)
22776da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_AND               (8  << 8)
22786da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_EQUIV             (9  << 8)
22796da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_NOOP              (10 << 8)
22806da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_OR_INVERTED       (11 << 8)
22816da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_COPY              (12 << 8)
22826da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_OR_REVERSE        (13 << 8)
22836da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_OR                (14 << 8)
22846da3f7d4SAlexander von Gluck IV #       define RADEON_ROP_SET               (15 << 8)
22856da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_STENCILREFMASK          0x1d7c
22866da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_REF_SHIFT       0
22876da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_REF_MASK        (0xff << 0)
22886da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_MASK_SHIFT      16
22896da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_VALUE_MASK      (0xff << 16)
22906da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_WRITEMASK_SHIFT 24
22916da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_WRITE_MASK      (0xff << 24)
22926da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_ZSTENCILCNTL            0x1c2c
22936da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_MASK          (0xf << 0)
22946da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_16BIT_INT_Z   (0  <<  0)
22956da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_24BIT_INT_Z   (2  <<  0)
22966da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_24BIT_FLOAT_Z (3  <<  0)
22976da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_32BIT_INT_Z   (4  <<  0)
22986da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_32BIT_FLOAT_Z (5  <<  0)
22996da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_16BIT_FLOAT_W (7  <<  0)
23006da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_24BIT_FLOAT_W (9  <<  0)
23016da3f7d4SAlexander von Gluck IV #       define RADEON_DEPTH_FORMAT_32BIT_FLOAT_W (11 <<  0)
23026da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_NEVER               (0  <<  4)
23036da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_LESS                (1  <<  4)
23046da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_LEQUAL              (2  <<  4)
23056da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_EQUAL               (3  <<  4)
23066da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_GEQUAL              (4  <<  4)
23076da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_GREATER             (5  <<  4)
23086da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_NEQUAL              (6  <<  4)
23096da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_ALWAYS              (7  <<  4)
23106da3f7d4SAlexander von Gluck IV #       define RADEON_Z_TEST_MASK                (7  <<  4)
23116da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_NEVER         (0  << 12)
23126da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_LESS          (1  << 12)
23136da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_LEQUAL        (2  << 12)
23146da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_EQUAL         (3  << 12)
23156da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_GEQUAL        (4  << 12)
23166da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_GREATER       (5  << 12)
23176da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_NEQUAL        (6  << 12)
23186da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_ALWAYS        (7  << 12)
23196da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_TEST_MASK          (0x7 << 12)
23206da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_KEEP          (0  << 16)
23216da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_ZERO          (1  << 16)
23226da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_REPLACE       (2  << 16)
23236da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_INC           (3  << 16)
23246da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_DEC           (4  << 16)
23256da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_INVERT        (5  << 16)
23266da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_FAIL_MASK          (0x7 << 16)
23276da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_KEEP         (0  << 20)
23286da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_ZERO         (1  << 20)
23296da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_REPLACE      (2  << 20)
23306da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_INC          (3  << 20)
23316da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_DEC          (4  << 20)
23326da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_INVERT       (5  << 20)
23336da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZPASS_MASK         (0x7 << 20)
23346da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_KEEP         (0  << 24)
23356da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_ZERO         (1  << 24)
23366da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_REPLACE      (2  << 24)
23376da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_INC          (3  << 24)
23386da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_DEC          (4  << 24)
23396da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_INVERT       (5  << 24)
23406da3f7d4SAlexander von Gluck IV #       define RADEON_STENCIL_ZFAIL_MASK         (0x7 << 24)
23416da3f7d4SAlexander von Gluck IV #       define RADEON_Z_COMPRESSION_ENABLE       (1  << 28)
23426da3f7d4SAlexander von Gluck IV #       define RADEON_FORCE_Z_DIRTY              (1  << 29)
23436da3f7d4SAlexander von Gluck IV #       define RADEON_Z_WRITE_ENABLE             (1  << 30)
23446da3f7d4SAlexander von Gluck IV #define RADEON_RE_LINE_PATTERN              0x1cd0
23456da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_PATTERN_MASK             0x0000ffff
23466da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_REPEAT_COUNT_SHIFT       16
23476da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_PATTERN_START_SHIFT      24
23486da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_PATTERN_LITTLE_BIT_ORDER (0 << 28)
23496da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_PATTERN_BIG_BIT_ORDER    (1 << 28)
23506da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_PATTERN_AUTO_RESET       (1 << 29)
23516da3f7d4SAlexander von Gluck IV #define RADEON_RE_LINE_STATE                0x1cd4
23526da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_CURRENT_PTR_SHIFT   0
23536da3f7d4SAlexander von Gluck IV #       define RADEON_LINE_CURRENT_COUNT_SHIFT 8
23546da3f7d4SAlexander von Gluck IV #define RADEON_RE_MISC                      0x26c4
23556da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_COORD_MASK       0x1f
23566da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_X_OFFSET_SHIFT   0
23576da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_X_OFFSET_MASK    (0x1f << 0)
23586da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_Y_OFFSET_SHIFT   8
23596da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_Y_OFFSET_MASK    (0x1f << 8)
23606da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_LITTLE_BIT_ORDER (0 << 16)
23616da3f7d4SAlexander von Gluck IV #       define RADEON_STIPPLE_BIG_BIT_ORDER    (1 << 16)
23626da3f7d4SAlexander von Gluck IV #define RADEON_RE_SOLID_COLOR               0x1c1c
23636da3f7d4SAlexander von Gluck IV #define RADEON_RE_TOP_LEFT                  0x26c0
23646da3f7d4SAlexander von Gluck IV #       define RADEON_RE_LEFT_SHIFT         0
23656da3f7d4SAlexander von Gluck IV #       define RADEON_RE_TOP_SHIFT          16
23666da3f7d4SAlexander von Gluck IV #define RADEON_RE_WIDTH_HEIGHT              0x1c44
23676da3f7d4SAlexander von Gluck IV #       define RADEON_RE_WIDTH_SHIFT        0
23686da3f7d4SAlexander von Gluck IV #       define RADEON_RE_HEIGHT_SHIFT       16
23696da3f7d4SAlexander von Gluck IV 
23706da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_ZPASS_DATA 0x3290
23716da3f7d4SAlexander von Gluck IV #define RADEON_RB3D_ZPASS_ADDR 0x3294
23726da3f7d4SAlexander von Gluck IV 
23736da3f7d4SAlexander von Gluck IV #define RADEON_SE_CNTL                      0x1c4c
23746da3f7d4SAlexander von Gluck IV #       define RADEON_FFACE_CULL_CW          (0 <<  0)
23756da3f7d4SAlexander von Gluck IV #       define RADEON_FFACE_CULL_CCW         (1 <<  0)
23766da3f7d4SAlexander von Gluck IV #       define RADEON_FFACE_CULL_DIR_MASK    (1 <<  0)
23776da3f7d4SAlexander von Gluck IV #       define RADEON_BFACE_CULL             (0 <<  1)
23786da3f7d4SAlexander von Gluck IV #       define RADEON_BFACE_SOLID            (3 <<  1)
23796da3f7d4SAlexander von Gluck IV #       define RADEON_FFACE_CULL             (0 <<  3)
23806da3f7d4SAlexander von Gluck IV #       define RADEON_FFACE_SOLID            (3 <<  3)
23816da3f7d4SAlexander von Gluck IV #       define RADEON_FFACE_CULL_MASK        (3 <<  3)
23826da3f7d4SAlexander von Gluck IV #       define RADEON_BADVTX_CULL_DISABLE    (1 <<  5)
23836da3f7d4SAlexander von Gluck IV #       define RADEON_FLAT_SHADE_VTX_0       (0 <<  6)
23846da3f7d4SAlexander von Gluck IV #       define RADEON_FLAT_SHADE_VTX_1       (1 <<  6)
23856da3f7d4SAlexander von Gluck IV #       define RADEON_FLAT_SHADE_VTX_2       (2 <<  6)
23866da3f7d4SAlexander von Gluck IV #       define RADEON_FLAT_SHADE_VTX_LAST    (3 <<  6)
23876da3f7d4SAlexander von Gluck IV #       define RADEON_DIFFUSE_SHADE_SOLID    (0 <<  8)
23886da3f7d4SAlexander von Gluck IV #       define RADEON_DIFFUSE_SHADE_FLAT     (1 <<  8)
23896da3f7d4SAlexander von Gluck IV #       define RADEON_DIFFUSE_SHADE_GOURAUD  (2 <<  8)
23906da3f7d4SAlexander von Gluck IV #       define RADEON_DIFFUSE_SHADE_MASK     (3 <<  8)
23916da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_SHADE_SOLID      (0 << 10)
23926da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_SHADE_FLAT       (1 << 10)
23936da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_SHADE_GOURAUD    (2 << 10)
23946da3f7d4SAlexander von Gluck IV #       define RADEON_ALPHA_SHADE_MASK       (3 << 10)
23956da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_SHADE_SOLID   (0 << 12)
23966da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_SHADE_FLAT    (1 << 12)
23976da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_SHADE_GOURAUD (2 << 12)
23986da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_SHADE_MASK    (3 << 12)
23996da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_SHADE_SOLID        (0 << 14)
24006da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_SHADE_FLAT         (1 << 14)
24016da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_SHADE_GOURAUD      (2 << 14)
24026da3f7d4SAlexander von Gluck IV #       define RADEON_FOG_SHADE_MASK         (3 << 14)
24036da3f7d4SAlexander von Gluck IV #       define RADEON_ZBIAS_ENABLE_POINT     (1 << 16)
24046da3f7d4SAlexander von Gluck IV #       define RADEON_ZBIAS_ENABLE_LINE      (1 << 17)
24056da3f7d4SAlexander von Gluck IV #       define RADEON_ZBIAS_ENABLE_TRI       (1 << 18)
24066da3f7d4SAlexander von Gluck IV #       define RADEON_WIDELINE_ENABLE        (1 << 20)
24076da3f7d4SAlexander von Gluck IV #       define RADEON_VPORT_XY_XFORM_ENABLE  (1 << 24)
24086da3f7d4SAlexander von Gluck IV #       define RADEON_VPORT_Z_XFORM_ENABLE   (1 << 25)
24096da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_PIX_CENTER_D3D     (0 << 27)
24106da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_PIX_CENTER_OGL     (1 << 27)
24116da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_MODE_TRUNC       (0 << 28)
24126da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_MODE_ROUND       (1 << 28)
24136da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_MODE_ROUND_EVEN  (2 << 28)
24146da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_MODE_ROUND_ODD   (3 << 28)
24156da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_PREC_16TH_PIX    (0 << 30)
24166da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_PREC_8TH_PIX     (1 << 30)
24176da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_PREC_4TH_PIX     (2 << 30)
24186da3f7d4SAlexander von Gluck IV #       define RADEON_ROUND_PREC_HALF_PIX    (3 << 30)
24196da3f7d4SAlexander von Gluck IV #define R200_RE_CNTL				0x1c50
24206da3f7d4SAlexander von Gluck IV #       define R200_STIPPLE_ENABLE		0x1
24216da3f7d4SAlexander von Gluck IV #       define R200_SCISSOR_ENABLE		0x2
24226da3f7d4SAlexander von Gluck IV #       define R200_PATTERN_ENABLE		0x4
24236da3f7d4SAlexander von Gluck IV #       define R200_PERSPECTIVE_ENABLE		0x8
24246da3f7d4SAlexander von Gluck IV #       define R200_POINT_SMOOTH		0x20
24256da3f7d4SAlexander von Gluck IV #       define R200_VTX_STQ0_D3D		0x00010000
24266da3f7d4SAlexander von Gluck IV #       define R200_VTX_STQ1_D3D		0x00040000
24276da3f7d4SAlexander von Gluck IV #       define R200_VTX_STQ2_D3D		0x00100000
24286da3f7d4SAlexander von Gluck IV #       define R200_VTX_STQ3_D3D		0x00400000
24296da3f7d4SAlexander von Gluck IV #       define R200_VTX_STQ4_D3D		0x01000000
24306da3f7d4SAlexander von Gluck IV #       define R200_VTX_STQ5_D3D		0x04000000
24316da3f7d4SAlexander von Gluck IV #define RADEON_SE_CNTL_STATUS               0x2140
24326da3f7d4SAlexander von Gluck IV #       define RADEON_VC_NO_SWAP            (0 << 0)
24336da3f7d4SAlexander von Gluck IV #       define RADEON_VC_16BIT_SWAP         (1 << 0)
24346da3f7d4SAlexander von Gluck IV #       define RADEON_VC_32BIT_SWAP         (2 << 0)
24356da3f7d4SAlexander von Gluck IV #       define RADEON_VC_HALF_DWORD_SWAP    (3 << 0)
24366da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_BYPASS            (1 << 8)
24376da3f7d4SAlexander von Gluck IV #define RADEON_SE_COORD_FMT                 0x1c50
24386da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_XY_PRE_MULT_1_OVER_W0  (1 <<  0)
24396da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_Z_PRE_MULT_1_OVER_W0   (1 <<  1)
24406da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST0_NONPARAMETRIC      (1 <<  8)
24416da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST1_NONPARAMETRIC      (1 <<  9)
24426da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST2_NONPARAMETRIC      (1 << 10)
24436da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST3_NONPARAMETRIC      (1 << 11)
24446da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_W0_NORMALIZE           (1 << 12)
24456da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_W0_IS_NOT_1_OVER_W0    (1 << 16)
24466da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST0_PRE_MULT_1_OVER_W0 (1 << 17)
24476da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST1_PRE_MULT_1_OVER_W0 (1 << 19)
24486da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST2_PRE_MULT_1_OVER_W0 (1 << 21)
24496da3f7d4SAlexander von Gluck IV #       define RADEON_VTX_ST3_PRE_MULT_1_OVER_W0 (1 << 23)
24506da3f7d4SAlexander von Gluck IV #       define RADEON_TEX1_W_ROUTING_USE_W0      (0 << 26)
24516da3f7d4SAlexander von Gluck IV #       define RADEON_TEX1_W_ROUTING_USE_Q1      (1 << 26)
24526da3f7d4SAlexander von Gluck IV #define RADEON_SE_LINE_WIDTH                0x1db8
24536da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_LIGHT_MODEL_CTL       0x226c
24546da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHTING_ENABLE              (1 << 0)
24556da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_IN_MODELSPACE          (1 << 1)
24566da3f7d4SAlexander von Gluck IV #       define RADEON_LOCAL_VIEWER                 (1 << 2)
24576da3f7d4SAlexander von Gluck IV #       define RADEON_NORMALIZE_NORMALS            (1 << 3)
24586da3f7d4SAlexander von Gluck IV #       define RADEON_RESCALE_NORMALS              (1 << 4)
24596da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_LIGHTS              (1 << 5)
24606da3f7d4SAlexander von Gluck IV #       define RADEON_DIFFUSE_SPECULAR_COMBINE     (1 << 6)
24616da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_ALPHA                  (1 << 7)
24626da3f7d4SAlexander von Gluck IV #       define RADEON_LOCAL_LIGHT_VEC_GL           (1 << 8)
24636da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_NO_NORMAL_AMBIENT_ONLY (1 << 9)
24646da3f7d4SAlexander von Gluck IV #       define RADEON_LM_SOURCE_STATE_PREMULT      0
24656da3f7d4SAlexander von Gluck IV #       define RADEON_LM_SOURCE_STATE_MULT         1
24666da3f7d4SAlexander von Gluck IV #       define RADEON_LM_SOURCE_VERTEX_DIFFUSE     2
24676da3f7d4SAlexander von Gluck IV #       define RADEON_LM_SOURCE_VERTEX_SPECULAR    3
24686da3f7d4SAlexander von Gluck IV #       define RADEON_EMISSIVE_SOURCE_SHIFT        16
24696da3f7d4SAlexander von Gluck IV #       define RADEON_AMBIENT_SOURCE_SHIFT         18
24706da3f7d4SAlexander von Gluck IV #       define RADEON_DIFFUSE_SOURCE_SHIFT         20
24716da3f7d4SAlexander von Gluck IV #       define RADEON_SPECULAR_SOURCE_SHIFT        22
24726da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_AMBIENT_RED     0x2220
24736da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_AMBIENT_GREEN   0x2224
24746da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_AMBIENT_BLUE    0x2228
24756da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_AMBIENT_ALPHA   0x222c
24766da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_DIFFUSE_RED     0x2230
24776da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_DIFFUSE_GREEN   0x2234
24786da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_DIFFUSE_BLUE    0x2238
24796da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_DIFFUSE_ALPHA   0x223c
24806da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED   0x2210
24816da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_EMMISSIVE_GREEN 0x2214
24826da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_EMMISSIVE_BLUE  0x2218
24836da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_EMMISSIVE_ALPHA 0x221c
24846da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_SPECULAR_RED    0x2240
24856da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_SPECULAR_GREEN  0x2244
24866da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_SPECULAR_BLUE   0x2248
24876da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATERIAL_SPECULAR_ALPHA  0x224c
24886da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATRIX_SELECT_0       0x225c
24896da3f7d4SAlexander von Gluck IV #       define RADEON_MODELVIEW_0_SHIFT        0
24906da3f7d4SAlexander von Gluck IV #       define RADEON_MODELVIEW_1_SHIFT        4
24916da3f7d4SAlexander von Gluck IV #       define RADEON_MODELVIEW_2_SHIFT        8
24926da3f7d4SAlexander von Gluck IV #       define RADEON_MODELVIEW_3_SHIFT        12
24936da3f7d4SAlexander von Gluck IV #       define RADEON_IT_MODELVIEW_0_SHIFT     16
24946da3f7d4SAlexander von Gluck IV #       define RADEON_IT_MODELVIEW_1_SHIFT     20
24956da3f7d4SAlexander von Gluck IV #       define RADEON_IT_MODELVIEW_2_SHIFT     24
24966da3f7d4SAlexander von Gluck IV #       define RADEON_IT_MODELVIEW_3_SHIFT     28
24976da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_MATRIX_SELECT_1       0x2260
24986da3f7d4SAlexander von Gluck IV #       define RADEON_MODELPROJECT_0_SHIFT     0
24996da3f7d4SAlexander von Gluck IV #       define RADEON_MODELPROJECT_1_SHIFT     4
25006da3f7d4SAlexander von Gluck IV #       define RADEON_MODELPROJECT_2_SHIFT     8
25016da3f7d4SAlexander von Gluck IV #       define RADEON_MODELPROJECT_3_SHIFT     12
25026da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_0_SHIFT           16
25036da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_1_SHIFT           20
25046da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_2_SHIFT           24
25056da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_3_SHIFT           28
25066da3f7d4SAlexander von Gluck IV 
25076da3f7d4SAlexander von Gluck IV 
25086da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_OUTPUT_VTX_FMT        0x2254
25096da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_W0                 (1 <<  0)
25106da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_FP_DIFFUSE         (1 <<  1)
25116da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_FP_ALPHA           (1 <<  2)
25126da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_PK_DIFFUSE         (1 <<  3)
25136da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_FP_SPEC            (1 <<  4)
25146da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_FP_FOG             (1 <<  5)
25156da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_PK_SPEC            (1 <<  6)
25166da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_ST0                (1 <<  7)
25176da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_ST1                (1 <<  8)
25186da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_Q1                 (1 <<  9)
25196da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_ST2                (1 << 10)
25206da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_Q2                 (1 << 11)
25216da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_ST3                (1 << 12)
25226da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_Q3                 (1 << 13)
25236da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_Q0                 (1 << 14)
25246da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_WEIGHT_COUNT_SHIFT 15
25256da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_NORM0              (1 << 18)
25266da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_XY1                (1 << 27)
25276da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_Z1                 (1 << 28)
25286da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_W1                 (1 << 29)
25296da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_NORM1              (1 << 30)
25306da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_VTX_Z0                 (1 << 31)
25316da3f7d4SAlexander von Gluck IV 
25326da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_OUTPUT_VTX_SEL        0x2258
25336da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_COMPUTE_XYZW           (1 << 0)
25346da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_COMPUTE_DIFFUSE        (1 << 1)
25356da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_COMPUTE_SPECULAR       (1 << 2)
25366da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FORCE_NAN_IF_COLOR_NAN (1 << 3)
25376da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FORCE_INORDER_PROC     (1 << 4)
25386da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_INPUT_TEX_0        0
25396da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_INPUT_TEX_1        1
25406da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_INPUT_TEX_2        2
25416da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_INPUT_TEX_3        3
25426da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_COMPUTED_TEX_0     8
25436da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_COMPUTED_TEX_1     9
25446da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_COMPUTED_TEX_2     10
25456da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_COMPUTED_TEX_3     11
25466da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_0_OUTPUT_SHIFT     16
25476da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_1_OUTPUT_SHIFT     20
25486da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_2_OUTPUT_SHIFT     24
25496da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_TEX_3_OUTPUT_SHIFT     28
25506da3f7d4SAlexander von Gluck IV 
25516da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_PER_LIGHT_CTL_0       0x2270
25526da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_ENABLE               (1 <<  0)
25536da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_ENABLE_AMBIENT       (1 <<  1)
25546da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_ENABLE_SPECULAR      (1 <<  2)
25556da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_IS_LOCAL             (1 <<  3)
25566da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_IS_SPOT              (1 <<  4)
25576da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_DUAL_CONE            (1 <<  5)
25586da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_ENABLE_RANGE_ATTEN   (1 <<  6)
25596da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_CONSTANT_RANGE_ATTEN (1 <<  7)
25606da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_0_SHIFT                0
25616da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_ENABLE               (1 << 16)
25626da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_ENABLE_AMBIENT       (1 << 17)
25636da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_ENABLE_SPECULAR      (1 << 18)
25646da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_IS_LOCAL             (1 << 19)
25656da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_IS_SPOT              (1 << 20)
25666da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_DUAL_CONE            (1 << 21)
25676da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_ENABLE_RANGE_ATTEN   (1 << 22)
25686da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_CONSTANT_RANGE_ATTEN (1 << 23)
25696da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_1_SHIFT                16
25706da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_PER_LIGHT_CTL_1       0x2274
25716da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_2_SHIFT            0
25726da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_3_SHIFT            16
25736da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_PER_LIGHT_CTL_2       0x2278
25746da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_4_SHIFT            0
25756da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_5_SHIFT            16
25766da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_PER_LIGHT_CTL_3       0x227c
25776da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_6_SHIFT            0
25786da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_7_SHIFT            16
25796da3f7d4SAlexander von Gluck IV 
25806da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_SHININESS             0x2250
25816da3f7d4SAlexander von Gluck IV 
25826da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_TEXTURE_PROC_CTL      0x2268
25836da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_TEXMAT_0_ENABLE      (1 << 0)
25846da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_TEXMAT_1_ENABLE      (1 << 1)
25856da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_TEXMAT_2_ENABLE      (1 << 2)
25866da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_TEXMAT_3_ENABLE      (1 << 3)
25876da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_0_ENABLE             (1 << 4)
25886da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_1_ENABLE             (1 << 5)
25896da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_2_ENABLE             (1 << 6)
25906da3f7d4SAlexander von Gluck IV #       define RADEON_TEXMAT_3_ENABLE             (1 << 7)
25916da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_MASK           0xf
25926da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_TEXCOORD_0     0
25936da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_TEXCOORD_1     1
25946da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_TEXCOORD_2     2
25956da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_TEXCOORD_3     3
25966da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_OBJ            4
25976da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_EYE            5
25986da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_EYE_NORMAL     6
25996da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_EYE_REFLECT    7
26006da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_INPUT_EYE_NORMALIZED 8
26016da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_0_INPUT_SHIFT        16
26026da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_1_INPUT_SHIFT        20
26036da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_2_INPUT_SHIFT        24
26046da3f7d4SAlexander von Gluck IV #       define RADEON_TEXGEN_3_INPUT_SHIFT        28
26056da3f7d4SAlexander von Gluck IV 
26066da3f7d4SAlexander von Gluck IV #define RADEON_SE_TCL_UCP_VERT_BLEND_CTL    0x2264
26076da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_IN_CLIP_SPACE            (1 <<  0)
26086da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_IN_MODEL_SPACE           (1 <<  1)
26096da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_ENABLE_0                 (1 <<  2)
26106da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_ENABLE_1                 (1 <<  3)
26116da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_ENABLE_2                 (1 <<  4)
26126da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_ENABLE_3                 (1 <<  5)
26136da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_ENABLE_4                 (1 <<  6)
26146da3f7d4SAlexander von Gluck IV #       define RADEON_UCP_ENABLE_5                 (1 <<  7)
26156da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FOG_MASK                 (3 <<  8)
26166da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FOG_DISABLE              (0 <<  8)
26176da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FOG_EXP                  (1 <<  8)
26186da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FOG_EXP2                 (2 <<  8)
26196da3f7d4SAlexander von Gluck IV #       define RADEON_TCL_FOG_LINEAR               (3 <<  8)
26206da3f7d4SAlexander von Gluck IV #       define RADEON_RNG_BASED_FOG                (1 << 10)
26216da3f7d4SAlexander von Gluck IV #       define RADEON_LIGHT_TWOSIDE                (1 << 11)
26226da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_OP_COUNT_MASK          (7 << 12)
26236da3f7d4SAlexander von Gluck IV #       define RADEON_BLEND_OP_COUNT_SHIFT         12
26246da3f7d4SAlexander von Gluck IV #       define RADEON_POSITION_BLEND_OP_ENABLE     (1 << 16)
26256da3f7d4SAlexander von Gluck IV #       define RADEON_NORMAL_BLEND_OP_ENABLE       (1 << 17)
26266da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_0_PRIMARY   (1 << 18)
26276da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_0_SECONDARY (1 << 18)
26286da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_1_PRIMARY   (1 << 19)
26296da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_1_SECONDARY (1 << 19)
26306da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_2_PRIMARY   (1 << 20)
26316da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_2_SECONDARY (1 << 20)
26326da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_3_PRIMARY   (1 << 21)
26336da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_SRC_3_SECONDARY (1 << 21)
26346da3f7d4SAlexander von Gluck IV #       define RADEON_VERTEX_BLEND_WGT_MINUS_ONE   (1 << 22)
26356da3f7d4SAlexander von Gluck IV #       define RADEON_CULL_FRONT_IS_CW             (0 << 28)
26366da3f7d4SAlexander von Gluck IV #       define RADEON_CULL_FRONT_IS_CCW            (1 << 28)
26376da3f7d4SAlexander von Gluck IV #       define RADEON_CULL_FRONT                   (1 << 29)
26386da3f7d4SAlexander von Gluck IV #       define RADEON_CULL_BACK                    (1 << 30)
26396da3f7d4SAlexander von Gluck IV #       define RADEON_FORCE_W_TO_ONE               (1 << 31)
26406da3f7d4SAlexander von Gluck IV 
26416da3f7d4SAlexander von Gluck IV #define RADEON_SE_VPORT_XSCALE              0x1d98
26426da3f7d4SAlexander von Gluck IV #define RADEON_SE_VPORT_XOFFSET             0x1d9c
26436da3f7d4SAlexander von Gluck IV #define RADEON_SE_VPORT_YSCALE              0x1da0
26446da3f7d4SAlexander von Gluck IV #define RADEON_SE_VPORT_YOFFSET             0x1da4
26456da3f7d4SAlexander von Gluck IV #define RADEON_SE_VPORT_ZSCALE              0x1da8
26466da3f7d4SAlexander von Gluck IV #define RADEON_SE_VPORT_ZOFFSET             0x1dac
26476da3f7d4SAlexander von Gluck IV #define RADEON_SE_ZBIAS_FACTOR              0x1db0
26486da3f7d4SAlexander von Gluck IV #define RADEON_SE_ZBIAS_CONSTANT            0x1db4
26496da3f7d4SAlexander von Gluck IV 
26506da3f7d4SAlexander von Gluck IV #define RADEON_SE_VTX_FMT                   0x2080
26516da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_XY         0x00000000
26526da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_W0         0x00000001
26536da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_FPCOLOR    0x00000002
26546da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_FPALPHA    0x00000004
26556da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_PKCOLOR    0x00000008
26566da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_FPSPEC     0x00000010
26576da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_FPFOG      0x00000020
26586da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_PKSPEC     0x00000040
26596da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_ST0        0x00000080
26606da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_ST1        0x00000100
26616da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_Q1         0x00000200
26626da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_ST2        0x00000400
26636da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_Q2         0x00000800
26646da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_ST3        0x00001000
26656da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_Q3         0x00002000
26666da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_Q0         0x00004000
26676da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_BLND_WEIGHT_CNT_MASK  0x00038000
26686da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_N0         0x00040000
26696da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_XY1        0x08000000
26706da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_Z1         0x10000000
26716da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_W1         0x20000000
26726da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_N1         0x40000000
26736da3f7d4SAlexander von Gluck IV #       define RADEON_SE_VTX_FMT_Z          0x80000000
26746da3f7d4SAlexander von Gluck IV 
26756da3f7d4SAlexander von Gluck IV #define RADEON_SE_VF_CNTL                             0x2084
26766da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_POINT_LIST         1
26776da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_LINE_LIST          2
26786da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_LINE_STRIP         3
26796da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_TRIANGLE_LIST      4
26806da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_TRIANGLE_FAN       5
26816da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_TRIANGLE_STRIP     6
26826da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_TRIANGLE_FLAG      7
26836da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_RECTANGLE_LIST     8
26846da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_POINT_LIST_3       9
26856da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_LINE_LIST_3        10
26866da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_SPIRIT_LIST        11
26876da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_LINE_LOOP          12
26886da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_QUAD_LIST          13
26896da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_QUAD_STRIP         14
26906da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_TYPE_POLYGON            15
26916da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_WALK_STATE              (0<<4)
26926da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_WALK_INDEX              (1<<4)
26936da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_WALK_LIST               (2<<4)
26946da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PRIM_WALK_DATA               (3<<4)
26956da3f7d4SAlexander von Gluck IV #       define RADEON_VF_COLOR_ORDER_RGBA             (1<<6)
26966da3f7d4SAlexander von Gluck IV #       define RADEON_VF_RADEON_MODE                  (1<<8)
26976da3f7d4SAlexander von Gluck IV #       define RADEON_VF_TCL_OUTPUT_CTL_ENA           (1<<9)
26986da3f7d4SAlexander von Gluck IV #       define RADEON_VF_PROG_STREAM_ENA              (1<<10)
26996da3f7d4SAlexander von Gluck IV #       define RADEON_VF_INDEX_SIZE_SHIFT             11
27006da3f7d4SAlexander von Gluck IV #       define RADEON_VF_NUM_VERTICES_SHIFT           16
27016da3f7d4SAlexander von Gluck IV 
27026da3f7d4SAlexander von Gluck IV #define RADEON_SE_PORT_DATA0			0x2000
27036da3f7d4SAlexander von Gluck IV 
27046da3f7d4SAlexander von Gluck IV #define R200_SE_VAP_CNTL			0x2080
27056da3f7d4SAlexander von Gluck IV #       define R200_VAP_TCL_ENABLE		0x00000001
27066da3f7d4SAlexander von Gluck IV #       define R200_VAP_SINGLE_BUF_STATE_ENABLE	0x00000010
27076da3f7d4SAlexander von Gluck IV #       define R200_VAP_FORCE_W_TO_ONE		0x00010000
27086da3f7d4SAlexander von Gluck IV #       define R200_VAP_D3D_TEX_DEFAULT		0x00020000
27096da3f7d4SAlexander von Gluck IV #       define R200_VAP_VF_MAX_VTX_NUM__SHIFT	18
27106da3f7d4SAlexander von Gluck IV #       define R200_VAP_VF_MAX_VTX_NUM		(9 << 18)
27116da3f7d4SAlexander von Gluck IV #       define R200_VAP_DX_CLIP_SPACE_DEF	0x00400000
27126da3f7d4SAlexander von Gluck IV #define R200_VF_MAX_VTX_INDX			0x210c
27136da3f7d4SAlexander von Gluck IV #define R200_VF_MIN_VTX_INDX			0x2110
27146da3f7d4SAlexander von Gluck IV #define R200_SE_VTE_CNTL			0x20b0
27156da3f7d4SAlexander von Gluck IV #       define R200_VPORT_X_SCALE_ENA			0x00000001
27166da3f7d4SAlexander von Gluck IV #       define R200_VPORT_X_OFFSET_ENA			0x00000002
27176da3f7d4SAlexander von Gluck IV #       define R200_VPORT_Y_SCALE_ENA			0x00000004
27186da3f7d4SAlexander von Gluck IV #       define R200_VPORT_Y_OFFSET_ENA			0x00000008
27196da3f7d4SAlexander von Gluck IV #       define R200_VPORT_Z_SCALE_ENA			0x00000010
27206da3f7d4SAlexander von Gluck IV #       define R200_VPORT_Z_OFFSET_ENA			0x00000020
27216da3f7d4SAlexander von Gluck IV #       define R200_VTX_XY_FMT				0x00000100
27226da3f7d4SAlexander von Gluck IV #       define R200_VTX_Z_FMT				0x00000200
27236da3f7d4SAlexander von Gluck IV #       define R200_VTX_W0_FMT				0x00000400
27246da3f7d4SAlexander von Gluck IV #       define R200_VTX_W0_NORMALIZE			0x00000800
27256da3f7d4SAlexander von Gluck IV #       define R200_VTX_ST_DENORMALIZED		0x00001000
27266da3f7d4SAlexander von Gluck IV #define R200_SE_VAP_CNTL_STATUS			0x2140
27276da3f7d4SAlexander von Gluck IV #       define R200_VC_NO_SWAP			(0 << 0)
27286da3f7d4SAlexander von Gluck IV #       define R200_VC_16BIT_SWAP		(1 << 0)
27296da3f7d4SAlexander von Gluck IV #       define R200_VC_32BIT_SWAP		(2 << 0)
27306da3f7d4SAlexander von Gluck IV #define R200_PP_TXFILTER_0			0x2c00
27316da3f7d4SAlexander von Gluck IV #define R200_PP_TXFILTER_1			0x2c20
27326da3f7d4SAlexander von Gluck IV #define R200_PP_TXFILTER_2			0x2c40
27336da3f7d4SAlexander von Gluck IV #define R200_PP_TXFILTER_3			0x2c60
27346da3f7d4SAlexander von Gluck IV #define R200_PP_TXFILTER_4			0x2c80
27356da3f7d4SAlexander von Gluck IV #define R200_PP_TXFILTER_5			0x2ca0
27366da3f7d4SAlexander von Gluck IV #       define R200_MAG_FILTER_NEAREST		(0  <<  0)
27376da3f7d4SAlexander von Gluck IV #       define R200_MAG_FILTER_LINEAR		(1  <<  0)
27386da3f7d4SAlexander von Gluck IV #       define R200_MAG_FILTER_MASK		(1  <<  0)
27396da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_NEAREST		(0  <<  1)
27406da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_LINEAR		(1  <<  1)
27416da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_NEAREST_MIP_NEAREST (2  <<  1)
27426da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_NEAREST_MIP_LINEAR (3  <<  1)
27436da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_LINEAR_MIP_NEAREST (6  <<  1)
27446da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_LINEAR_MIP_LINEAR (7  <<  1)
27456da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_ANISO_NEAREST	(8  <<  1)
27466da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_ANISO_LINEAR	(9  <<  1)
27476da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_ANISO_NEAREST_MIP_NEAREST (10 <<  1)
27486da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_ANISO_NEAREST_MIP_LINEAR (11 <<  1)
27496da3f7d4SAlexander von Gluck IV #       define R200_MIN_FILTER_MASK		(15 <<  1)
27506da3f7d4SAlexander von Gluck IV #       define R200_MAX_ANISO_1_TO_1		(0  <<  5)
27516da3f7d4SAlexander von Gluck IV #       define R200_MAX_ANISO_2_TO_1		(1  <<  5)
27526da3f7d4SAlexander von Gluck IV #       define R200_MAX_ANISO_4_TO_1		(2  <<  5)
27536da3f7d4SAlexander von Gluck IV #       define R200_MAX_ANISO_8_TO_1		(3  <<  5)
27546da3f7d4SAlexander von Gluck IV #       define R200_MAX_ANISO_16_TO_1		(4  <<  5)
27556da3f7d4SAlexander von Gluck IV #       define R200_MAX_ANISO_MASK		(7  <<  5)
27566da3f7d4SAlexander von Gluck IV #       define R200_MAX_MIP_LEVEL_MASK		(0x0f << 16)
27576da3f7d4SAlexander von Gluck IV #       define R200_MAX_MIP_LEVEL_SHIFT		16
27586da3f7d4SAlexander von Gluck IV #       define R200_YUV_TO_RGB			(1  << 20)
27596da3f7d4SAlexander von Gluck IV #       define R200_YUV_TEMPERATURE_COOL	(0  << 21)
27606da3f7d4SAlexander von Gluck IV #       define R200_YUV_TEMPERATURE_HOT		(1  << 21)
27616da3f7d4SAlexander von Gluck IV #       define R200_YUV_TEMPERATURE_MASK	(1  << 21)
27626da3f7d4SAlexander von Gluck IV #       define R200_WRAPEN_S			(1  << 22)
27636da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_WRAP		(0  << 23)
27646da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_MIRROR		(1  << 23)
27656da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_CLAMP_LAST		(2  << 23)
27666da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_MIRROR_CLAMP_LAST	(3  << 23)
27676da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_CLAMP_BORDER	(4  << 23)
27686da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_MIRROR_CLAMP_BORDER	(5  << 23)
27696da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_CLAMP_GL		(6  << 23)
27706da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_MIRROR_CLAMP_GL	(7  << 23)
27716da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_S_MASK		(7  << 23)
27726da3f7d4SAlexander von Gluck IV #       define R200_WRAPEN_T			(1  << 26)
27736da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_WRAP		(0  << 27)
27746da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_MIRROR		(1  << 27)
27756da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_CLAMP_LAST		(2  << 27)
27766da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_MIRROR_CLAMP_LAST	(3  << 27)
27776da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_CLAMP_BORDER	(4  << 27)
27786da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_MIRROR_CLAMP_BORDER	(5  << 27)
27796da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_CLAMP_GL		(6  << 27)
27806da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_MIRROR_CLAMP_GL	(7  << 27)
27816da3f7d4SAlexander von Gluck IV #       define R200_CLAMP_T_MASK		(7  << 27)
27826da3f7d4SAlexander von Gluck IV #       define R200_KILL_LT_ZERO		(1  << 30)
27836da3f7d4SAlexander von Gluck IV #       define R200_BORDER_MODE_OGL		(0  << 31)
27846da3f7d4SAlexander von Gluck IV #       define R200_BORDER_MODE_D3D		(1  << 31)
27856da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_0			0x2c04
27866da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_1			0x2c24
27876da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_2			0x2c44
27886da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_3			0x2c64
27896da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_4			0x2c84
27906da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_5			0x2ca4
27916da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_I8			(0 << 0)
27926da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_AI88		(1 << 0)
27936da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_RGB332		(2 << 0)
27946da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ARGB1555		(3 << 0)
27956da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_RGB565		(4 << 0)
27966da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ARGB4444		(5 << 0)
27976da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ARGB8888		(6 << 0)
27986da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_RGBA8888		(7 << 0)
27996da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_Y8			(8 << 0)
28006da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_AVYU4444		(9 << 0)
28016da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_VYUY422		(10 << 0)
28026da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_YVYU422		(11 << 0)
28036da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_DXT1		(12 << 0)
28046da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_DXT23		(14 << 0)
28056da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_DXT45		(15 << 0)
28066da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_DVDU88		(18 << 0)
28076da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_LDVDU655		(19 << 0)
28086da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_LDVDU8888		(20 << 0)
28096da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_GR1616		(21 << 0)
28106da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ABGR8888		(22 << 0)
28116da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_BGR111110		(23 << 0)
28126da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_FORMAT_MASK	(31 <<	0)
28136da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_FORMAT_SHIFT	0
28146da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ALPHA_IN_MAP	(1 << 6)
28156da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_NON_POWER2		(1 << 7)
28166da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_WIDTH_MASK		(15 <<	8)
28176da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_WIDTH_SHIFT	8
28186da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_HEIGHT_MASK	(15 << 12)
28196da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_HEIGHT_SHIFT	12
28206da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_F5_WIDTH_MASK	(15 << 16)	/* cube face 5 */
28216da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_F5_WIDTH_SHIFT	16
28226da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_F5_HEIGHT_MASK	(15 << 20)
28236da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_F5_HEIGHT_SHIFT	20
28246da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_STQ0	(0 << 24)
28256da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_STQ1	(1 << 24)
28266da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_STQ2	(2 << 24)
28276da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_STQ3	(3 << 24)
28286da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_STQ4	(4 << 24)
28296da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_STQ5	(5 << 24)
28306da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_MASK	(7 << 24)
28316da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ST_ROUTE_SHIFT	24
28326da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_LOOKUP_DISABLE	(1 << 27)
28336da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_ALPHA_MASK_ENABLE	(1 << 28)
28346da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_CHROMA_KEY_ENABLE	(1 << 29)
28356da3f7d4SAlexander von Gluck IV #       define R200_TXFORMAT_CUBIC_MAP_ENABLE		(1 << 30)
28366da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_X_0                    0x2c08
28376da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_X_1                    0x2c28
28386da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_X_2                    0x2c48
28396da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_X_3                    0x2c68
28406da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_X_4                    0x2c88
28416da3f7d4SAlexander von Gluck IV #define R200_PP_TXFORMAT_X_5                    0x2ca8
28426da3f7d4SAlexander von Gluck IV 
28436da3f7d4SAlexander von Gluck IV #define R200_PP_TXSIZE_0			0x2c0c /* NPOT only */
28446da3f7d4SAlexander von Gluck IV #define R200_PP_TXSIZE_1			0x2c2c /* NPOT only */
28456da3f7d4SAlexander von Gluck IV #define R200_PP_TXSIZE_2			0x2c4c /* NPOT only */
28466da3f7d4SAlexander von Gluck IV #define R200_PP_TXSIZE_3			0x2c6c /* NPOT only */
28476da3f7d4SAlexander von Gluck IV #define R200_PP_TXSIZE_4			0x2c8c /* NPOT only */
28486da3f7d4SAlexander von Gluck IV #define R200_PP_TXSIZE_5			0x2cac /* NPOT only */
28496da3f7d4SAlexander von Gluck IV 
28506da3f7d4SAlexander von Gluck IV #define R200_PP_TXPITCH_0                       0x2c10 /* NPOT only */
28516da3f7d4SAlexander von Gluck IV #define R200_PP_TXPITCH_1			0x2c30 /* NPOT only */
28526da3f7d4SAlexander von Gluck IV #define R200_PP_TXPITCH_2			0x2c50 /* NPOT only */
28536da3f7d4SAlexander von Gluck IV #define R200_PP_TXPITCH_3			0x2c70 /* NPOT only */
28546da3f7d4SAlexander von Gluck IV #define R200_PP_TXPITCH_4			0x2c90 /* NPOT only */
28556da3f7d4SAlexander von Gluck IV #define R200_PP_TXPITCH_5			0x2cb0 /* NPOT only */
28566da3f7d4SAlexander von Gluck IV 
28576da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_FACES_0			0x2c18
28586da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_FACES_1			0x2c38
28596da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_FACES_2			0x2c58
28606da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_FACES_3			0x2c78
28616da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_FACES_4			0x2c98
28626da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_FACES_5			0x2cb8
28636da3f7d4SAlexander von Gluck IV 
28646da3f7d4SAlexander von Gluck IV #define R200_PP_TXOFFSET_0			0x2d00
28656da3f7d4SAlexander von Gluck IV #       define R200_TXO_ENDIAN_NO_SWAP		(0 << 0)
28666da3f7d4SAlexander von Gluck IV #       define R200_TXO_ENDIAN_BYTE_SWAP	(1 << 0)
28676da3f7d4SAlexander von Gluck IV #       define R200_TXO_ENDIAN_WORD_SWAP	(2 << 0)
28686da3f7d4SAlexander von Gluck IV #       define R200_TXO_ENDIAN_HALFDW_SWAP	(3 << 0)
28696da3f7d4SAlexander von Gluck IV #       define R200_TXO_MACRO_LINEAR		(0 << 2)
28706da3f7d4SAlexander von Gluck IV #       define R200_TXO_MACRO_TILE		(1 << 2)
28716da3f7d4SAlexander von Gluck IV #       define R200_TXO_MICRO_LINEAR		(0 << 3)
28726da3f7d4SAlexander von Gluck IV #       define R200_TXO_MICRO_TILE		(1 << 3)
28736da3f7d4SAlexander von Gluck IV #       define R200_TXO_OFFSET_MASK		0xffffffe0
28746da3f7d4SAlexander von Gluck IV #       define R200_TXO_OFFSET_SHIFT		5
28756da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F1_0         0x2d04
28766da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F2_0         0x2d08
28776da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F3_0         0x2d0c
28786da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F4_0         0x2d10
28796da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F5_0         0x2d14
28806da3f7d4SAlexander von Gluck IV 
28816da3f7d4SAlexander von Gluck IV #define R200_PP_TXOFFSET_1			0x2d18
28826da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F1_1         0x2d1c
28836da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F2_1         0x2d20
28846da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F3_1         0x2d24
28856da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F4_1         0x2d28
28866da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F5_1         0x2d2c
28876da3f7d4SAlexander von Gluck IV 
28886da3f7d4SAlexander von Gluck IV #define R200_PP_TXOFFSET_2			0x2d30
28896da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F1_2         0x2d34
28906da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F2_2         0x2d38
28916da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F3_2         0x2d3c
28926da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F4_2         0x2d40
28936da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F5_2         0x2d44
28946da3f7d4SAlexander von Gluck IV 
28956da3f7d4SAlexander von Gluck IV #define R200_PP_TXOFFSET_3			0x2d48
28966da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F1_3         0x2d4c
28976da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F2_3         0x2d50
28986da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F3_3         0x2d54
28996da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F4_3         0x2d58
29006da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F5_3         0x2d5c
29016da3f7d4SAlexander von Gluck IV #define R200_PP_TXOFFSET_4			0x2d60
29026da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F1_4         0x2d64
29036da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F2_4         0x2d68
29046da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F3_4         0x2d6c
29056da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F4_4         0x2d70
29066da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F5_4         0x2d74
29076da3f7d4SAlexander von Gluck IV #define R200_PP_TXOFFSET_5			0x2d78
29086da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F1_5         0x2d7c
29096da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F2_5         0x2d80
29106da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F3_5         0x2d84
29116da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F4_5         0x2d88
29126da3f7d4SAlexander von Gluck IV #define R200_PP_CUBIC_OFFSET_F5_5         0x2d8c
29136da3f7d4SAlexander von Gluck IV 
29146da3f7d4SAlexander von Gluck IV #define R200_PP_TFACTOR_0			0x2ee0
29156da3f7d4SAlexander von Gluck IV #define R200_PP_TFACTOR_1			0x2ee4
29166da3f7d4SAlexander von Gluck IV #define R200_PP_TFACTOR_2			0x2ee8
29176da3f7d4SAlexander von Gluck IV #define R200_PP_TFACTOR_3			0x2eec
29186da3f7d4SAlexander von Gluck IV #define R200_PP_TFACTOR_4			0x2ef0
29196da3f7d4SAlexander von Gluck IV #define R200_PP_TFACTOR_5			0x2ef4
29206da3f7d4SAlexander von Gluck IV 
29216da3f7d4SAlexander von Gluck IV #define R200_PP_TXCBLEND_0			0x2f00
29226da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_ZERO		(0)
29236da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_CURRENT_COLOR	(2)
29246da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_CURRENT_ALPHA	(3)
29256da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_DIFFUSE_COLOR	(4)
29266da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_DIFFUSE_ALPHA	(5)
29276da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_SPECULAR_COLOR	(6)
29286da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_SPECULAR_ALPHA	(7)
29296da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_TFACTOR_COLOR	(8)
29306da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_TFACTOR_ALPHA	(9)
29316da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R0_COLOR		(10)
29326da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R0_ALPHA		(11)
29336da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R1_COLOR		(12)
29346da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R1_ALPHA		(13)
29356da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R2_COLOR		(14)
29366da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R2_ALPHA		(15)
29376da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R3_COLOR		(16)
29386da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R3_ALPHA		(17)
29396da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R4_COLOR		(18)
29406da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R4_ALPHA		(19)
29416da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R5_COLOR		(20)
29426da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_R5_ALPHA		(21)
29436da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_TFACTOR1_COLOR	(26)
29446da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_TFACTOR1_ALPHA	(27)
29456da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_MASK		(31 << 0)
29466da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_A_SHIFT		0
29476da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_ZERO		(0 << 5)
29486da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_CURRENT_COLOR	(2 << 5)
29496da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_CURRENT_ALPHA	(3 << 5)
29506da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_DIFFUSE_COLOR	(4 << 5)
29516da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_DIFFUSE_ALPHA	(5 << 5)
29526da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_SPECULAR_COLOR	(6 << 5)
29536da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_SPECULAR_ALPHA	(7 << 5)
29546da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_TFACTOR_COLOR	(8 << 5)
29556da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_TFACTOR_ALPHA	(9 << 5)
29566da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R0_COLOR		(10 << 5)
29576da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R0_ALPHA		(11 << 5)
29586da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R1_COLOR		(12 << 5)
29596da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R1_ALPHA		(13 << 5)
29606da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R2_COLOR		(14 << 5)
29616da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R2_ALPHA		(15 << 5)
29626da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R3_COLOR		(16 << 5)
29636da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R3_ALPHA		(17 << 5)
29646da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R4_COLOR		(18 << 5)
29656da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R4_ALPHA		(19 << 5)
29666da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R5_COLOR		(20 << 5)
29676da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_R5_ALPHA		(21 << 5)
29686da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_TFACTOR1_COLOR	(26 << 5)
29696da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_TFACTOR1_ALPHA	(27 << 5)
29706da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_MASK		(31 << 5)
29716da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_B_SHIFT		5
29726da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_ZERO		(0 << 10)
29736da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_CURRENT_COLOR	(2 << 10)
29746da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_CURRENT_ALPHA	(3 << 10)
29756da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_DIFFUSE_COLOR	(4 << 10)
29766da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_DIFFUSE_ALPHA	(5 << 10)
29776da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_SPECULAR_COLOR	(6 << 10)
29786da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_SPECULAR_ALPHA	(7 << 10)
29796da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_TFACTOR_COLOR	(8 << 10)
29806da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_TFACTOR_ALPHA	(9 << 10)
29816da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R0_COLOR		(10 << 10)
29826da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R0_ALPHA		(11 << 10)
29836da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R1_COLOR		(12 << 10)
29846da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R1_ALPHA		(13 << 10)
29856da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R2_COLOR		(14 << 10)
29866da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R2_ALPHA		(15 << 10)
29876da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R3_COLOR		(16 << 10)
29886da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R3_ALPHA		(17 << 10)
29896da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R4_COLOR		(18 << 10)
29906da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R4_ALPHA		(19 << 10)
29916da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R5_COLOR		(20 << 10)
29926da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_R5_ALPHA		(21 << 10)
29936da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_TFACTOR1_COLOR	(26 << 10)
29946da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_TFACTOR1_ALPHA	(27 << 10)
29956da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_MASK		(31 << 10)
29966da3f7d4SAlexander von Gluck IV #       define R200_TXC_ARG_C_SHIFT		10
29976da3f7d4SAlexander von Gluck IV #       define R200_TXC_COMP_ARG_A		(1 << 16)
29986da3f7d4SAlexander von Gluck IV #       define R200_TXC_COMP_ARG_A_SHIFT	(16)
29996da3f7d4SAlexander von Gluck IV #       define R200_TXC_BIAS_ARG_A		(1 << 17)
30006da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_ARG_A		(1 << 18)
30016da3f7d4SAlexander von Gluck IV #       define R200_TXC_NEG_ARG_A		(1 << 19)
30026da3f7d4SAlexander von Gluck IV #       define R200_TXC_COMP_ARG_B		(1 << 20)
30036da3f7d4SAlexander von Gluck IV #       define R200_TXC_COMP_ARG_B_SHIFT	(20)
30046da3f7d4SAlexander von Gluck IV #       define R200_TXC_BIAS_ARG_B		(1 << 21)
30056da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_ARG_B		(1 << 22)
30066da3f7d4SAlexander von Gluck IV #       define R200_TXC_NEG_ARG_B		(1 << 23)
30076da3f7d4SAlexander von Gluck IV #       define R200_TXC_COMP_ARG_C		(1 << 24)
30086da3f7d4SAlexander von Gluck IV #       define R200_TXC_COMP_ARG_C_SHIFT	(24)
30096da3f7d4SAlexander von Gluck IV #       define R200_TXC_BIAS_ARG_C		(1 << 25)
30106da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_ARG_C		(1 << 26)
30116da3f7d4SAlexander von Gluck IV #       define R200_TXC_NEG_ARG_C		(1 << 27)
30126da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_MADD			(0 << 28)
30136da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_CND0			(2 << 28)
30146da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_LERP			(3 << 28)
30156da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_DOT3			(4 << 28)
30166da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_DOT4			(5 << 28)
30176da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_CONDITIONAL		(6 << 28)
30186da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_DOT2_ADD		(7 << 28)
30196da3f7d4SAlexander von Gluck IV #       define R200_TXC_OP_MASK			(7 << 28)
30206da3f7d4SAlexander von Gluck IV #define R200_PP_TXCBLEND2_0		0x2f04
30216da3f7d4SAlexander von Gluck IV #       define R200_TXC_TFACTOR_SEL_SHIFT	0
30226da3f7d4SAlexander von Gluck IV #       define R200_TXC_TFACTOR_SEL_MASK	0x7
30236da3f7d4SAlexander von Gluck IV #       define R200_TXC_TFACTOR1_SEL_SHIFT	4
30246da3f7d4SAlexander von Gluck IV #       define R200_TXC_TFACTOR1_SEL_MASK	(0x7 << 4)
30256da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_SHIFT		8
30266da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_MASK		(7 << 8)
30276da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_1X		(0 << 8)
30286da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_2X		(1 << 8)
30296da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_4X		(2 << 8)
30306da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_8X		(3 << 8)
30316da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_INV2		(5 << 8)
30326da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_INV4		(6 << 8)
30336da3f7d4SAlexander von Gluck IV #       define R200_TXC_SCALE_INV8		(7 << 8)
30346da3f7d4SAlexander von Gluck IV #       define R200_TXC_CLAMP_SHIFT		12
30356da3f7d4SAlexander von Gluck IV #       define R200_TXC_CLAMP_MASK		(3 << 12)
30366da3f7d4SAlexander von Gluck IV #       define R200_TXC_CLAMP_WRAP		(0 << 12)
30376da3f7d4SAlexander von Gluck IV #       define R200_TXC_CLAMP_0_1		(1 << 12)
30386da3f7d4SAlexander von Gluck IV #       define R200_TXC_CLAMP_8_8		(2 << 12)
30396da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_MASK		(7 << 16)
30406da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_NONE		(0 << 16)
30416da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_R0		(1 << 16)
30426da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_R1		(2 << 16)
30436da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_R2		(3 << 16)
30446da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_R3		(4 << 16)
30456da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_R4		(5 << 16)
30466da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_REG_R5		(6 << 16)
30476da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_MASK	(7 << 20)
30486da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_RGB		(0 << 20)
30496da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_RG		(1 << 20)
30506da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_RB		(2 << 20)
30516da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_R		(3 << 20)
30526da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_GB		(4 << 20)
30536da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_G		(5 << 20)
30546da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_B		(6 << 20)
30556da3f7d4SAlexander von Gluck IV #       define R200_TXC_OUTPUT_MASK_NONE	(7 << 20)
30566da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_NORMAL		0
30576da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_RED		1
30586da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_GREEN		2
30596da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_BLUE		3
30606da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_ARG_A_SHIFT	26
30616da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_ARG_A_MASK		(3 << 26)
30626da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_ARG_B_SHIFT	28
30636da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_ARG_B_MASK		(3 << 28)
30646da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_ARG_C_SHIFT	30
30656da3f7d4SAlexander von Gluck IV #       define R200_TXC_REPL_ARG_C_MASK		(3 << 30)
30666da3f7d4SAlexander von Gluck IV #define R200_PP_TXABLEND_0			0x2f08
30676da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_ZERO		(0)
30686da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_CURRENT_ALPHA	(2) /* guess */
30696da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_CURRENT_BLUE	(3) /* guess */
30706da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_DIFFUSE_ALPHA	(4)
30716da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_DIFFUSE_BLUE	(5)
30726da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_SPECULAR_ALPHA	(6)
30736da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_SPECULAR_BLUE	(7)
30746da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_TFACTOR_ALPHA	(8)
30756da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_TFACTOR_BLUE	(9)
30766da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R0_ALPHA		(10)
30776da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R0_BLUE		(11)
30786da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R1_ALPHA		(12)
30796da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R1_BLUE		(13)
30806da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R2_ALPHA		(14)
30816da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R2_BLUE		(15)
30826da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R3_ALPHA		(16)
30836da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R3_BLUE		(17)
30846da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R4_ALPHA		(18)
30856da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R4_BLUE		(19)
30866da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R5_ALPHA		(20)
30876da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_R5_BLUE		(21)
30886da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_TFACTOR1_ALPHA	(26)
30896da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_TFACTOR1_BLUE	(27)
30906da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_MASK		(31 << 0)
30916da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_A_SHIFT		0
30926da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_ZERO		(0 << 5)
30936da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_CURRENT_ALPHA	(2 << 5) /* guess */
30946da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_CURRENT_BLUE	(3 << 5) /* guess */
30956da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_DIFFUSE_ALPHA	(4 << 5)
30966da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_DIFFUSE_BLUE	(5 << 5)
30976da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_SPECULAR_ALPHA	(6 << 5)
30986da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_SPECULAR_BLUE	(7 << 5)
30996da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_TFACTOR_ALPHA	(8 << 5)
31006da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_TFACTOR_BLUE	(9 << 5)
31016da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R0_ALPHA		(10 << 5)
31026da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R0_BLUE		(11 << 5)
31036da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R1_ALPHA		(12 << 5)
31046da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R1_BLUE		(13 << 5)
31056da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R2_ALPHA		(14 << 5)
31066da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R2_BLUE		(15 << 5)
31076da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R3_ALPHA		(16 << 5)
31086da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R3_BLUE		(17 << 5)
31096da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R4_ALPHA		(18 << 5)
31106da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R4_BLUE		(19 << 5)
31116da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R5_ALPHA		(20 << 5)
31126da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_R5_BLUE		(21 << 5)
31136da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_TFACTOR1_ALPHA	(26 << 5)
31146da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_TFACTOR1_BLUE	(27 << 5)
31156da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_MASK		(31 << 5)
31166da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_B_SHIFT			5
31176da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_ZERO		(0 << 10)
31186da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_CURRENT_ALPHA	(2 << 10) /* guess */
31196da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_CURRENT_BLUE	(3 << 10) /* guess */
31206da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_DIFFUSE_ALPHA	(4 << 10)
31216da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_DIFFUSE_BLUE	(5 << 10)
31226da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_SPECULAR_ALPHA	(6 << 10)
31236da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_SPECULAR_BLUE	(7 << 10)
31246da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_TFACTOR_ALPHA	(8 << 10)
31256da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_TFACTOR_BLUE	(9 << 10)
31266da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R0_ALPHA		(10 << 10)
31276da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R0_BLUE		(11 << 10)
31286da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R1_ALPHA		(12 << 10)
31296da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R1_BLUE		(13 << 10)
31306da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R2_ALPHA		(14 << 10)
31316da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R2_BLUE		(15 << 10)
31326da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R3_ALPHA		(16 << 10)
31336da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R3_BLUE		(17 << 10)
31346da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R4_ALPHA		(18 << 10)
31356da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R4_BLUE		(19 << 10)
31366da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R5_ALPHA		(20 << 10)
31376da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_R5_BLUE		(21 << 10)
31386da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_TFACTOR1_ALPHA	(26 << 10)
31396da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_TFACTOR1_BLUE	(27 << 10)
31406da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_MASK		(31 << 10)
31416da3f7d4SAlexander von Gluck IV #       define R200_TXA_ARG_C_SHIFT		10
31426da3f7d4SAlexander von Gluck IV #       define R200_TXA_COMP_ARG_A		(1 << 16)
31436da3f7d4SAlexander von Gluck IV #       define R200_TXA_COMP_ARG_A_SHIFT	(16)
31446da3f7d4SAlexander von Gluck IV #       define R200_TXA_BIAS_ARG_A		(1 << 17)
31456da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_ARG_A		(1 << 18)
31466da3f7d4SAlexander von Gluck IV #       define R200_TXA_NEG_ARG_A		(1 << 19)
31476da3f7d4SAlexander von Gluck IV #       define R200_TXA_COMP_ARG_B		(1 << 20)
31486da3f7d4SAlexander von Gluck IV #       define R200_TXA_COMP_ARG_B_SHIFT	(20)
31496da3f7d4SAlexander von Gluck IV #       define R200_TXA_BIAS_ARG_B		(1 << 21)
31506da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_ARG_B		(1 << 22)
31516da3f7d4SAlexander von Gluck IV #       define R200_TXA_NEG_ARG_B		(1 << 23)
31526da3f7d4SAlexander von Gluck IV #       define R200_TXA_COMP_ARG_C		(1 << 24)
31536da3f7d4SAlexander von Gluck IV #       define R200_TXA_COMP_ARG_C_SHIFT	(24)
31546da3f7d4SAlexander von Gluck IV #       define R200_TXA_BIAS_ARG_C		(1 << 25)
31556da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_ARG_C		(1 << 26)
31566da3f7d4SAlexander von Gluck IV #       define R200_TXA_NEG_ARG_C		(1 << 27)
31576da3f7d4SAlexander von Gluck IV #       define R200_TXA_OP_MADD			(0 << 28)
31586da3f7d4SAlexander von Gluck IV #       define R200_TXA_OP_CND0			(2 << 28)
31596da3f7d4SAlexander von Gluck IV #       define R200_TXA_OP_LERP			(3 << 28)
31606da3f7d4SAlexander von Gluck IV #       define R200_TXA_OP_CONDITIONAL		(6 << 28)
31616da3f7d4SAlexander von Gluck IV #       define R200_TXA_OP_MASK			(7 << 28)
31626da3f7d4SAlexander von Gluck IV #define R200_PP_TXABLEND2_0			0x2f0c
31636da3f7d4SAlexander von Gluck IV #       define R200_TXA_TFACTOR_SEL_SHIFT	0
31646da3f7d4SAlexander von Gluck IV #       define R200_TXA_TFACTOR_SEL_MASK	0x7
31656da3f7d4SAlexander von Gluck IV #       define R200_TXA_TFACTOR1_SEL_SHIFT	4
31666da3f7d4SAlexander von Gluck IV #       define R200_TXA_TFACTOR1_SEL_MASK	(0x7 << 4)
31676da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_SHIFT		8
31686da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_MASK		(7 << 8)
31696da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_1X		(0 << 8)
31706da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_2X		(1 << 8)
31716da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_4X		(2 << 8)
31726da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_8X		(3 << 8)
31736da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_INV2		(5 << 8)
31746da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_INV4		(6 << 8)
31756da3f7d4SAlexander von Gluck IV #       define R200_TXA_SCALE_INV8		(7 << 8)
31766da3f7d4SAlexander von Gluck IV #       define R200_TXA_CLAMP_SHIFT		12
31776da3f7d4SAlexander von Gluck IV #       define R200_TXA_CLAMP_MASK		(3 << 12)
31786da3f7d4SAlexander von Gluck IV #       define R200_TXA_CLAMP_WRAP		(0 << 12)
31796da3f7d4SAlexander von Gluck IV #       define R200_TXA_CLAMP_0_1		(1 << 12)
31806da3f7d4SAlexander von Gluck IV #       define R200_TXA_CLAMP_8_8		(2 << 12)
31816da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_MASK		(7 << 16)
31826da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_NONE		(0 << 16)
31836da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_R0		(1 << 16)
31846da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_R1		(2 << 16)
31856da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_R2		(3 << 16)
31866da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_R3		(4 << 16)
31876da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_R4		(5 << 16)
31886da3f7d4SAlexander von Gluck IV #       define R200_TXA_OUTPUT_REG_R5		(6 << 16)
31896da3f7d4SAlexander von Gluck IV #       define R200_TXA_DOT_ALPHA		(1 << 20)
31906da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_NORMAL		0
31916da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_RED		1
31926da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_GREEN		2
31936da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_ARG_A_SHIFT	26
31946da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_ARG_A_MASK		(3 << 26)
31956da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_ARG_B_SHIFT	28
31966da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_ARG_B_MASK		(3 << 28)
31976da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_ARG_C_SHIFT	30
31986da3f7d4SAlexander von Gluck IV #       define R200_TXA_REPL_ARG_C_MASK		(3 << 30)
31996da3f7d4SAlexander von Gluck IV 
32006da3f7d4SAlexander von Gluck IV #define R200_SE_VTX_FMT_0			0x2088
32016da3f7d4SAlexander von Gluck IV #       define R200_VTX_XY			0 /* always have xy */
32026da3f7d4SAlexander von Gluck IV #       define R200_VTX_Z0			(1<<0)
32036da3f7d4SAlexander von Gluck IV #       define R200_VTX_W0			(1<<1)
32046da3f7d4SAlexander von Gluck IV #       define R200_VTX_WEIGHT_COUNT_SHIFT	(2)
32056da3f7d4SAlexander von Gluck IV #       define R200_VTX_PV_MATRIX_SEL		(1<<5)
32066da3f7d4SAlexander von Gluck IV #       define R200_VTX_N0			(1<<6)
32076da3f7d4SAlexander von Gluck IV #       define R200_VTX_POINT_SIZE		(1<<7)
32086da3f7d4SAlexander von Gluck IV #       define R200_VTX_DISCRETE_FOG		(1<<8)
32096da3f7d4SAlexander von Gluck IV #       define R200_VTX_SHININESS_0		(1<<9)
32106da3f7d4SAlexander von Gluck IV #       define R200_VTX_SHININESS_1		(1<<10)
32116da3f7d4SAlexander von Gluck IV #       define   R200_VTX_COLOR_NOT_PRESENT	0
32126da3f7d4SAlexander von Gluck IV #       define   R200_VTX_PK_RGBA		1
32136da3f7d4SAlexander von Gluck IV #       define   R200_VTX_FP_RGB		2
32146da3f7d4SAlexander von Gluck IV #       define   R200_VTX_FP_RGBA		3
32156da3f7d4SAlexander von Gluck IV #       define   R200_VTX_COLOR_MASK		3
32166da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_0_SHIFT		11
32176da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_1_SHIFT		13
32186da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_2_SHIFT		15
32196da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_3_SHIFT		17
32206da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_4_SHIFT		19
32216da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_5_SHIFT		21
32226da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_6_SHIFT		23
32236da3f7d4SAlexander von Gluck IV #       define R200_VTX_COLOR_7_SHIFT		25
32246da3f7d4SAlexander von Gluck IV #       define R200_VTX_XY1			(1<<28)
32256da3f7d4SAlexander von Gluck IV #       define R200_VTX_Z1			(1<<29)
32266da3f7d4SAlexander von Gluck IV #       define R200_VTX_W1			(1<<30)
32276da3f7d4SAlexander von Gluck IV #       define R200_VTX_N1			(1<<31)
32286da3f7d4SAlexander von Gluck IV #define R200_SE_VTX_FMT_1			0x208c
32296da3f7d4SAlexander von Gluck IV #       define R200_VTX_TEX0_COMP_CNT_SHIFT	0
32306da3f7d4SAlexander von Gluck IV #       define R200_VTX_TEX1_COMP_CNT_SHIFT	3
32316da3f7d4SAlexander von Gluck IV #       define R200_VTX_TEX2_COMP_CNT_SHIFT	6
32326da3f7d4SAlexander von Gluck IV #       define R200_VTX_TEX3_COMP_CNT_SHIFT	9
32336da3f7d4SAlexander von Gluck IV #       define R200_VTX_TEX4_COMP_CNT_SHIFT	12
32346da3f7d4SAlexander von Gluck IV #       define R200_VTX_TEX5_COMP_CNT_SHIFT	15
32356da3f7d4SAlexander von Gluck IV 
32366da3f7d4SAlexander von Gluck IV #define R200_SE_TCL_OUTPUT_VTX_FMT_0		0x2090
32376da3f7d4SAlexander von Gluck IV #define R200_SE_TCL_OUTPUT_VTX_FMT_1		0x2094
32386da3f7d4SAlexander von Gluck IV #define R200_SE_TCL_OUTPUT_VTX_COMP_SEL		0x2250
32396da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_XYZW			(1<<0)
32406da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_COLOR_0		(1<<8)
32416da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_COLOR_1		(1<<9)
32426da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_0		(1<<16)
32436da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_1		(1<<17)
32446da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_2		(1<<18)
32456da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_3		(1<<19)
32466da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_4		(1<<20)
32476da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_5		(1<<21)
32486da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_TEX_MASK		(0x3f<<16)
32496da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_DISCRETE_FOG		(1<<24)
32506da3f7d4SAlexander von Gluck IV #       define R200_OUTPUT_PT_SIZE		(1<<25)
32516da3f7d4SAlexander von Gluck IV #       define R200_FORCE_INORDER_PROC		(1<<31)
32526da3f7d4SAlexander von Gluck IV #define R200_PP_CNTL_X				0x2cc4
32536da3f7d4SAlexander von Gluck IV #define R200_PP_TXMULTI_CTL_0			0x2c1c
32546da3f7d4SAlexander von Gluck IV #define R200_PP_TXMULTI_CTL_1			0x2c3c
32556da3f7d4SAlexander von Gluck IV #define R200_PP_TXMULTI_CTL_2			0x2c5c
32566da3f7d4SAlexander von Gluck IV #define R200_PP_TXMULTI_CTL_3			0x2c7c
32576da3f7d4SAlexander von Gluck IV #define R200_PP_TXMULTI_CTL_4			0x2c9c
32586da3f7d4SAlexander von Gluck IV #define R200_PP_TXMULTI_CTL_5			0x2cbc
32596da3f7d4SAlexander von Gluck IV #define R200_SE_VTX_STATE_CNTL			0x2180
32606da3f7d4SAlexander von Gluck IV #       define R200_UPDATE_USER_COLOR_0_ENA_MASK (1<<16)
32616da3f7d4SAlexander von Gluck IV 
32626da3f7d4SAlexander von Gluck IV 				/* Registers for CP and Microcode Engine */
32636da3f7d4SAlexander von Gluck IV #define RADEON_CP_ME_RAM_ADDR               0x07d4
32646da3f7d4SAlexander von Gluck IV #define RADEON_CP_ME_RAM_RADDR              0x07d8
32656da3f7d4SAlexander von Gluck IV #define RADEON_CP_ME_RAM_DATAH              0x07dc
32666da3f7d4SAlexander von Gluck IV #define RADEON_CP_ME_RAM_DATAL              0x07e0
32676da3f7d4SAlexander von Gluck IV 
32686da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_BASE                   0x0700
32696da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_CNTL                   0x0704
32706da3f7d4SAlexander von Gluck IV #	define RADEON_RB_BUFSZ_SHIFT		0
32716da3f7d4SAlexander von Gluck IV #	define RADEON_RB_BUFSZ_MASK		(0x3f << 0)
32726da3f7d4SAlexander von Gluck IV #	define RADEON_RB_BLKSZ_SHIFT		8
32736da3f7d4SAlexander von Gluck IV #	define RADEON_RB_BLKSZ_MASK		(0x3f << 8)
32746da3f7d4SAlexander von Gluck IV #	define RADEON_BUF_SWAP_32BIT		(2 << 16)
32756da3f7d4SAlexander von Gluck IV #	define RADEON_MAX_FETCH_SHIFT		18
32766da3f7d4SAlexander von Gluck IV #	define RADEON_MAX_FETCH_MASK		(0x3 << 18)
32776da3f7d4SAlexander von Gluck IV #	define RADEON_RB_NO_UPDATE		(1 << 27)
32786da3f7d4SAlexander von Gluck IV #	define RADEON_RB_RPTR_WR_ENA		(1 << 31)
32796da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_RPTR_ADDR              0x070c
32806da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_RPTR                   0x0710
32816da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_WPTR                   0x0714
32826da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_RPTR_WR                0x071c
32836da3f7d4SAlexander von Gluck IV 
32846da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_UMSK		    0x0770
32856da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_ADDR		    0x0774
32866da3f7d4SAlexander von Gluck IV 
32876da3f7d4SAlexander von Gluck IV #define R600_CP_RB_BASE                     0xc100
32886da3f7d4SAlexander von Gluck IV #define R600_CP_RB_CNTL                     0xc104
32896da3f7d4SAlexander von Gluck IV #       define R600_RB_BUFSZ(x)             ((x) << 0)
32906da3f7d4SAlexander von Gluck IV #       define R600_RB_BLKSZ(x)             ((x) << 8)
32916da3f7d4SAlexander von Gluck IV #       define R600_RB_NO_UPDATE            (1 << 27)
32926da3f7d4SAlexander von Gluck IV #       define R600_RB_RPTR_WR_ENA          (1 << 31)
32936da3f7d4SAlexander von Gluck IV #define R600_CP_RB_RPTR_WR                  0xc108
32946da3f7d4SAlexander von Gluck IV #define R600_CP_RB_RPTR_ADDR                0xc10c
32956da3f7d4SAlexander von Gluck IV #define R600_CP_RB_RPTR_ADDR_HI             0xc110
32966da3f7d4SAlexander von Gluck IV #define R600_CP_RB_WPTR                     0xc114
32976da3f7d4SAlexander von Gluck IV #define R600_CP_RB_WPTR_ADDR                0xc118
32986da3f7d4SAlexander von Gluck IV #define R600_CP_RB_WPTR_ADDR_HI             0xc11c
32996da3f7d4SAlexander von Gluck IV #define R600_CP_RB_RPTR                     0x8700
33006da3f7d4SAlexander von Gluck IV #define R600_CP_RB_WPTR_DELAY               0x8704
33016da3f7d4SAlexander von Gluck IV 
33026da3f7d4SAlexander von Gluck IV #define RADEON_CP_IB_BASE                   0x0738
33036da3f7d4SAlexander von Gluck IV #define RADEON_CP_IB_BUFSZ                  0x073c
33046da3f7d4SAlexander von Gluck IV 
33056da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_CNTL                  0x0740
33066da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_CNT_PRIMARY_MASK     (0xff << 0)
33076da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_PRIDIS_INDDIS        (0    << 28)
33086da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_PRIPIO_INDDIS        (1    << 28)
33096da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_PRIBM_INDDIS         (2    << 28)
33106da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_PRIPIO_INDBM         (3    << 28)
33116da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_PRIBM_INDBM          (4    << 28)
33126da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_PRIPIO_INDPIO        (15   << 28)
33136da3f7d4SAlexander von Gluck IV 
33146da3f7d4SAlexander von Gluck IV #define R300_CP_RESYNC_ADDR                 0x778
33156da3f7d4SAlexander von Gluck IV #define R300_CP_RESYNC_DATA                 0x77c
33166da3f7d4SAlexander von Gluck IV 
33176da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_STAT                  0x07f8
33186da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_RPTR_PRIMARY_MASK    (0xff <<  0)
33196da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_WPTR_PRIMARY_MASK    (0xff <<  8)
33206da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_RPTR_INDIRECT_MASK   (0xff << 16)
33216da3f7d4SAlexander von Gluck IV #       define RADEON_CSQ_WPTR_INDIRECT_MASK   (0xff << 24)
33226da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ2_STAT                  0x07fc
33236da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_ADDR                  0x07f0
33246da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_DATA                  0x07f4
33256da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_APER_PRIMARY          0x1000
33266da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_APER_INDIRECT         0x1300
33276da3f7d4SAlexander von Gluck IV 
33286da3f7d4SAlexander von Gluck IV #define RADEON_CP_RB_WPTR_DELAY             0x0718
33296da3f7d4SAlexander von Gluck IV #       define RADEON_PRE_WRITE_TIMER_SHIFT    0
33306da3f7d4SAlexander von Gluck IV #       define RADEON_PRE_WRITE_LIMIT_SHIFT    23
33316da3f7d4SAlexander von Gluck IV #define RADEON_CP_CSQ_MODE		0x0744
33326da3f7d4SAlexander von Gluck IV #	define RADEON_INDIRECT2_START_SHIFT	0
33336da3f7d4SAlexander von Gluck IV #	define RADEON_INDIRECT2_START_MASK	(0x7f << 0)
33346da3f7d4SAlexander von Gluck IV #	define RADEON_INDIRECT1_START_SHIFT	8
33356da3f7d4SAlexander von Gluck IV #	define RADEON_INDIRECT1_START_MASK	(0x7f << 8)
33366da3f7d4SAlexander von Gluck IV 
33376da3f7d4SAlexander von Gluck IV #define RADEON_AIC_CNTL                     0x01d0
33386da3f7d4SAlexander von Gluck IV #       define RADEON_PCIGART_TRANSLATE_EN     (1 << 0)
33396da3f7d4SAlexander von Gluck IV #       define RADEON_DIS_OUT_OF_PCI_GART_ACCESS     (1 << 1)
33406da3f7d4SAlexander von Gluck IV #	define RS400_MSI_REARM	                (1 << 3) /* rs400/rs480 */
33416da3f7d4SAlexander von Gluck IV #define RADEON_AIC_LO_ADDR                  0x01dc
33426da3f7d4SAlexander von Gluck IV #define RADEON_AIC_PT_BASE		0x01d8
33436da3f7d4SAlexander von Gluck IV #define RADEON_AIC_HI_ADDR		0x01e0
33446da3f7d4SAlexander von Gluck IV 
33456da3f7d4SAlexander von Gluck IV 
33466da3f7d4SAlexander von Gluck IV 
33476da3f7d4SAlexander von Gluck IV 				/* Constants */
33486da3f7d4SAlexander von Gluck IV /* #define RADEON_LAST_FRAME_REG               RADEON_GUI_SCRATCH_REG0 */
33496da3f7d4SAlexander von Gluck IV /* efine RADEON_LAST_CLEAR_REG               RADEON_GUI_SCRATCH_REG2 */
33506da3f7d4SAlexander von Gluck IV 
33516da3f7d4SAlexander von Gluck IV 
33526da3f7d4SAlexander von Gluck IV 
33536da3f7d4SAlexander von Gluck IV 				/* CP packet types */
33546da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET0                           0x00000000
33556da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET1                           0x40000000
33566da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET2                           0x80000000
33576da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3                           0xC0000000
33586da3f7d4SAlexander von Gluck IV #       define RADEON_CP_PACKET_MASK                0xC0000000
33596da3f7d4SAlexander von Gluck IV #       define RADEON_CP_PACKET_COUNT_MASK          0x3fff0000
33606da3f7d4SAlexander von Gluck IV #       define RADEON_CP_PACKET_MAX_DWORDS          (1 << 12)
33616da3f7d4SAlexander von Gluck IV #       define RADEON_CP_PACKET0_REG_MASK           0x000007ff
33626da3f7d4SAlexander von Gluck IV #       define R300_CP_PACKET0_REG_MASK             0x00001fff
33636da3f7d4SAlexander von Gluck IV #       define R600_CP_PACKET0_REG_MASK             0x0000ffff
33646da3f7d4SAlexander von Gluck IV #       define RADEON_CP_PACKET1_REG0_MASK          0x000007ff
33656da3f7d4SAlexander von Gluck IV #       define RADEON_CP_PACKET1_REG1_MASK          0x003ff800
33666da3f7d4SAlexander von Gluck IV 
33676da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET0_ONE_REG_WR                0x00008000
33686da3f7d4SAlexander von Gluck IV 
33696da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_NOP                       0xC0001000
33706da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_NEXT_CHAR                 0xC0001900
33716da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_PLY_NEXTSCAN              0xC0001D00
33726da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_SET_SCISSORS              0xC0001E00
33736da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_3D_RNDR_GEN_INDX_PRIM     0xC0002300
33746da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_LOAD_MICROCODE            0xC0002400
33756da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_WAIT_FOR_IDLE             0xC0002600
33766da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_3D_DRAW_VBUF              0xC0002800
33776da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_3D_DRAW_IMMD              0xC0002900
33786da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_3D_DRAW_INDX              0xC0002A00
33796da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_LOAD_PALETTE              0xC0002C00
33806da3f7d4SAlexander von Gluck IV #define R200_CP_PACKET3_3D_DRAW_IMMD_2              0xc0003500
33816da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_3D_LOAD_VBPNTR            0xC0002F00
33826da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_PAINT                0xC0009100
33836da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_BITBLT               0xC0009200
33846da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_SMALLTEXT            0xC0009300
33856da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT         0xC0009400
33866da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_POLYLINE             0xC0009500
33876da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_POLYSCANLINES        0xC0009800
33886da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_PAINT_MULTI          0xC0009A00
33896da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_BITBLT_MULTI         0xC0009B00
33906da3f7d4SAlexander von Gluck IV #define RADEON_CP_PACKET3_CNTL_TRANS_BITBLT         0xC0009C00
33916da3f7d4SAlexander von Gluck IV 
33926da3f7d4SAlexander von Gluck IV 
33936da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_XY                        0x00000000
33946da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_W0                        0x00000001
33956da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_FPCOLOR                   0x00000002
33966da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_FPALPHA                   0x00000004
33976da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_PKCOLOR                   0x00000008
33986da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_FPSPEC                    0x00000010
33996da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_FPFOG                     0x00000020
34006da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_PKSPEC                    0x00000040
34016da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_ST0                       0x00000080
34026da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_ST1                       0x00000100
34036da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_Q1                        0x00000200
34046da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_ST2                       0x00000400
34056da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_Q2                        0x00000800
34066da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_ST3                       0x00001000
34076da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_Q3                        0x00002000
34086da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_Q0                        0x00004000
34096da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_BLND_WEIGHT_CNT_MASK      0x00038000
34106da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_N0                        0x00040000
34116da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_XY1                       0x08000000
34126da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_Z1                        0x10000000
34136da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_W1                        0x20000000
34146da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_N1                        0x40000000
34156da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_FRMT_Z                         0x80000000
34166da3f7d4SAlexander von Gluck IV 
34176da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_NONE            0x00000000
34186da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_POINT           0x00000001
34196da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE            0x00000002
34206da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_LINE_STRIP      0x00000003
34216da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_LIST        0x00000004
34226da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_FAN         0x00000005
34236da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_STRIP       0x00000006
34246da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_TRI_TYPE_2      0x00000007
34256da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_RECT_LIST       0x00000008
34266da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_POINT_LIST 0x00000009
34276da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_TYPE_3VRT_LINE_LIST  0x0000000a
34286da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_WALK_IND             0x00000010
34296da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_WALK_LIST            0x00000020
34306da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_PRIM_WALK_RING            0x00000030
34316da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_COLOR_ORDER_BGRA          0x00000000
34326da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_COLOR_ORDER_RGBA          0x00000040
34336da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_MAOS_ENABLE               0x00000080
34346da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_VTX_FMT_NON_RADEON_MODE   0x00000000
34356da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_VTX_FMT_RADEON_MODE       0x00000100
34366da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_TCL_DISABLE               0x00000000
34376da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_TCL_ENABLE                0x00000200
34386da3f7d4SAlexander von Gluck IV #define RADEON_CP_VC_CNTL_NUM_SHIFT                 16
34396da3f7d4SAlexander von Gluck IV 
34406da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_0_ADDR                   0
34416da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_1_ADDR                   4
34426da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_2_ADDR                   8
34436da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_3_ADDR                  12
34446da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_4_ADDR                  16
34456da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_5_ADDR                  20
34466da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_6_ADDR                  24
34476da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_7_ADDR                  28
34486da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_8_ADDR                  32
34496da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_9_ADDR                  36
34506da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_10_ADDR                 40
34516da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_11_ADDR                 44
34526da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_12_ADDR                 48
34536da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_13_ADDR                 52
34546da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_14_ADDR                 56
34556da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_15_ADDR                 60
34566da3f7d4SAlexander von Gluck IV #define RADEON_VS_LIGHT_AMBIENT_ADDR             64
34576da3f7d4SAlexander von Gluck IV #define RADEON_VS_LIGHT_DIFFUSE_ADDR             72
34586da3f7d4SAlexander von Gluck IV #define RADEON_VS_LIGHT_SPECULAR_ADDR            80
34596da3f7d4SAlexander von Gluck IV #define RADEON_VS_LIGHT_DIRPOS_ADDR              88
34606da3f7d4SAlexander von Gluck IV #define RADEON_VS_LIGHT_HWVSPOT_ADDR             96
34616da3f7d4SAlexander von Gluck IV #define RADEON_VS_LIGHT_ATTENUATION_ADDR        104
34626da3f7d4SAlexander von Gluck IV #define RADEON_VS_MATRIX_EYE2CLIP_ADDR          112
34636da3f7d4SAlexander von Gluck IV #define RADEON_VS_UCP_ADDR                      116
34646da3f7d4SAlexander von Gluck IV #define RADEON_VS_GLOBAL_AMBIENT_ADDR           122
34656da3f7d4SAlexander von Gluck IV #define RADEON_VS_FOG_PARAM_ADDR                123
34666da3f7d4SAlexander von Gluck IV #define RADEON_VS_EYE_VECTOR_ADDR               124
34676da3f7d4SAlexander von Gluck IV 
34686da3f7d4SAlexander von Gluck IV #define RADEON_SS_LIGHT_DCD_ADDR                  0
34696da3f7d4SAlexander von Gluck IV #define RADEON_SS_LIGHT_SPOT_EXPONENT_ADDR        8
34706da3f7d4SAlexander von Gluck IV #define RADEON_SS_LIGHT_SPOT_CUTOFF_ADDR         16
34716da3f7d4SAlexander von Gluck IV #define RADEON_SS_LIGHT_SPECULAR_THRESH_ADDR     24
34726da3f7d4SAlexander von Gluck IV #define RADEON_SS_LIGHT_RANGE_CUTOFF_ADDR        32
34736da3f7d4SAlexander von Gluck IV #define RADEON_SS_VERT_GUARD_CLIP_ADJ_ADDR       48
34746da3f7d4SAlexander von Gluck IV #define RADEON_SS_VERT_GUARD_DISCARD_ADJ_ADDR    49
34756da3f7d4SAlexander von Gluck IV #define RADEON_SS_HORZ_GUARD_CLIP_ADJ_ADDR       50
34766da3f7d4SAlexander von Gluck IV #define RADEON_SS_HORZ_GUARD_DISCARD_ADJ_ADDR    51
34776da3f7d4SAlexander von Gluck IV #define RADEON_SS_SHININESS                      60
34786da3f7d4SAlexander von Gluck IV 
34796da3f7d4SAlexander von Gluck IV #define RADEON_TV_MASTER_CNTL                    0x0800
34806da3f7d4SAlexander von Gluck IV #       define RADEON_TV_ASYNC_RST               (1 <<  0)
34816da3f7d4SAlexander von Gluck IV #       define RADEON_CRT_ASYNC_RST              (1 <<  1)
34826da3f7d4SAlexander von Gluck IV #       define RADEON_RESTART_PHASE_FIX          (1 <<  3)
34836da3f7d4SAlexander von Gluck IV #	define RADEON_TV_FIFO_ASYNC_RST		 (1 <<  4)
34846da3f7d4SAlexander von Gluck IV #	define RADEON_VIN_ASYNC_RST		 (1 <<  5)
34856da3f7d4SAlexander von Gluck IV #	define RADEON_AUD_ASYNC_RST		 (1 <<  6)
34866da3f7d4SAlexander von Gluck IV #	define RADEON_DVS_ASYNC_RST		 (1 <<  7)
34876da3f7d4SAlexander von Gluck IV #       define RADEON_CRT_FIFO_CE_EN             (1 <<  9)
34886da3f7d4SAlexander von Gluck IV #       define RADEON_TV_FIFO_CE_EN              (1 << 10)
34896da3f7d4SAlexander von Gluck IV #       define RADEON_RE_SYNC_NOW_SEL_MASK       (3 << 14)
34906da3f7d4SAlexander von Gluck IV #       define RADEON_TVCLK_ALWAYS_ONb           (1 << 30)
34916da3f7d4SAlexander von Gluck IV #	define RADEON_TV_ON			 (1 << 31)
34926da3f7d4SAlexander von Gluck IV #define RADEON_TV_PRE_DAC_MUX_CNTL               0x0888
34936da3f7d4SAlexander von Gluck IV #       define RADEON_Y_RED_EN                   (1 << 0)
34946da3f7d4SAlexander von Gluck IV #       define RADEON_C_GRN_EN                   (1 << 1)
34956da3f7d4SAlexander von Gluck IV #       define RADEON_CMP_BLU_EN                 (1 << 2)
34966da3f7d4SAlexander von Gluck IV #       define RADEON_DAC_DITHER_EN              (1 << 3)
34976da3f7d4SAlexander von Gluck IV #       define RADEON_RED_MX_FORCE_DAC_DATA      (6 << 4)
34986da3f7d4SAlexander von Gluck IV #       define RADEON_GRN_MX_FORCE_DAC_DATA      (6 << 8)
34996da3f7d4SAlexander von Gluck IV #       define RADEON_BLU_MX_FORCE_DAC_DATA      (6 << 12)
35006da3f7d4SAlexander von Gluck IV #       define RADEON_TV_FORCE_DAC_DATA_SHIFT    16
35016da3f7d4SAlexander von Gluck IV #define RADEON_TV_RGB_CNTL                           0x0804
35026da3f7d4SAlexander von Gluck IV #       define RADEON_SWITCH_TO_BLUE		  (1 <<  4)
35036da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_DITHER_EN		  (1 <<  5)
35046da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_SRC_SEL_MASK		  (3 <<  8)
35056da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_SRC_SEL_CRTC1		  (0 <<  8)
35066da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_SRC_SEL_RMX		  (1 <<  8)
35076da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_SRC_SEL_CRTC2		  (2 <<  8)
35086da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_CONVERT_BY_PASS	  (1 << 10)
35096da3f7d4SAlexander von Gluck IV #       define RADEON_UVRAM_READ_MARGIN_SHIFT	  16
35106da3f7d4SAlexander von Gluck IV #       define RADEON_FIFORAM_FFMACRO_READ_MARGIN_SHIFT	  20
35116da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_ATTEN_SEL(x)            ((x) << 24)
35126da3f7d4SAlexander von Gluck IV #       define RADEON_TVOUT_SCALE_EN              (1 << 26)
35136da3f7d4SAlexander von Gluck IV #       define RADEON_RGB_ATTEN_VAL(x)            ((x) << 28)
35146da3f7d4SAlexander von Gluck IV #define RADEON_TV_SYNC_CNTL                          0x0808
35156da3f7d4SAlexander von Gluck IV #       define RADEON_SYNC_OE                     (1 <<  0)
35166da3f7d4SAlexander von Gluck IV #       define RADEON_SYNC_OUT                    (1 <<  1)
35176da3f7d4SAlexander von Gluck IV #       define RADEON_SYNC_IN                     (1 <<  2)
35186da3f7d4SAlexander von Gluck IV #       define RADEON_SYNC_PUB                    (1 <<  3)
35196da3f7d4SAlexander von Gluck IV #       define RADEON_SYNC_PD                     (1 <<  4)
35206da3f7d4SAlexander von Gluck IV #       define RADEON_TV_SYNC_IO_DRIVE            (1 <<  5)
35216da3f7d4SAlexander von Gluck IV #define RADEON_TV_HTOTAL                             0x080c
35226da3f7d4SAlexander von Gluck IV #define RADEON_TV_HDISP                              0x0810
35236da3f7d4SAlexander von Gluck IV #define RADEON_TV_HSTART                             0x0818
35246da3f7d4SAlexander von Gluck IV #define RADEON_TV_HCOUNT                             0x081C
35256da3f7d4SAlexander von Gluck IV #define RADEON_TV_VTOTAL                             0x0820
35266da3f7d4SAlexander von Gluck IV #define RADEON_TV_VDISP                              0x0824
35276da3f7d4SAlexander von Gluck IV #define RADEON_TV_VCOUNT                             0x0828
35286da3f7d4SAlexander von Gluck IV #define RADEON_TV_FTOTAL                             0x082c
35296da3f7d4SAlexander von Gluck IV #define RADEON_TV_FCOUNT                             0x0830
35306da3f7d4SAlexander von Gluck IV #define RADEON_TV_FRESTART                           0x0834
35316da3f7d4SAlexander von Gluck IV #define RADEON_TV_HRESTART                           0x0838
35326da3f7d4SAlexander von Gluck IV #define RADEON_TV_VRESTART                           0x083c
35336da3f7d4SAlexander von Gluck IV #define RADEON_TV_HOST_READ_DATA                     0x0840
35346da3f7d4SAlexander von Gluck IV #define RADEON_TV_HOST_WRITE_DATA                    0x0844
35356da3f7d4SAlexander von Gluck IV #define RADEON_TV_HOST_RD_WT_CNTL                    0x0848
35366da3f7d4SAlexander von Gluck IV #	define RADEON_HOST_FIFO_RD		 (1 << 12)
35376da3f7d4SAlexander von Gluck IV #	define RADEON_HOST_FIFO_RD_ACK		 (1 << 13)
35386da3f7d4SAlexander von Gluck IV #	define RADEON_HOST_FIFO_WT		 (1 << 14)
35396da3f7d4SAlexander von Gluck IV #	define RADEON_HOST_FIFO_WT_ACK		 (1 << 15)
35406da3f7d4SAlexander von Gluck IV #define RADEON_TV_VSCALER_CNTL1                      0x084c
35416da3f7d4SAlexander von Gluck IV #       define RADEON_UV_INC_MASK                0xffff
35426da3f7d4SAlexander von Gluck IV #       define RADEON_UV_INC_SHIFT               0
35436da3f7d4SAlexander von Gluck IV #       define RADEON_Y_W_EN			 (1 << 24)
35446da3f7d4SAlexander von Gluck IV #       define RADEON_RESTART_FIELD              (1 << 29) /* restart on field 0 */
35456da3f7d4SAlexander von Gluck IV #       define RADEON_Y_DEL_W_SIG_SHIFT          26
35466da3f7d4SAlexander von Gluck IV #define RADEON_TV_TIMING_CNTL                        0x0850
35476da3f7d4SAlexander von Gluck IV #       define RADEON_H_INC_MASK                 0xfff
35486da3f7d4SAlexander von Gluck IV #       define RADEON_H_INC_SHIFT                0
35496da3f7d4SAlexander von Gluck IV #       define RADEON_REQ_Y_FIRST                (1 << 19)
35506da3f7d4SAlexander von Gluck IV #       define RADEON_FORCE_BURST_ALWAYS         (1 << 21)
35516da3f7d4SAlexander von Gluck IV #       define RADEON_UV_POST_SCALE_BYPASS       (1 << 23)
35526da3f7d4SAlexander von Gluck IV #       define RADEON_UV_OUTPUT_POST_SCALE_SHIFT 24
35536da3f7d4SAlexander von Gluck IV #define RADEON_TV_VSCALER_CNTL2                      0x0854
35546da3f7d4SAlexander von Gluck IV #       define RADEON_DITHER_MODE                (1 <<  0)
35556da3f7d4SAlexander von Gluck IV #       define RADEON_Y_OUTPUT_DITHER_EN         (1 <<  1)
35566da3f7d4SAlexander von Gluck IV #       define RADEON_UV_OUTPUT_DITHER_EN        (1 <<  2)
35576da3f7d4SAlexander von Gluck IV #       define RADEON_UV_TO_BUF_DITHER_EN        (1 <<  3)
35586da3f7d4SAlexander von Gluck IV #define RADEON_TV_Y_FALL_CNTL                        0x0858
35596da3f7d4SAlexander von Gluck IV #       define RADEON_Y_FALL_PING_PONG           (1 << 16)
35606da3f7d4SAlexander von Gluck IV #       define RADEON_Y_COEF_EN                  (1 << 17)
35616da3f7d4SAlexander von Gluck IV #define RADEON_TV_Y_RISE_CNTL                        0x085c
35626da3f7d4SAlexander von Gluck IV #       define RADEON_Y_RISE_PING_PONG           (1 << 16)
35636da3f7d4SAlexander von Gluck IV #define RADEON_TV_Y_SAW_TOOTH_CNTL                   0x0860
35646da3f7d4SAlexander von Gluck IV #define RADEON_TV_UPSAMP_AND_GAIN_CNTL               0x0864
35656da3f7d4SAlexander von Gluck IV #	define RADEON_YUPSAMP_EN		 (1 <<  0)
35666da3f7d4SAlexander von Gluck IV #	define RADEON_UVUPSAMP_EN		 (1 <<  2)
35676da3f7d4SAlexander von Gluck IV #define RADEON_TV_GAIN_LIMIT_SETTINGS                0x0868
35686da3f7d4SAlexander von Gluck IV #       define RADEON_Y_GAIN_LIMIT_SHIFT         0
35696da3f7d4SAlexander von Gluck IV #       define RADEON_UV_GAIN_LIMIT_SHIFT        16
35706da3f7d4SAlexander von Gluck IV #define RADEON_TV_LINEAR_GAIN_SETTINGS               0x086c
35716da3f7d4SAlexander von Gluck IV #       define RADEON_Y_GAIN_SHIFT               0
35726da3f7d4SAlexander von Gluck IV #       define RADEON_UV_GAIN_SHIFT              16
35736da3f7d4SAlexander von Gluck IV #define RADEON_TV_MODULATOR_CNTL1                    0x0870
35746da3f7d4SAlexander von Gluck IV #	define RADEON_YFLT_EN			 (1 <<  2)
35756da3f7d4SAlexander von Gluck IV #	define RADEON_UVFLT_EN			 (1 <<  3)
35766da3f7d4SAlexander von Gluck IV #       define RADEON_ALT_PHASE_EN               (1 <<  6)
35776da3f7d4SAlexander von Gluck IV #       define RADEON_SYNC_TIP_LEVEL             (1 <<  7)
35786da3f7d4SAlexander von Gluck IV #       define RADEON_BLANK_LEVEL_SHIFT          8
35796da3f7d4SAlexander von Gluck IV #       define RADEON_SET_UP_LEVEL_SHIFT         16
35806da3f7d4SAlexander von Gluck IV #	define RADEON_SLEW_RATE_LIMIT		 (1 << 23)
35816da3f7d4SAlexander von Gluck IV #       define RADEON_CY_FILT_BLEND_SHIFT        28
35826da3f7d4SAlexander von Gluck IV #define RADEON_TV_MODULATOR_CNTL2                    0x0874
35836da3f7d4SAlexander von Gluck IV #       define RADEON_TV_U_BURST_LEVEL_MASK     0x1ff
35846da3f7d4SAlexander von Gluck IV #       define RADEON_TV_V_BURST_LEVEL_MASK     0x1ff
35856da3f7d4SAlexander von Gluck IV #       define RADEON_TV_V_BURST_LEVEL_SHIFT    16
35866da3f7d4SAlexander von Gluck IV #define RADEON_TV_CRC_CNTL                           0x0890
35876da3f7d4SAlexander von Gluck IV #define RADEON_TV_UV_ADR                             0x08ac
35886da3f7d4SAlexander von Gluck IV #	define RADEON_MAX_UV_ADR_MASK		 0x000000ff
35896da3f7d4SAlexander von Gluck IV #	define RADEON_MAX_UV_ADR_SHIFT		 0
35906da3f7d4SAlexander von Gluck IV #	define RADEON_TABLE1_BOT_ADR_MASK	 0x0000ff00
35916da3f7d4SAlexander von Gluck IV #	define RADEON_TABLE1_BOT_ADR_SHIFT	 8
35926da3f7d4SAlexander von Gluck IV #	define RADEON_TABLE3_TOP_ADR_MASK	 0x00ff0000
35936da3f7d4SAlexander von Gluck IV #	define RADEON_TABLE3_TOP_ADR_SHIFT	 16
35946da3f7d4SAlexander von Gluck IV #	define RADEON_HCODE_TABLE_SEL_MASK	 0x06000000
35956da3f7d4SAlexander von Gluck IV #	define RADEON_HCODE_TABLE_SEL_SHIFT	 25
35966da3f7d4SAlexander von Gluck IV #	define RADEON_VCODE_TABLE_SEL_MASK	 0x18000000
35976da3f7d4SAlexander von Gluck IV #	define RADEON_VCODE_TABLE_SEL_SHIFT	 27
35986da3f7d4SAlexander von Gluck IV #	define RADEON_TV_MAX_FIFO_ADDR		 0x1a7
35996da3f7d4SAlexander von Gluck IV #	define RADEON_TV_MAX_FIFO_ADDR_INTERNAL	 0x1ff
36006da3f7d4SAlexander von Gluck IV #define RADEON_TV_PLL_FINE_CNTL			     0x0020	/* PLL */
36016da3f7d4SAlexander von Gluck IV #define RADEON_TV_PLL_CNTL                           0x0021	/* PLL */
36026da3f7d4SAlexander von Gluck IV #       define RADEON_TV_M0LO_MASK               0xff
36036da3f7d4SAlexander von Gluck IV #       define RADEON_TV_M0HI_MASK               0x7
36046da3f7d4SAlexander von Gluck IV #       define RADEON_TV_M0HI_SHIFT              18
36056da3f7d4SAlexander von Gluck IV #       define RADEON_TV_N0LO_MASK               0x1ff
36066da3f7d4SAlexander von Gluck IV #       define RADEON_TV_N0LO_SHIFT              8
36076da3f7d4SAlexander von Gluck IV #       define RADEON_TV_N0HI_MASK               0x3
36086da3f7d4SAlexander von Gluck IV #       define RADEON_TV_N0HI_SHIFT              21
36096da3f7d4SAlexander von Gluck IV #       define RADEON_TV_P_MASK                  0xf
36106da3f7d4SAlexander von Gluck IV #       define RADEON_TV_P_SHIFT                 24
36116da3f7d4SAlexander von Gluck IV #       define RADEON_TV_SLIP_EN                 (1 << 23)
36126da3f7d4SAlexander von Gluck IV #       define RADEON_TV_DTO_EN                  (1 << 28)
36136da3f7d4SAlexander von Gluck IV #define RADEON_TV_PLL_CNTL1                          0x0022	/* PLL */
36146da3f7d4SAlexander von Gluck IV #       define RADEON_TVPLL_RESET                (1 <<  1)
36156da3f7d4SAlexander von Gluck IV #       define RADEON_TVPLL_SLEEP                (1 <<  3)
36166da3f7d4SAlexander von Gluck IV #       define RADEON_TVPLL_REFCLK_SEL           (1 <<  4)
36176da3f7d4SAlexander von Gluck IV #       define RADEON_TVPCP_SHIFT                8
36186da3f7d4SAlexander von Gluck IV #       define RADEON_TVPCP_MASK                 (7 << 8)
36196da3f7d4SAlexander von Gluck IV #       define RADEON_TVPVG_SHIFT                11
36206da3f7d4SAlexander von Gluck IV #       define RADEON_TVPVG_MASK                 (7 << 11)
36216da3f7d4SAlexander von Gluck IV #       define RADEON_TVPDC_SHIFT                14
36226da3f7d4SAlexander von Gluck IV #       define RADEON_TVPDC_MASK                 (3 << 14)
36236da3f7d4SAlexander von Gluck IV #       define RADEON_TVPLL_TEST_DIS             (1 << 31)
36246da3f7d4SAlexander von Gluck IV #       define RADEON_TVCLK_SRC_SEL_TVPLL        (1 << 30)
36256da3f7d4SAlexander von Gluck IV 
36266da3f7d4SAlexander von Gluck IV #define RS400_DISP2_REQ_CNTL1			0xe30
36276da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_START_REQ_LEVEL_SHIFT   0
36286da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_START_REQ_LEVEL_MASK    0x3ff
36296da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_STOP_REQ_LEVEL_SHIFT    12
36306da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_STOP_REQ_LEVEL_MASK     0x3ff
36316da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_ALLOW_FID_LEVEL_SHIFT   22
36326da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_ALLOW_FID_LEVEL_MASK    0x3ff
36336da3f7d4SAlexander von Gluck IV #define RS400_DISP2_REQ_CNTL2			0xe34
36346da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_CRITICAL_POINT_START_SHIFT    12
36356da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_CRITICAL_POINT_START_MASK     0x3ff
36366da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_CRITICAL_POINT_STOP_SHIFT     22
36376da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_CRITICAL_POINT_STOP_MASK      0x3ff
36386da3f7d4SAlexander von Gluck IV #define RS400_DMIF_MEM_CNTL1			0xe38
36396da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_START_ADR_SHIFT      0
36406da3f7d4SAlexander von Gluck IV #       define RS400_DISP2_START_ADR_MASK       0x3ff
36416da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_CRITICAL_POINT_START_SHIFT    12
36426da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_CRITICAL_POINT_START_MASK     0x3ff
36436da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_CRITICAL_POINT_STOP_SHIFT     22
36446da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_CRITICAL_POINT_STOP_MASK      0x3ff
36456da3f7d4SAlexander von Gluck IV #define RS400_DISP1_REQ_CNTL1			0xe3c
36466da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_START_REQ_LEVEL_SHIFT   0
36476da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_START_REQ_LEVEL_MASK    0x3ff
36486da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_STOP_REQ_LEVEL_SHIFT    12
36496da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_STOP_REQ_LEVEL_MASK     0x3ff
36506da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_ALLOW_FID_LEVEL_SHIFT   22
36516da3f7d4SAlexander von Gluck IV #       define RS400_DISP1_ALLOW_FID_LEVEL_MASK    0x3ff
36526da3f7d4SAlexander von Gluck IV 
36536da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_INDEX               0x0030
36546da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_DATA                0x0034
36556da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_CNTL	0x10
36566da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_EN		(1 << 0)
36576da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0 << 1)
36586da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO  (1 << 1)
36596da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD   (3 << 1)
36606da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_MODE_32_128_CACHE	(0 << 3)
36616da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE	(1 << 3)
36626da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN      (1 << 5)
36636da3f7d4SAlexander von Gluck IV #	define RADEON_PCIE_TX_GART_INVALIDATE_TLB	(1 << 8)
36646da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_DISCARD_RD_ADDR_LO 0x11
36656da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_DISCARD_RD_ADDR_HI 0x12
36666da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_BASE	0x13
36676da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_START_LO	0x14
36686da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_START_HI	0x15
36696da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_END_LO	0x16
36706da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_END_HI	0x17
36716da3f7d4SAlexander von Gluck IV #define RADEON_PCIE_TX_GART_ERROR	0x18
36726da3f7d4SAlexander von Gluck IV 
36736da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_REG0		0x15e0
36746da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_REG1		0x15e4
36756da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_REG2		0x15e8
36766da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_REG3		0x15ec
36776da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_REG4		0x15f0
36786da3f7d4SAlexander von Gluck IV #define RADEON_SCRATCH_REG5		0x15f4
36796da3f7d4SAlexander von Gluck IV 
36806da3f7d4SAlexander von Gluck IV #define RV530_GB_PIPE_SELECT2           0x4124
36816da3f7d4SAlexander von Gluck IV 
36826da3f7d4SAlexander von Gluck IV #endif
3683