1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2414c4531SDave Airlie /* 3414c4531SDave Airlie * MGA Millennium (MGA2064W) functions 4414c4531SDave Airlie * MGA Mystique (MGA1064SG) functions 5414c4531SDave Airlie * 6414c4531SDave Airlie * Copyright 1996 The XFree86 Project, Inc. 7414c4531SDave Airlie * 8414c4531SDave Airlie * Authors 9414c4531SDave Airlie * Dirk Hohndel 10414c4531SDave Airlie * hohndel@XFree86.Org 11414c4531SDave Airlie * David Dawes 12414c4531SDave Airlie * dawes@XFree86.Org 13414c4531SDave Airlie * Contributors: 14414c4531SDave Airlie * Guy DESBIEF, Aix-en-provence, France 15414c4531SDave Airlie * g.desbief@aix.pacwan.net 16414c4531SDave Airlie * MGA1064SG Mystique register file 17414c4531SDave Airlie */ 18414c4531SDave Airlie 19414c4531SDave Airlie #ifndef _MGA_REG_H_ 20414c4531SDave Airlie #define _MGA_REG_H_ 21414c4531SDave Airlie 22db05f8d3SThomas Zimmermann #include <linux/bits.h> 23db05f8d3SThomas Zimmermann 24414c4531SDave Airlie #define MGAREG_DWGCTL 0x1c00 25414c4531SDave Airlie #define MGAREG_MACCESS 0x1c04 26414c4531SDave Airlie /* the following is a mystique only register */ 27414c4531SDave Airlie #define MGAREG_MCTLWTST 0x1c08 28414c4531SDave Airlie #define MGAREG_ZORG 0x1c0c 29414c4531SDave Airlie 30414c4531SDave Airlie #define MGAREG_PAT0 0x1c10 31414c4531SDave Airlie #define MGAREG_PAT1 0x1c14 32414c4531SDave Airlie #define MGAREG_PLNWT 0x1c1c 33414c4531SDave Airlie 34414c4531SDave Airlie #define MGAREG_BCOL 0x1c20 35414c4531SDave Airlie #define MGAREG_FCOL 0x1c24 36414c4531SDave Airlie 37414c4531SDave Airlie #define MGAREG_SRC0 0x1c30 38414c4531SDave Airlie #define MGAREG_SRC1 0x1c34 39414c4531SDave Airlie #define MGAREG_SRC2 0x1c38 40414c4531SDave Airlie #define MGAREG_SRC3 0x1c3c 41414c4531SDave Airlie 42414c4531SDave Airlie #define MGAREG_XYSTRT 0x1c40 43414c4531SDave Airlie #define MGAREG_XYEND 0x1c44 44414c4531SDave Airlie 45414c4531SDave Airlie #define MGAREG_SHIFT 0x1c50 46414c4531SDave Airlie /* the following is a mystique only register */ 47414c4531SDave Airlie #define MGAREG_DMAPAD 0x1c54 48414c4531SDave Airlie #define MGAREG_SGN 0x1c58 49414c4531SDave Airlie #define MGAREG_LEN 0x1c5c 50414c4531SDave Airlie 51414c4531SDave Airlie #define MGAREG_AR0 0x1c60 52414c4531SDave Airlie #define MGAREG_AR1 0x1c64 53414c4531SDave Airlie #define MGAREG_AR2 0x1c68 54414c4531SDave Airlie #define MGAREG_AR3 0x1c6c 55414c4531SDave Airlie #define MGAREG_AR4 0x1c70 56414c4531SDave Airlie #define MGAREG_AR5 0x1c74 57414c4531SDave Airlie #define MGAREG_AR6 0x1c78 58414c4531SDave Airlie 59414c4531SDave Airlie #define MGAREG_CXBNDRY 0x1c80 60414c4531SDave Airlie #define MGAREG_FXBNDRY 0x1c84 61414c4531SDave Airlie #define MGAREG_YDSTLEN 0x1c88 62414c4531SDave Airlie #define MGAREG_PITCH 0x1c8c 63414c4531SDave Airlie 64414c4531SDave Airlie #define MGAREG_YDST 0x1c90 65414c4531SDave Airlie #define MGAREG_YDSTORG 0x1c94 66414c4531SDave Airlie #define MGAREG_YTOP 0x1c98 67414c4531SDave Airlie #define MGAREG_YBOT 0x1c9c 68414c4531SDave Airlie 69414c4531SDave Airlie #define MGAREG_CXLEFT 0x1ca0 70414c4531SDave Airlie #define MGAREG_CXRIGHT 0x1ca4 71414c4531SDave Airlie #define MGAREG_FXLEFT 0x1ca8 72414c4531SDave Airlie #define MGAREG_FXRIGHT 0x1cac 73414c4531SDave Airlie 74414c4531SDave Airlie #define MGAREG_XDST 0x1cb0 75414c4531SDave Airlie 76414c4531SDave Airlie #define MGAREG_DR0 0x1cc0 77414c4531SDave Airlie #define MGAREG_DR1 0x1cc4 78414c4531SDave Airlie #define MGAREG_DR2 0x1cc8 79414c4531SDave Airlie #define MGAREG_DR3 0x1ccc 80414c4531SDave Airlie 81414c4531SDave Airlie #define MGAREG_DR4 0x1cd0 82414c4531SDave Airlie #define MGAREG_DR5 0x1cd4 83414c4531SDave Airlie #define MGAREG_DR6 0x1cd8 84414c4531SDave Airlie #define MGAREG_DR7 0x1cdc 85414c4531SDave Airlie 86414c4531SDave Airlie #define MGAREG_DR8 0x1ce0 87414c4531SDave Airlie #define MGAREG_DR9 0x1ce4 88414c4531SDave Airlie #define MGAREG_DR10 0x1ce8 89414c4531SDave Airlie #define MGAREG_DR11 0x1cec 90414c4531SDave Airlie 91414c4531SDave Airlie #define MGAREG_DR12 0x1cf0 92414c4531SDave Airlie #define MGAREG_DR13 0x1cf4 93414c4531SDave Airlie #define MGAREG_DR14 0x1cf8 94414c4531SDave Airlie #define MGAREG_DR15 0x1cfc 95414c4531SDave Airlie 96414c4531SDave Airlie #define MGAREG_SRCORG 0x2cb4 97414c4531SDave Airlie #define MGAREG_DSTORG 0x2cb8 98414c4531SDave Airlie 99414c4531SDave Airlie /* add or or this to one of the previous "power registers" to start 100414c4531SDave Airlie the drawing engine */ 101414c4531SDave Airlie 102414c4531SDave Airlie #define MGAREG_EXEC 0x0100 103414c4531SDave Airlie 104414c4531SDave Airlie #define MGAREG_FIFOSTATUS 0x1e10 105414c4531SDave Airlie #define MGAREG_Status 0x1e14 106414c4531SDave Airlie #define MGAREG_CACHEFLUSH 0x1fff 107414c4531SDave Airlie #define MGAREG_ICLEAR 0x1e18 108414c4531SDave Airlie #define MGAREG_IEN 0x1e1c 109414c4531SDave Airlie 110414c4531SDave Airlie #define MGAREG_VCOUNT 0x1e20 111414c4531SDave Airlie 112414c4531SDave Airlie #define MGAREG_Reset 0x1e40 113414c4531SDave Airlie 114414c4531SDave Airlie #define MGAREG_OPMODE 0x1e54 115414c4531SDave Airlie 116414c4531SDave Airlie /* Warp Registers */ 117414c4531SDave Airlie #define MGAREG_WIADDR 0x1dc0 118414c4531SDave Airlie #define MGAREG_WIADDR2 0x1dd8 119414c4531SDave Airlie #define MGAREG_WGETMSB 0x1dc8 120414c4531SDave Airlie #define MGAREG_WVRTXSZ 0x1dcc 121414c4531SDave Airlie #define MGAREG_WACCEPTSEQ 0x1dd4 122414c4531SDave Airlie #define MGAREG_WMISC 0x1e70 123414c4531SDave Airlie 124414c4531SDave Airlie #define MGAREG_MEMCTL 0x2e08 125414c4531SDave Airlie 126414c4531SDave Airlie /* OPMODE register additives */ 127414c4531SDave Airlie 128414c4531SDave Airlie #define MGAOPM_DMA_GENERAL (0x00 << 2) 129414c4531SDave Airlie #define MGAOPM_DMA_BLIT (0x01 << 2) 130414c4531SDave Airlie #define MGAOPM_DMA_VECTOR (0x10 << 2) 131414c4531SDave Airlie 132414c4531SDave Airlie /* MACCESS register additives */ 133414c4531SDave Airlie #define MGAMAC_PW8 0x00 134414c4531SDave Airlie #define MGAMAC_PW16 0x01 135414c4531SDave Airlie #define MGAMAC_PW24 0x03 /* not a typo */ 136414c4531SDave Airlie #define MGAMAC_PW32 0x02 /* not a typo */ 137414c4531SDave Airlie #define MGAMAC_BYPASS332 0x10000000 138414c4531SDave Airlie #define MGAMAC_NODITHER 0x40000000 139414c4531SDave Airlie #define MGAMAC_DIT555 0x80000000 140414c4531SDave Airlie 141414c4531SDave Airlie /* DWGCTL register additives */ 142414c4531SDave Airlie 143414c4531SDave Airlie /* Lines */ 144414c4531SDave Airlie 145414c4531SDave Airlie #define MGADWG_LINE_OPEN 0x00 146414c4531SDave Airlie #define MGADWG_AUTOLINE_OPEN 0x01 147414c4531SDave Airlie #define MGADWG_LINE_CLOSE 0x02 148414c4531SDave Airlie #define MGADWG_AUTOLINE_CLOSE 0x03 149414c4531SDave Airlie 150414c4531SDave Airlie /* Trapezoids */ 151414c4531SDave Airlie #define MGADWG_TRAP 0x04 152414c4531SDave Airlie #define MGADWG_TEXTURE_TRAP 0x06 153414c4531SDave Airlie 154414c4531SDave Airlie /* BitBlts */ 155414c4531SDave Airlie 156414c4531SDave Airlie #define MGADWG_BITBLT 0x08 157414c4531SDave Airlie #define MGADWG_FBITBLT 0x0c 158414c4531SDave Airlie #define MGADWG_ILOAD 0x09 159414c4531SDave Airlie #define MGADWG_ILOAD_SCALE 0x0d 160414c4531SDave Airlie #define MGADWG_ILOAD_FILTER 0x0f 161414c4531SDave Airlie #define MGADWG_ILOAD_HIQH 0x07 162414c4531SDave Airlie #define MGADWG_ILOAD_HIQHV 0x0e 163414c4531SDave Airlie #define MGADWG_IDUMP 0x0a 164414c4531SDave Airlie 165414c4531SDave Airlie /* atype access to WRAM */ 166414c4531SDave Airlie 167414c4531SDave Airlie #define MGADWG_RPL ( 0x00 << 4 ) 168414c4531SDave Airlie #define MGADWG_RSTR ( 0x01 << 4 ) 169414c4531SDave Airlie #define MGADWG_ZI ( 0x03 << 4 ) 170414c4531SDave Airlie #define MGADWG_BLK ( 0x04 << 4 ) 171414c4531SDave Airlie #define MGADWG_I ( 0x07 << 4 ) 172414c4531SDave Airlie 173414c4531SDave Airlie /* specifies whether bit blits are linear or xy */ 174414c4531SDave Airlie #define MGADWG_LINEAR ( 0x01 << 7 ) 175414c4531SDave Airlie 176414c4531SDave Airlie /* z drawing mode. use MGADWG_NOZCMP for always */ 177414c4531SDave Airlie 178414c4531SDave Airlie #define MGADWG_NOZCMP ( 0x00 << 8 ) 179414c4531SDave Airlie #define MGADWG_ZE ( 0x02 << 8 ) 180414c4531SDave Airlie #define MGADWG_ZNE ( 0x03 << 8 ) 181414c4531SDave Airlie #define MGADWG_ZLT ( 0x04 << 8 ) 182414c4531SDave Airlie #define MGADWG_ZLTE ( 0x05 << 8 ) 183414c4531SDave Airlie #define MGADWG_GT ( 0x06 << 8 ) 184414c4531SDave Airlie #define MGADWG_GTE ( 0x07 << 8 ) 185414c4531SDave Airlie 186414c4531SDave Airlie /* use this to force colour expansion circuitry to do its stuff */ 187414c4531SDave Airlie 188414c4531SDave Airlie #define MGADWG_SOLID ( 0x01 << 11 ) 189414c4531SDave Airlie 190414c4531SDave Airlie /* ar register at zero */ 191414c4531SDave Airlie 192414c4531SDave Airlie #define MGADWG_ARZERO ( 0x01 << 12 ) 193414c4531SDave Airlie 194414c4531SDave Airlie #define MGADWG_SGNZERO ( 0x01 << 13 ) 195414c4531SDave Airlie 196414c4531SDave Airlie #define MGADWG_SHIFTZERO ( 0x01 << 14 ) 197414c4531SDave Airlie 198414c4531SDave Airlie /* See table on 4-43 for bop ALU operations */ 199414c4531SDave Airlie 200414c4531SDave Airlie /* See table on 4-44 for translucidity masks */ 201414c4531SDave Airlie 202414c4531SDave Airlie #define MGADWG_BMONOLEF ( 0x00 << 25 ) 203414c4531SDave Airlie #define MGADWG_BMONOWF ( 0x04 << 25 ) 204414c4531SDave Airlie #define MGADWG_BPLAN ( 0x01 << 25 ) 205414c4531SDave Airlie 206414c4531SDave Airlie /* note that if bfcol is specified and you're doing a bitblt, it causes 207414c4531SDave Airlie a fbitblt to be performed, so check that you obey the fbitblt rules */ 208414c4531SDave Airlie 209414c4531SDave Airlie #define MGADWG_BFCOL ( 0x02 << 25 ) 210414c4531SDave Airlie #define MGADWG_BUYUV ( 0x0e << 25 ) 211414c4531SDave Airlie #define MGADWG_BU32BGR ( 0x03 << 25 ) 212414c4531SDave Airlie #define MGADWG_BU32RGB ( 0x07 << 25 ) 213414c4531SDave Airlie #define MGADWG_BU24BGR ( 0x0b << 25 ) 214414c4531SDave Airlie #define MGADWG_BU24RGB ( 0x0f << 25 ) 215414c4531SDave Airlie 216414c4531SDave Airlie #define MGADWG_PATTERN ( 0x01 << 29 ) 217414c4531SDave Airlie #define MGADWG_TRANSC ( 0x01 << 30 ) 218414c4531SDave Airlie #define MGAREG_MISC_WRITE 0x3c2 219414c4531SDave Airlie #define MGAREG_MISC_READ 0x3cc 220414c4531SDave Airlie #define MGAREG_MEM_MISC_WRITE 0x1fc2 221414c4531SDave Airlie #define MGAREG_MEM_MISC_READ 0x1fcc 222414c4531SDave Airlie 223414c4531SDave Airlie #define MGAREG_MISC_IOADSEL (0x1 << 0) 224414c4531SDave Airlie #define MGAREG_MISC_RAMMAPEN (0x1 << 1) 225db05f8d3SThomas Zimmermann #define MGAREG_MISC_CLK_SEL_MASK GENMASK(3, 2) 226414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_VGA25 (0x0 << 2) 227414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_VGA28 (0x1 << 2) 228414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_MGA_PIX (0x2 << 2) 229414c4531SDave Airlie #define MGAREG_MISC_CLK_SEL_MGA_MSK (0x3 << 2) 230414c4531SDave Airlie #define MGAREG_MISC_VIDEO_DIS (0x1 << 4) 231414c4531SDave Airlie #define MGAREG_MISC_HIGH_PG_SEL (0x1 << 5) 232db05f8d3SThomas Zimmermann #define MGAREG_MISC_HSYNCPOL BIT(6) 233db05f8d3SThomas Zimmermann #define MGAREG_MISC_VSYNCPOL BIT(7) 234414c4531SDave Airlie 235414c4531SDave Airlie /* MMIO VGA registers */ 236414c4531SDave Airlie #define MGAREG_SEQ_INDEX 0x1fc4 237414c4531SDave Airlie #define MGAREG_SEQ_DATA 0x1fc5 2382e5ccbbaSThomas Zimmermann 23970c3881eSThomas Zimmermann #define MGAREG_SEQ0_ASYNCRST BIT(0) 24070c3881eSThomas Zimmermann #define MGAREG_SEQ0_SYNCRST BIT(1) 24170c3881eSThomas Zimmermann 2422e5ccbbaSThomas Zimmermann #define MGAREG_SEQ1_SCROFF BIT(5) 2432e5ccbbaSThomas Zimmermann 244414c4531SDave Airlie #define MGAREG_CRTC_INDEX 0x1fd4 245414c4531SDave Airlie #define MGAREG_CRTC_DATA 0x1fd5 246da568d5eSThomas Zimmermann 247da568d5eSThomas Zimmermann #define MGAREG_CRTC11_VINTCLR BIT(4) 248da568d5eSThomas Zimmermann #define MGAREG_CRTC11_VINTEN BIT(5) 249da568d5eSThomas Zimmermann #define MGAREG_CRTC11_CRTCPROTECT BIT(7) 250da568d5eSThomas Zimmermann 251414c4531SDave Airlie #define MGAREG_CRTCEXT_INDEX 0x1fde 252414c4531SDave Airlie #define MGAREG_CRTCEXT_DATA 0x1fdf 253414c4531SDave Airlie 25472a03a35SThomas Zimmermann #define MGAREG_CRTCEXT0_OFFSET_MASK GENMASK(5, 4) 25572a03a35SThomas Zimmermann 256153fef41SThomas Zimmermann #define MGAREG_CRTCEXT1_VSYNCOFF BIT(5) 257153fef41SThomas Zimmermann #define MGAREG_CRTCEXT1_HSYNCOFF BIT(4) 258153fef41SThomas Zimmermann 259a080db9fSChristopher Harvey /* Cursor X and Y position */ 260a080db9fSChristopher Harvey #define MGA_CURPOSXL 0x3c0c 261a080db9fSChristopher Harvey #define MGA_CURPOSXH 0x3c0d 262a080db9fSChristopher Harvey #define MGA_CURPOSYL 0x3c0e 263a080db9fSChristopher Harvey #define MGA_CURPOSYH 0x3c0f 264414c4531SDave Airlie 265414c4531SDave Airlie /* MGA bits for registers PCI_OPTION_REG */ 266414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_PCI ( 0x00 << 0 ) 267414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_PLL ( 0x01 << 0 ) 268414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_EXT ( 0x02 << 0 ) 269414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_MSK ( 0x03 << 0 ) 270414c4531SDave Airlie 271414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_DIS ( 0x01 << 2 ) 272414c4531SDave Airlie #define MGA1064_OPT_G_CLK_DIV_1 ( 0x01 << 3 ) 273414c4531SDave Airlie #define MGA1064_OPT_M_CLK_DIV_1 ( 0x01 << 4 ) 274414c4531SDave Airlie 275414c4531SDave Airlie #define MGA1064_OPT_SYS_PLL_PDN ( 0x01 << 5 ) 276414c4531SDave Airlie #define MGA1064_OPT_VGA_ION ( 0x01 << 8 ) 277414c4531SDave Airlie 278414c4531SDave Airlie /* MGA registers in PCI config space */ 279414c4531SDave Airlie #define PCI_MGA_INDEX 0x44 280414c4531SDave Airlie #define PCI_MGA_DATA 0x48 281414c4531SDave Airlie #define PCI_MGA_OPTION 0x40 282414c4531SDave Airlie #define PCI_MGA_OPTION2 0x50 283414c4531SDave Airlie #define PCI_MGA_OPTION3 0x54 284414c4531SDave Airlie 28542452165SThomas Zimmermann #define PCI_MGA_OPTION_HARDPWMSK BIT(14) 28642452165SThomas Zimmermann 287414c4531SDave Airlie #define RAMDAC_OFFSET 0x3c00 288414c4531SDave Airlie 289414c4531SDave Airlie /* TVP3026 direct registers */ 290414c4531SDave Airlie 291414c4531SDave Airlie #define TVP3026_INDEX 0x00 292414c4531SDave Airlie #define TVP3026_WADR_PAL 0x00 293414c4531SDave Airlie #define TVP3026_COL_PAL 0x01 294414c4531SDave Airlie #define TVP3026_PIX_RD_MSK 0x02 295414c4531SDave Airlie #define TVP3026_RADR_PAL 0x03 296414c4531SDave Airlie #define TVP3026_CUR_COL_ADDR 0x04 297414c4531SDave Airlie #define TVP3026_CUR_COL_DATA 0x05 298414c4531SDave Airlie #define TVP3026_DATA 0x0a 299414c4531SDave Airlie #define TVP3026_CUR_RAM 0x0b 300414c4531SDave Airlie #define TVP3026_CUR_XLOW 0x0c 301414c4531SDave Airlie #define TVP3026_CUR_XHI 0x0d 302414c4531SDave Airlie #define TVP3026_CUR_YLOW 0x0e 303414c4531SDave Airlie #define TVP3026_CUR_YHI 0x0f 304414c4531SDave Airlie 305414c4531SDave Airlie /* TVP3026 indirect registers */ 306414c4531SDave Airlie 307414c4531SDave Airlie #define TVP3026_SILICON_REV 0x01 308414c4531SDave Airlie #define TVP3026_CURSOR_CTL 0x06 309414c4531SDave Airlie #define TVP3026_LATCH_CTL 0x0f 310414c4531SDave Airlie #define TVP3026_TRUE_COLOR_CTL 0x18 311414c4531SDave Airlie #define TVP3026_MUX_CTL 0x19 312414c4531SDave Airlie #define TVP3026_CLK_SEL 0x1a 313414c4531SDave Airlie #define TVP3026_PAL_PAGE 0x1c 314414c4531SDave Airlie #define TVP3026_GEN_CTL 0x1d 315414c4531SDave Airlie #define TVP3026_MISC_CTL 0x1e 316414c4531SDave Airlie #define TVP3026_GEN_IO_CTL 0x2a 317414c4531SDave Airlie #define TVP3026_GEN_IO_DATA 0x2b 318414c4531SDave Airlie #define TVP3026_PLL_ADDR 0x2c 319414c4531SDave Airlie #define TVP3026_PIX_CLK_DATA 0x2d 320414c4531SDave Airlie #define TVP3026_MEM_CLK_DATA 0x2e 321414c4531SDave Airlie #define TVP3026_LOAD_CLK_DATA 0x2f 322414c4531SDave Airlie #define TVP3026_KEY_RED_LOW 0x32 323414c4531SDave Airlie #define TVP3026_KEY_RED_HI 0x33 324414c4531SDave Airlie #define TVP3026_KEY_GREEN_LOW 0x34 325414c4531SDave Airlie #define TVP3026_KEY_GREEN_HI 0x35 326414c4531SDave Airlie #define TVP3026_KEY_BLUE_LOW 0x36 327414c4531SDave Airlie #define TVP3026_KEY_BLUE_HI 0x37 328414c4531SDave Airlie #define TVP3026_KEY_CTL 0x38 329414c4531SDave Airlie #define TVP3026_MCLK_CTL 0x39 330414c4531SDave Airlie #define TVP3026_SENSE_TEST 0x3a 331414c4531SDave Airlie #define TVP3026_TEST_DATA 0x3b 332414c4531SDave Airlie #define TVP3026_CRC_LSB 0x3c 333414c4531SDave Airlie #define TVP3026_CRC_MSB 0x3d 334414c4531SDave Airlie #define TVP3026_CRC_CTL 0x3e 335414c4531SDave Airlie #define TVP3026_ID 0x3f 336414c4531SDave Airlie #define TVP3026_RESET 0xff 337414c4531SDave Airlie 338414c4531SDave Airlie 339414c4531SDave Airlie /* MGA1064 DAC Register file */ 340414c4531SDave Airlie /* MGA1064 direct registers */ 341414c4531SDave Airlie 342414c4531SDave Airlie #define MGA1064_INDEX 0x00 343414c4531SDave Airlie #define MGA1064_WADR_PAL 0x00 344414c4531SDave Airlie #define MGA1064_SPAREREG 0x00 345414c4531SDave Airlie #define MGA1064_COL_PAL 0x01 346414c4531SDave Airlie #define MGA1064_PIX_RD_MSK 0x02 347414c4531SDave Airlie #define MGA1064_RADR_PAL 0x03 348414c4531SDave Airlie #define MGA1064_DATA 0x0a 349414c4531SDave Airlie 350414c4531SDave Airlie #define MGA1064_CUR_XLOW 0x0c 351414c4531SDave Airlie #define MGA1064_CUR_XHI 0x0d 352414c4531SDave Airlie #define MGA1064_CUR_YLOW 0x0e 353414c4531SDave Airlie #define MGA1064_CUR_YHI 0x0f 354414c4531SDave Airlie 355414c4531SDave Airlie /* MGA1064 indirect registers */ 356414c4531SDave Airlie #define MGA1064_DVI_PIPE_CTL 0x03 357414c4531SDave Airlie #define MGA1064_CURSOR_BASE_ADR_LOW 0x04 358414c4531SDave Airlie #define MGA1064_CURSOR_BASE_ADR_HI 0x05 359414c4531SDave Airlie #define MGA1064_CURSOR_CTL 0x06 360414c4531SDave Airlie #define MGA1064_CURSOR_COL0_RED 0x08 361414c4531SDave Airlie #define MGA1064_CURSOR_COL0_GREEN 0x09 362414c4531SDave Airlie #define MGA1064_CURSOR_COL0_BLUE 0x0a 363414c4531SDave Airlie 364414c4531SDave Airlie #define MGA1064_CURSOR_COL1_RED 0x0c 365414c4531SDave Airlie #define MGA1064_CURSOR_COL1_GREEN 0x0d 366414c4531SDave Airlie #define MGA1064_CURSOR_COL1_BLUE 0x0e 367414c4531SDave Airlie 368414c4531SDave Airlie #define MGA1064_CURSOR_COL2_RED 0x010 369414c4531SDave Airlie #define MGA1064_CURSOR_COL2_GREEN 0x011 370414c4531SDave Airlie #define MGA1064_CURSOR_COL2_BLUE 0x012 371414c4531SDave Airlie 372414c4531SDave Airlie #define MGA1064_VREF_CTL 0x018 373414c4531SDave Airlie 374414c4531SDave Airlie #define MGA1064_MUL_CTL 0x19 375414c4531SDave Airlie #define MGA1064_MUL_CTL_8bits 0x0 376414c4531SDave Airlie #define MGA1064_MUL_CTL_15bits 0x01 377414c4531SDave Airlie #define MGA1064_MUL_CTL_16bits 0x02 378414c4531SDave Airlie #define MGA1064_MUL_CTL_24bits 0x03 379414c4531SDave Airlie #define MGA1064_MUL_CTL_32bits 0x04 380414c4531SDave Airlie #define MGA1064_MUL_CTL_2G8V16bits 0x05 381414c4531SDave Airlie #define MGA1064_MUL_CTL_G16V16bits 0x06 382414c4531SDave Airlie #define MGA1064_MUL_CTL_32_24bits 0x07 383414c4531SDave Airlie 384414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL 0x1a 385414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_CLK_DIS ( 0x01 << 2 ) 386414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_CLK_POW_DOWN ( 0x01 << 3 ) 387414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_PCI ( 0x00 << 0 ) 388414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_PLL ( 0x01 << 0 ) 389414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_EXT ( 0x02 << 0 ) 390414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_MSK ( 0x03 << 0 ) 391414c4531SDave Airlie 392414c4531SDave Airlie #define MGA1064_GEN_CTL 0x1d 393414c4531SDave Airlie #define MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS (0x01 << 5) 394414c4531SDave Airlie #define MGA1064_MISC_CTL 0x1e 395414c4531SDave Airlie #define MGA1064_MISC_CTL_DAC_EN ( 0x01 << 0 ) 396414c4531SDave Airlie #define MGA1064_MISC_CTL_VGA ( 0x01 << 1 ) 397414c4531SDave Airlie #define MGA1064_MISC_CTL_DIS_CON ( 0x03 << 1 ) 398414c4531SDave Airlie #define MGA1064_MISC_CTL_MAFC ( 0x02 << 1 ) 399414c4531SDave Airlie #define MGA1064_MISC_CTL_VGA8 ( 0x01 << 3 ) 400414c4531SDave Airlie #define MGA1064_MISC_CTL_DAC_RAM_CS ( 0x01 << 4 ) 401414c4531SDave Airlie 402414c4531SDave Airlie #define MGA1064_GEN_IO_CTL2 0x29 403414c4531SDave Airlie #define MGA1064_GEN_IO_CTL 0x2a 404414c4531SDave Airlie #define MGA1064_GEN_IO_DATA 0x2b 405414c4531SDave Airlie #define MGA1064_SYS_PLL_M 0x2c 406414c4531SDave Airlie #define MGA1064_SYS_PLL_N 0x2d 407414c4531SDave Airlie #define MGA1064_SYS_PLL_P 0x2e 408414c4531SDave Airlie #define MGA1064_SYS_PLL_STAT 0x2f 409414c4531SDave Airlie 410414c4531SDave Airlie #define MGA1064_REMHEADCTL 0x30 411414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKDIS ( 0x01 << 0 ) 412414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_OFF ( 0x00 << 1 ) 413414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_PLL ( 0x01 << 1 ) 414414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_PCI ( 0x02 << 1 ) 415414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_MSK ( 0x03 << 1 ) 416414c4531SDave Airlie 417414c4531SDave Airlie #define MGA1064_REMHEADCTL2 0x31 418414c4531SDave Airlie 419414c4531SDave Airlie #define MGA1064_ZOOM_CTL 0x38 420414c4531SDave Airlie #define MGA1064_SENSE_TST 0x3a 421414c4531SDave Airlie 422414c4531SDave Airlie #define MGA1064_CRC_LSB 0x3c 423414c4531SDave Airlie #define MGA1064_CRC_MSB 0x3d 424414c4531SDave Airlie #define MGA1064_CRC_CTL 0x3e 425414c4531SDave Airlie #define MGA1064_COL_KEY_MSK_LSB 0x40 426414c4531SDave Airlie #define MGA1064_COL_KEY_MSK_MSB 0x41 427414c4531SDave Airlie #define MGA1064_COL_KEY_LSB 0x42 428414c4531SDave Airlie #define MGA1064_COL_KEY_MSB 0x43 429414c4531SDave Airlie #define MGA1064_PIX_PLLA_M 0x44 430414c4531SDave Airlie #define MGA1064_PIX_PLLA_N 0x45 431414c4531SDave Airlie #define MGA1064_PIX_PLLA_P 0x46 432414c4531SDave Airlie #define MGA1064_PIX_PLLB_M 0x48 433414c4531SDave Airlie #define MGA1064_PIX_PLLB_N 0x49 434414c4531SDave Airlie #define MGA1064_PIX_PLLB_P 0x4a 435414c4531SDave Airlie #define MGA1064_PIX_PLLC_M 0x4c 436414c4531SDave Airlie #define MGA1064_PIX_PLLC_N 0x4d 437414c4531SDave Airlie #define MGA1064_PIX_PLLC_P 0x4e 438414c4531SDave Airlie 439414c4531SDave Airlie #define MGA1064_PIX_PLL_STAT 0x4f 440414c4531SDave Airlie 441414c4531SDave Airlie /*Added for G450 dual head*/ 442414c4531SDave Airlie 443414c4531SDave Airlie #define MGA1064_VID_PLL_STAT 0x8c 444414c4531SDave Airlie #define MGA1064_VID_PLL_P 0x8D 445414c4531SDave Airlie #define MGA1064_VID_PLL_M 0x8E 446414c4531SDave Airlie #define MGA1064_VID_PLL_N 0x8F 447414c4531SDave Airlie 448414c4531SDave Airlie /* Modified PLL for G200 Winbond (G200WB) */ 449414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_M 0xb7 450414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_N 0xb6 451414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_P 0xb8 452414c4531SDave Airlie 453414c4531SDave Airlie /* Modified PLL for G200 Maxim (G200EV) */ 454414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_M 0xb6 455414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_N 0xb7 456414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_P 0xb8 457414c4531SDave Airlie 458414c4531SDave Airlie /* Modified PLL for G200 EH */ 459414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_M 0xb6 460414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_N 0xb7 461414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_P 0xb8 462414c4531SDave Airlie 463414c4531SDave Airlie /* Modified PLL for G200 Maxim (G200ER) */ 464414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_M 0xb7 465414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_N 0xb6 466414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_P 0xb8 467414c4531SDave Airlie 468414c4531SDave Airlie #define MGA1064_DISP_CTL 0x8a 469414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_MASK 0x01 470414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_DIS 0x00 471414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_EN 0x01 472414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_MASK (0x03 << 2) 473414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_DIS 0x00 474414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1 (0x01 << 2) 475414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC2 (0x02 << 2) 476414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_TVE (0x03 << 2) 477414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_MASK (0x03 << 5) 478414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_DIS 0x00 479414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC1 (0x01 << 5) 480414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC2RGB (0x02 << 5) 481414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC2656 (0x03 << 5) 482414c4531SDave Airlie 483414c4531SDave Airlie #define MGA1064_SYNC_CTL 0x8b 484414c4531SDave Airlie 485414c4531SDave Airlie #define MGA1064_PWR_CTL 0xa0 486414c4531SDave Airlie #define MGA1064_PWR_CTL_DAC2_EN (0x01 << 0) 487414c4531SDave Airlie #define MGA1064_PWR_CTL_VID_PLL_EN (0x01 << 1) 488414c4531SDave Airlie #define MGA1064_PWR_CTL_PANEL_EN (0x01 << 2) 489414c4531SDave Airlie #define MGA1064_PWR_CTL_RFIFO_EN (0x01 << 3) 490414c4531SDave Airlie #define MGA1064_PWR_CTL_CFIFO_EN (0x01 << 4) 491414c4531SDave Airlie 492414c4531SDave Airlie #define MGA1064_PAN_CTL 0xa2 493414c4531SDave Airlie 494414c4531SDave Airlie /* Using crtc2 */ 495414c4531SDave Airlie #define MGAREG2_C2CTL 0x10 496414c4531SDave Airlie #define MGAREG2_C2HPARAM 0x14 497414c4531SDave Airlie #define MGAREG2_C2HSYNC 0x18 498414c4531SDave Airlie #define MGAREG2_C2VPARAM 0x1c 499414c4531SDave Airlie #define MGAREG2_C2VSYNC 0x20 500414c4531SDave Airlie #define MGAREG2_C2STARTADD0 0x28 501414c4531SDave Airlie 502414c4531SDave Airlie #define MGAREG2_C2OFFSET 0x40 503414c4531SDave Airlie #define MGAREG2_C2DATACTL 0x4c 504414c4531SDave Airlie 505414c4531SDave Airlie #define MGAREG_C2CTL 0x3c10 506414c4531SDave Airlie #define MGAREG_C2CTL_C2_EN 0x01 507414c4531SDave Airlie 508414c4531SDave Airlie #define MGAREG_C2_HIPRILVL_M (0x07 << 4) 509414c4531SDave Airlie #define MGAREG_C2_MAXHIPRI_M (0x07 << 8) 510414c4531SDave Airlie 511414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_MASK (0x03 << 1) 512414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSELH_MASK (0x01 << 14) 513414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_PCICLK 0x00 514414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VDOCLK (0x01 << 1) 515414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_PIXELPLL (0x02 << 1) 516414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VIDEOPLL (0x03 << 1) 517414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VDCLK (0x01 << 14) 518414c4531SDave Airlie 519414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_CRISTAL (0x01 << 1) | (0x01 << 14) 520414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_SYSTEMPLL (0x02 << 1) | (0x01 << 14) 521414c4531SDave Airlie 522414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKDIS_MASK (0x01 << 3) 523414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKDIS_DISABLE (0x01 << 3) 524414c4531SDave Airlie 525414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_MASK (0x01 << 20) 526414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_CRTC1 0x00 527414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_CRTC2 (0x01 << 20) 528414c4531SDave Airlie 529414c4531SDave Airlie #define MGAREG_C2HPARAM 0x3c14 530414c4531SDave Airlie #define MGAREG_C2HSYNC 0x3c18 531414c4531SDave Airlie #define MGAREG_C2VPARAM 0x3c1c 532414c4531SDave Airlie #define MGAREG_C2VSYNC 0x3c20 533414c4531SDave Airlie #define MGAREG_C2STARTADD0 0x3c28 534414c4531SDave Airlie 535414c4531SDave Airlie #define MGAREG_C2OFFSET 0x3c40 536414c4531SDave Airlie #define MGAREG_C2DATACTL 0x3c4c 537414c4531SDave Airlie 538414c4531SDave Airlie /* video register */ 539414c4531SDave Airlie 540414c4531SDave Airlie #define MGAREG_BESA1C3ORG 0x3d60 541414c4531SDave Airlie #define MGAREG_BESA1CORG 0x3d10 542414c4531SDave Airlie #define MGAREG_BESA1ORG 0x3d00 543414c4531SDave Airlie #define MGAREG_BESCTL 0x3d20 544414c4531SDave Airlie #define MGAREG_BESGLOBCTL 0x3dc0 545414c4531SDave Airlie #define MGAREG_BESHCOORD 0x3d28 546414c4531SDave Airlie #define MGAREG_BESHISCAL 0x3d30 547414c4531SDave Airlie #define MGAREG_BESHSRCEND 0x3d3c 548414c4531SDave Airlie #define MGAREG_BESHSRCLST 0x3d50 549414c4531SDave Airlie #define MGAREG_BESHSRCST 0x3d38 550414c4531SDave Airlie #define MGAREG_BESLUMACTL 0x3d40 551414c4531SDave Airlie #define MGAREG_BESPITCH 0x3d24 552414c4531SDave Airlie #define MGAREG_BESV1SRCLST 0x3d54 553414c4531SDave Airlie #define MGAREG_BESV1WGHT 0x3d48 554414c4531SDave Airlie #define MGAREG_BESVCOORD 0x3d2c 555414c4531SDave Airlie #define MGAREG_BESVISCAL 0x3d34 556414c4531SDave Airlie 557414c4531SDave Airlie /* texture engine registers */ 558414c4531SDave Airlie 559414c4531SDave Airlie #define MGAREG_TMR0 0x2c00 560414c4531SDave Airlie #define MGAREG_TMR1 0x2c04 561414c4531SDave Airlie #define MGAREG_TMR2 0x2c08 562414c4531SDave Airlie #define MGAREG_TMR3 0x2c0c 563414c4531SDave Airlie #define MGAREG_TMR4 0x2c10 564414c4531SDave Airlie #define MGAREG_TMR5 0x2c14 565414c4531SDave Airlie #define MGAREG_TMR6 0x2c18 566414c4531SDave Airlie #define MGAREG_TMR7 0x2c1c 567414c4531SDave Airlie #define MGAREG_TMR8 0x2c20 568414c4531SDave Airlie #define MGAREG_TEXORG 0x2c24 569414c4531SDave Airlie #define MGAREG_TEXWIDTH 0x2c28 570414c4531SDave Airlie #define MGAREG_TEXHEIGHT 0x2c2c 571414c4531SDave Airlie #define MGAREG_TEXCTL 0x2c30 572414c4531SDave Airlie # define MGA_TW4 (0x00000000) 573414c4531SDave Airlie # define MGA_TW8 (0x00000001) 574414c4531SDave Airlie # define MGA_TW15 (0x00000002) 575414c4531SDave Airlie # define MGA_TW16 (0x00000003) 576414c4531SDave Airlie # define MGA_TW12 (0x00000004) 577414c4531SDave Airlie # define MGA_TW32 (0x00000006) 578414c4531SDave Airlie # define MGA_TW8A (0x00000007) 579414c4531SDave Airlie # define MGA_TW8AL (0x00000008) 580414c4531SDave Airlie # define MGA_TW422 (0x0000000A) 581414c4531SDave Airlie # define MGA_TW422UYVY (0x0000000B) 582414c4531SDave Airlie # define MGA_PITCHLIN (0x00000100) 583414c4531SDave Airlie # define MGA_NOPERSPECTIVE (0x00200000) 584414c4531SDave Airlie # define MGA_TAKEY (0x02000000) 585414c4531SDave Airlie # define MGA_TAMASK (0x04000000) 586414c4531SDave Airlie # define MGA_CLAMPUV (0x18000000) 587414c4531SDave Airlie # define MGA_TEXMODULATE (0x20000000) 588414c4531SDave Airlie #define MGAREG_TEXCTL2 0x2c3c 589414c4531SDave Airlie # define MGA_G400_TC2_MAGIC (0x00008000) 590414c4531SDave Airlie # define MGA_TC2_DECALBLEND (0x00000001) 591414c4531SDave Airlie # define MGA_TC2_IDECAL (0x00000002) 592414c4531SDave Airlie # define MGA_TC2_DECALDIS (0x00000004) 593414c4531SDave Airlie # define MGA_TC2_CKSTRANSDIS (0x00000010) 594414c4531SDave Airlie # define MGA_TC2_BORDEREN (0x00000020) 595414c4531SDave Airlie # define MGA_TC2_SPECEN (0x00000040) 596414c4531SDave Airlie # define MGA_TC2_DUALTEX (0x00000080) 597414c4531SDave Airlie # define MGA_TC2_TABLEFOG (0x00000100) 598414c4531SDave Airlie # define MGA_TC2_BUMPMAP (0x00000200) 599414c4531SDave Airlie # define MGA_TC2_SELECT_TMU1 (0x80000000) 600414c4531SDave Airlie #define MGAREG_TEXTRANS 0x2c34 601414c4531SDave Airlie #define MGAREG_TEXTRANSHIGH 0x2c38 602414c4531SDave Airlie #define MGAREG_TEXFILTER 0x2c58 603414c4531SDave Airlie # define MGA_MIN_NRST (0x00000000) 604414c4531SDave Airlie # define MGA_MIN_BILIN (0x00000002) 605414c4531SDave Airlie # define MGA_MIN_ANISO (0x0000000D) 606414c4531SDave Airlie # define MGA_MAG_NRST (0x00000000) 607414c4531SDave Airlie # define MGA_MAG_BILIN (0x00000020) 608414c4531SDave Airlie # define MGA_FILTERALPHA (0x00100000) 609414c4531SDave Airlie #define MGAREG_ALPHASTART 0x2c70 610414c4531SDave Airlie #define MGAREG_ALPHAXINC 0x2c74 611414c4531SDave Airlie #define MGAREG_ALPHAYINC 0x2c78 612414c4531SDave Airlie #define MGAREG_ALPHACTRL 0x2c7c 613414c4531SDave Airlie # define MGA_SRC_ZERO (0x00000000) 614414c4531SDave Airlie # define MGA_SRC_ONE (0x00000001) 615414c4531SDave Airlie # define MGA_SRC_DST_COLOR (0x00000002) 616414c4531SDave Airlie # define MGA_SRC_ONE_MINUS_DST_COLOR (0x00000003) 617414c4531SDave Airlie # define MGA_SRC_ALPHA (0x00000004) 618414c4531SDave Airlie # define MGA_SRC_ONE_MINUS_SRC_ALPHA (0x00000005) 619414c4531SDave Airlie # define MGA_SRC_DST_ALPHA (0x00000006) 620414c4531SDave Airlie # define MGA_SRC_ONE_MINUS_DST_ALPHA (0x00000007) 621414c4531SDave Airlie # define MGA_SRC_SRC_ALPHA_SATURATE (0x00000008) 622414c4531SDave Airlie # define MGA_SRC_BLEND_MASK (0x0000000f) 623414c4531SDave Airlie # define MGA_DST_ZERO (0x00000000) 624414c4531SDave Airlie # define MGA_DST_ONE (0x00000010) 625414c4531SDave Airlie # define MGA_DST_SRC_COLOR (0x00000020) 626414c4531SDave Airlie # define MGA_DST_ONE_MINUS_SRC_COLOR (0x00000030) 627414c4531SDave Airlie # define MGA_DST_SRC_ALPHA (0x00000040) 628414c4531SDave Airlie # define MGA_DST_ONE_MINUS_SRC_ALPHA (0x00000050) 629414c4531SDave Airlie # define MGA_DST_DST_ALPHA (0x00000060) 630414c4531SDave Airlie # define MGA_DST_ONE_MINUS_DST_ALPHA (0x00000070) 631414c4531SDave Airlie # define MGA_DST_BLEND_MASK (0x00000070) 632414c4531SDave Airlie # define MGA_ALPHACHANNEL (0x00000100) 633414c4531SDave Airlie # define MGA_VIDEOALPHA (0x00000200) 634414c4531SDave Airlie # define MGA_DIFFUSEDALPHA (0x01000000) 635414c4531SDave Airlie # define MGA_MODULATEDALPHA (0x02000000) 636414c4531SDave Airlie #define MGAREG_TDUALSTAGE0 (0x2CF8) 637414c4531SDave Airlie #define MGAREG_TDUALSTAGE1 (0x2CFC) 638414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_DIFFUSE (0x00000000) 639414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_SPECULAR (0x00000001) 640414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_FCOL (0x00000002) 641414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_PREVSTAGE (0x00000003) 642414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_DIFFUSE (0x00000000) 643414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_FCOL (0x00000004) 644414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_CURRTEX (0x00000008) 645414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_PREVTEX (0x0000000c) 646414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_PREVSTAGE (0x00000010) 647414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1_REPLICATEALPHA (0x00000020) 648414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1_INV (0x00000040) 649414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_REPLICATEALPHA (0x00000080) 650414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_INV (0x00000100) 651414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA1INV (0x00000200) 652414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA2INV (0x00000400) 653414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1MUL_ALPHA1 (0x00000800) 654414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2MUL_ALPHA2 (0x00001000) 655414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1ADD_MULOUT (0x00002000) 656414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2ADD_MULOUT (0x00004000) 657414c4531SDave Airlie # define MGA_TDS_COLOR_MODBRIGHT_2X (0x00008000) 658414c4531SDave Airlie # define MGA_TDS_COLOR_MODBRIGHT_4X (0x00010000) 659414c4531SDave Airlie # define MGA_TDS_COLOR_ADD_SUB (0x00000000) 660414c4531SDave Airlie # define MGA_TDS_COLOR_ADD_ADD (0x00020000) 661414c4531SDave Airlie # define MGA_TDS_COLOR_ADD2X (0x00040000) 662414c4531SDave Airlie # define MGA_TDS_COLOR_ADDBIAS (0x00080000) 663414c4531SDave Airlie # define MGA_TDS_COLOR_BLEND (0x00100000) 664414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_ARG1 (0x00000000) 665414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_ARG2 (0x00200000) 666414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_ADD (0x00400000) 667414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_MUL (0x00600000) 668414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG1_INV (0x00800000) 669414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_DIFFUSE (0x00000000) 670414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_FCOL (0x01000000) 671414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_PREVTEX (0x02000000) 672414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_PREVSTAGE (0x03000000) 673414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_INV (0x04000000) 674414c4531SDave Airlie # define MGA_TDS_ALPHA_ADD (0x08000000) 675414c4531SDave Airlie # define MGA_TDS_ALPHA_ADDBIAS (0x10000000) 676414c4531SDave Airlie # define MGA_TDS_ALPHA_ADD2X (0x20000000) 677414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_ARG1 (0x00000000) 678414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_ARG2 (0x40000000) 679414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_ADD (0x80000000) 680414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_MUL (0xc0000000) 681414c4531SDave Airlie 682414c4531SDave Airlie #define MGAREG_DWGSYNC 0x2c4c 683414c4531SDave Airlie 684414c4531SDave Airlie #define MGAREG_AGP_PLL 0x1e4c 685414c4531SDave Airlie #define MGA_AGP2XPLL_ENABLE 0x1 686414c4531SDave Airlie #define MGA_AGP2XPLL_DISABLE 0x0 687414c4531SDave Airlie 688414c4531SDave Airlie #endif 689