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 992b066860Sshaomin Deng /* add 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 105*89c6ea20SThomas Zimmermann 10668550521SThomas Zimmermann #define MGAREG_STATUS 0x1e14 107*89c6ea20SThomas Zimmermann #define MGAREG_STATUS_VLINEPEN BIT(5) 108*89c6ea20SThomas Zimmermann 109414c4531SDave Airlie #define MGAREG_CACHEFLUSH 0x1fff 110*89c6ea20SThomas Zimmermann 111414c4531SDave Airlie #define MGAREG_ICLEAR 0x1e18 112*89c6ea20SThomas Zimmermann #define MGAREG_ICLEAR_VLINEICLR BIT(5) 113*89c6ea20SThomas Zimmermann 114414c4531SDave Airlie #define MGAREG_IEN 0x1e1c 115*89c6ea20SThomas Zimmermann #define MGAREG_IEN_VLINEIEN BIT(5) 116414c4531SDave Airlie 117414c4531SDave Airlie #define MGAREG_VCOUNT 0x1e20 118414c4531SDave Airlie 119414c4531SDave Airlie #define MGAREG_Reset 0x1e40 120414c4531SDave Airlie 121414c4531SDave Airlie #define MGAREG_OPMODE 0x1e54 122414c4531SDave Airlie 123414c4531SDave Airlie /* Warp Registers */ 124414c4531SDave Airlie #define MGAREG_WIADDR 0x1dc0 125414c4531SDave Airlie #define MGAREG_WIADDR2 0x1dd8 126414c4531SDave Airlie #define MGAREG_WGETMSB 0x1dc8 127414c4531SDave Airlie #define MGAREG_WVRTXSZ 0x1dcc 128414c4531SDave Airlie #define MGAREG_WACCEPTSEQ 0x1dd4 129414c4531SDave Airlie #define MGAREG_WMISC 0x1e70 130414c4531SDave Airlie 131414c4531SDave Airlie #define MGAREG_MEMCTL 0x2e08 132414c4531SDave Airlie 133414c4531SDave Airlie /* OPMODE register additives */ 134414c4531SDave Airlie 135414c4531SDave Airlie #define MGAOPM_DMA_GENERAL (0x00 << 2) 136414c4531SDave Airlie #define MGAOPM_DMA_BLIT (0x01 << 2) 137414c4531SDave Airlie #define MGAOPM_DMA_VECTOR (0x10 << 2) 138414c4531SDave Airlie 139414c4531SDave Airlie /* MACCESS register additives */ 140414c4531SDave Airlie #define MGAMAC_PW8 0x00 141414c4531SDave Airlie #define MGAMAC_PW16 0x01 142414c4531SDave Airlie #define MGAMAC_PW24 0x03 /* not a typo */ 143414c4531SDave Airlie #define MGAMAC_PW32 0x02 /* not a typo */ 144414c4531SDave Airlie #define MGAMAC_BYPASS332 0x10000000 145414c4531SDave Airlie #define MGAMAC_NODITHER 0x40000000 146414c4531SDave Airlie #define MGAMAC_DIT555 0x80000000 147414c4531SDave Airlie 148414c4531SDave Airlie /* DWGCTL register additives */ 149414c4531SDave Airlie 150414c4531SDave Airlie /* Lines */ 151414c4531SDave Airlie 152414c4531SDave Airlie #define MGADWG_LINE_OPEN 0x00 153414c4531SDave Airlie #define MGADWG_AUTOLINE_OPEN 0x01 154414c4531SDave Airlie #define MGADWG_LINE_CLOSE 0x02 155414c4531SDave Airlie #define MGADWG_AUTOLINE_CLOSE 0x03 156414c4531SDave Airlie 157414c4531SDave Airlie /* Trapezoids */ 158414c4531SDave Airlie #define MGADWG_TRAP 0x04 159414c4531SDave Airlie #define MGADWG_TEXTURE_TRAP 0x06 160414c4531SDave Airlie 161414c4531SDave Airlie /* BitBlts */ 162414c4531SDave Airlie 163414c4531SDave Airlie #define MGADWG_BITBLT 0x08 164414c4531SDave Airlie #define MGADWG_FBITBLT 0x0c 165414c4531SDave Airlie #define MGADWG_ILOAD 0x09 166414c4531SDave Airlie #define MGADWG_ILOAD_SCALE 0x0d 167414c4531SDave Airlie #define MGADWG_ILOAD_FILTER 0x0f 168414c4531SDave Airlie #define MGADWG_ILOAD_HIQH 0x07 169414c4531SDave Airlie #define MGADWG_ILOAD_HIQHV 0x0e 170414c4531SDave Airlie #define MGADWG_IDUMP 0x0a 171414c4531SDave Airlie 172414c4531SDave Airlie /* atype access to WRAM */ 173414c4531SDave Airlie 174414c4531SDave Airlie #define MGADWG_RPL ( 0x00 << 4 ) 175414c4531SDave Airlie #define MGADWG_RSTR ( 0x01 << 4 ) 176414c4531SDave Airlie #define MGADWG_ZI ( 0x03 << 4 ) 177414c4531SDave Airlie #define MGADWG_BLK ( 0x04 << 4 ) 178414c4531SDave Airlie #define MGADWG_I ( 0x07 << 4 ) 179414c4531SDave Airlie 180414c4531SDave Airlie /* specifies whether bit blits are linear or xy */ 181414c4531SDave Airlie #define MGADWG_LINEAR ( 0x01 << 7 ) 182414c4531SDave Airlie 183414c4531SDave Airlie /* z drawing mode. use MGADWG_NOZCMP for always */ 184414c4531SDave Airlie 185414c4531SDave Airlie #define MGADWG_NOZCMP ( 0x00 << 8 ) 186414c4531SDave Airlie #define MGADWG_ZE ( 0x02 << 8 ) 187414c4531SDave Airlie #define MGADWG_ZNE ( 0x03 << 8 ) 188414c4531SDave Airlie #define MGADWG_ZLT ( 0x04 << 8 ) 189414c4531SDave Airlie #define MGADWG_ZLTE ( 0x05 << 8 ) 190414c4531SDave Airlie #define MGADWG_GT ( 0x06 << 8 ) 191414c4531SDave Airlie #define MGADWG_GTE ( 0x07 << 8 ) 192414c4531SDave Airlie 193414c4531SDave Airlie /* use this to force colour expansion circuitry to do its stuff */ 194414c4531SDave Airlie 195414c4531SDave Airlie #define MGADWG_SOLID ( 0x01 << 11 ) 196414c4531SDave Airlie 197414c4531SDave Airlie /* ar register at zero */ 198414c4531SDave Airlie 199414c4531SDave Airlie #define MGADWG_ARZERO ( 0x01 << 12 ) 200414c4531SDave Airlie 201414c4531SDave Airlie #define MGADWG_SGNZERO ( 0x01 << 13 ) 202414c4531SDave Airlie 203414c4531SDave Airlie #define MGADWG_SHIFTZERO ( 0x01 << 14 ) 204414c4531SDave Airlie 205414c4531SDave Airlie /* See table on 4-43 for bop ALU operations */ 206414c4531SDave Airlie 207414c4531SDave Airlie /* See table on 4-44 for translucidity masks */ 208414c4531SDave Airlie 209414c4531SDave Airlie #define MGADWG_BMONOLEF ( 0x00 << 25 ) 210414c4531SDave Airlie #define MGADWG_BMONOWF ( 0x04 << 25 ) 211414c4531SDave Airlie #define MGADWG_BPLAN ( 0x01 << 25 ) 212414c4531SDave Airlie 213414c4531SDave Airlie /* note that if bfcol is specified and you're doing a bitblt, it causes 214414c4531SDave Airlie a fbitblt to be performed, so check that you obey the fbitblt rules */ 215414c4531SDave Airlie 216414c4531SDave Airlie #define MGADWG_BFCOL ( 0x02 << 25 ) 217414c4531SDave Airlie #define MGADWG_BUYUV ( 0x0e << 25 ) 218414c4531SDave Airlie #define MGADWG_BU32BGR ( 0x03 << 25 ) 219414c4531SDave Airlie #define MGADWG_BU32RGB ( 0x07 << 25 ) 220414c4531SDave Airlie #define MGADWG_BU24BGR ( 0x0b << 25 ) 221414c4531SDave Airlie #define MGADWG_BU24RGB ( 0x0f << 25 ) 222414c4531SDave Airlie 223414c4531SDave Airlie #define MGADWG_PATTERN ( 0x01 << 29 ) 224414c4531SDave Airlie #define MGADWG_TRANSC ( 0x01 << 30 ) 225414c4531SDave Airlie #define MGAREG_MISC_WRITE 0x3c2 226414c4531SDave Airlie #define MGAREG_MISC_READ 0x3cc 227414c4531SDave Airlie #define MGAREG_MEM_MISC_WRITE 0x1fc2 228414c4531SDave Airlie #define MGAREG_MEM_MISC_READ 0x1fcc 229414c4531SDave Airlie 230414c4531SDave Airlie #define MGAREG_MISC_IOADSEL (0x1 << 0) 231414c4531SDave Airlie #define MGAREG_MISC_RAMMAPEN (0x1 << 1) 23214769672SThomas Zimmermann #define MGAREG_MISC_CLKSEL_MASK GENMASK(3, 2) 23314769672SThomas Zimmermann #define MGAREG_MISC_CLKSEL_VGA25 (0x0 << 2) 23414769672SThomas Zimmermann #define MGAREG_MISC_CLKSEL_VGA28 (0x1 << 2) 23514769672SThomas Zimmermann #define MGAREG_MISC_CLKSEL_MGA (0x3 << 2) 236414c4531SDave Airlie #define MGAREG_MISC_VIDEO_DIS (0x1 << 4) 237414c4531SDave Airlie #define MGAREG_MISC_HIGH_PG_SEL (0x1 << 5) 238db05f8d3SThomas Zimmermann #define MGAREG_MISC_HSYNCPOL BIT(6) 239db05f8d3SThomas Zimmermann #define MGAREG_MISC_VSYNCPOL BIT(7) 240414c4531SDave Airlie 241414c4531SDave Airlie /* MMIO VGA registers */ 242414c4531SDave Airlie #define MGAREG_SEQ_INDEX 0x1fc4 243414c4531SDave Airlie #define MGAREG_SEQ_DATA 0x1fc5 2442e5ccbbaSThomas Zimmermann 24570c3881eSThomas Zimmermann #define MGAREG_SEQ0_ASYNCRST BIT(0) 24670c3881eSThomas Zimmermann #define MGAREG_SEQ0_SYNCRST BIT(1) 24770c3881eSThomas Zimmermann 2482e5ccbbaSThomas Zimmermann #define MGAREG_SEQ1_SCROFF BIT(5) 2492e5ccbbaSThomas Zimmermann 250414c4531SDave Airlie #define MGAREG_CRTC_INDEX 0x1fd4 251414c4531SDave Airlie #define MGAREG_CRTC_DATA 0x1fd5 252da568d5eSThomas Zimmermann 253da568d5eSThomas Zimmermann #define MGAREG_CRTC11_VINTCLR BIT(4) 254da568d5eSThomas Zimmermann #define MGAREG_CRTC11_VINTEN BIT(5) 255da568d5eSThomas Zimmermann #define MGAREG_CRTC11_CRTCPROTECT BIT(7) 256da568d5eSThomas Zimmermann 257414c4531SDave Airlie #define MGAREG_CRTCEXT_INDEX 0x1fde 258414c4531SDave Airlie #define MGAREG_CRTCEXT_DATA 0x1fdf 259414c4531SDave Airlie 26072a03a35SThomas Zimmermann #define MGAREG_CRTCEXT0_OFFSET_MASK GENMASK(5, 4) 26172a03a35SThomas Zimmermann 262d1e40d8eSThomas Zimmermann #define MGAREG_CRTCEXT1_VRSTEN BIT(7) 263153fef41SThomas Zimmermann #define MGAREG_CRTCEXT1_VSYNCOFF BIT(5) 264153fef41SThomas Zimmermann #define MGAREG_CRTCEXT1_HSYNCOFF BIT(4) 265d1e40d8eSThomas Zimmermann #define MGAREG_CRTCEXT1_HRSTEN BIT(3) 266153fef41SThomas Zimmermann 26778e5b503SThomas Zimmermann #define MGAREG_CRTCEXT3_MGAMODE BIT(7) 26878e5b503SThomas Zimmermann 269a080db9fSChristopher Harvey /* Cursor X and Y position */ 270a080db9fSChristopher Harvey #define MGA_CURPOSXL 0x3c0c 271a080db9fSChristopher Harvey #define MGA_CURPOSXH 0x3c0d 272a080db9fSChristopher Harvey #define MGA_CURPOSYL 0x3c0e 273a080db9fSChristopher Harvey #define MGA_CURPOSYH 0x3c0f 274414c4531SDave Airlie 275414c4531SDave Airlie /* MGA bits for registers PCI_OPTION_REG */ 276414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_PCI ( 0x00 << 0 ) 277414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_PLL ( 0x01 << 0 ) 278414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_EXT ( 0x02 << 0 ) 279414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_MSK ( 0x03 << 0 ) 280414c4531SDave Airlie 281414c4531SDave Airlie #define MGA1064_OPT_SYS_CLK_DIS ( 0x01 << 2 ) 282414c4531SDave Airlie #define MGA1064_OPT_G_CLK_DIV_1 ( 0x01 << 3 ) 283414c4531SDave Airlie #define MGA1064_OPT_M_CLK_DIV_1 ( 0x01 << 4 ) 284414c4531SDave Airlie 285414c4531SDave Airlie #define MGA1064_OPT_SYS_PLL_PDN ( 0x01 << 5 ) 286414c4531SDave Airlie #define MGA1064_OPT_VGA_ION ( 0x01 << 8 ) 287414c4531SDave Airlie 288414c4531SDave Airlie /* MGA registers in PCI config space */ 289414c4531SDave Airlie #define PCI_MGA_INDEX 0x44 290414c4531SDave Airlie #define PCI_MGA_DATA 0x48 291414c4531SDave Airlie #define PCI_MGA_OPTION 0x40 292414c4531SDave Airlie #define PCI_MGA_OPTION2 0x50 293414c4531SDave Airlie #define PCI_MGA_OPTION3 0x54 294414c4531SDave Airlie 29542452165SThomas Zimmermann #define PCI_MGA_OPTION_HARDPWMSK BIT(14) 29642452165SThomas Zimmermann 297414c4531SDave Airlie #define RAMDAC_OFFSET 0x3c00 298414c4531SDave Airlie 299414c4531SDave Airlie /* TVP3026 direct registers */ 300414c4531SDave Airlie 301414c4531SDave Airlie #define TVP3026_INDEX 0x00 302414c4531SDave Airlie #define TVP3026_WADR_PAL 0x00 303414c4531SDave Airlie #define TVP3026_COL_PAL 0x01 304414c4531SDave Airlie #define TVP3026_PIX_RD_MSK 0x02 305414c4531SDave Airlie #define TVP3026_RADR_PAL 0x03 306414c4531SDave Airlie #define TVP3026_CUR_COL_ADDR 0x04 307414c4531SDave Airlie #define TVP3026_CUR_COL_DATA 0x05 308414c4531SDave Airlie #define TVP3026_DATA 0x0a 309414c4531SDave Airlie #define TVP3026_CUR_RAM 0x0b 310414c4531SDave Airlie #define TVP3026_CUR_XLOW 0x0c 311414c4531SDave Airlie #define TVP3026_CUR_XHI 0x0d 312414c4531SDave Airlie #define TVP3026_CUR_YLOW 0x0e 313414c4531SDave Airlie #define TVP3026_CUR_YHI 0x0f 314414c4531SDave Airlie 315414c4531SDave Airlie /* TVP3026 indirect registers */ 316414c4531SDave Airlie 317414c4531SDave Airlie #define TVP3026_SILICON_REV 0x01 318414c4531SDave Airlie #define TVP3026_CURSOR_CTL 0x06 319414c4531SDave Airlie #define TVP3026_LATCH_CTL 0x0f 320414c4531SDave Airlie #define TVP3026_TRUE_COLOR_CTL 0x18 321414c4531SDave Airlie #define TVP3026_MUX_CTL 0x19 322414c4531SDave Airlie #define TVP3026_CLK_SEL 0x1a 323414c4531SDave Airlie #define TVP3026_PAL_PAGE 0x1c 324414c4531SDave Airlie #define TVP3026_GEN_CTL 0x1d 325414c4531SDave Airlie #define TVP3026_MISC_CTL 0x1e 326414c4531SDave Airlie #define TVP3026_GEN_IO_CTL 0x2a 327414c4531SDave Airlie #define TVP3026_GEN_IO_DATA 0x2b 328414c4531SDave Airlie #define TVP3026_PLL_ADDR 0x2c 329414c4531SDave Airlie #define TVP3026_PIX_CLK_DATA 0x2d 330414c4531SDave Airlie #define TVP3026_MEM_CLK_DATA 0x2e 331414c4531SDave Airlie #define TVP3026_LOAD_CLK_DATA 0x2f 332414c4531SDave Airlie #define TVP3026_KEY_RED_LOW 0x32 333414c4531SDave Airlie #define TVP3026_KEY_RED_HI 0x33 334414c4531SDave Airlie #define TVP3026_KEY_GREEN_LOW 0x34 335414c4531SDave Airlie #define TVP3026_KEY_GREEN_HI 0x35 336414c4531SDave Airlie #define TVP3026_KEY_BLUE_LOW 0x36 337414c4531SDave Airlie #define TVP3026_KEY_BLUE_HI 0x37 338414c4531SDave Airlie #define TVP3026_KEY_CTL 0x38 339414c4531SDave Airlie #define TVP3026_MCLK_CTL 0x39 340414c4531SDave Airlie #define TVP3026_SENSE_TEST 0x3a 341414c4531SDave Airlie #define TVP3026_TEST_DATA 0x3b 342414c4531SDave Airlie #define TVP3026_CRC_LSB 0x3c 343414c4531SDave Airlie #define TVP3026_CRC_MSB 0x3d 344414c4531SDave Airlie #define TVP3026_CRC_CTL 0x3e 345414c4531SDave Airlie #define TVP3026_ID 0x3f 346414c4531SDave Airlie #define TVP3026_RESET 0xff 347414c4531SDave Airlie 348414c4531SDave Airlie 349414c4531SDave Airlie /* MGA1064 DAC Register file */ 350414c4531SDave Airlie /* MGA1064 direct registers */ 351414c4531SDave Airlie 352414c4531SDave Airlie #define MGA1064_INDEX 0x00 353414c4531SDave Airlie #define MGA1064_WADR_PAL 0x00 354414c4531SDave Airlie #define MGA1064_SPAREREG 0x00 355414c4531SDave Airlie #define MGA1064_COL_PAL 0x01 356414c4531SDave Airlie #define MGA1064_PIX_RD_MSK 0x02 357414c4531SDave Airlie #define MGA1064_RADR_PAL 0x03 358414c4531SDave Airlie #define MGA1064_DATA 0x0a 359414c4531SDave Airlie 360414c4531SDave Airlie #define MGA1064_CUR_XLOW 0x0c 361414c4531SDave Airlie #define MGA1064_CUR_XHI 0x0d 362414c4531SDave Airlie #define MGA1064_CUR_YLOW 0x0e 363414c4531SDave Airlie #define MGA1064_CUR_YHI 0x0f 364414c4531SDave Airlie 365414c4531SDave Airlie /* MGA1064 indirect registers */ 366414c4531SDave Airlie #define MGA1064_DVI_PIPE_CTL 0x03 367414c4531SDave Airlie #define MGA1064_CURSOR_BASE_ADR_LOW 0x04 368414c4531SDave Airlie #define MGA1064_CURSOR_BASE_ADR_HI 0x05 369414c4531SDave Airlie #define MGA1064_CURSOR_CTL 0x06 370414c4531SDave Airlie #define MGA1064_CURSOR_COL0_RED 0x08 371414c4531SDave Airlie #define MGA1064_CURSOR_COL0_GREEN 0x09 372414c4531SDave Airlie #define MGA1064_CURSOR_COL0_BLUE 0x0a 373414c4531SDave Airlie 374414c4531SDave Airlie #define MGA1064_CURSOR_COL1_RED 0x0c 375414c4531SDave Airlie #define MGA1064_CURSOR_COL1_GREEN 0x0d 376414c4531SDave Airlie #define MGA1064_CURSOR_COL1_BLUE 0x0e 377414c4531SDave Airlie 378414c4531SDave Airlie #define MGA1064_CURSOR_COL2_RED 0x010 379414c4531SDave Airlie #define MGA1064_CURSOR_COL2_GREEN 0x011 380414c4531SDave Airlie #define MGA1064_CURSOR_COL2_BLUE 0x012 381414c4531SDave Airlie 382414c4531SDave Airlie #define MGA1064_VREF_CTL 0x018 383414c4531SDave Airlie 384414c4531SDave Airlie #define MGA1064_MUL_CTL 0x19 385414c4531SDave Airlie #define MGA1064_MUL_CTL_8bits 0x0 386414c4531SDave Airlie #define MGA1064_MUL_CTL_15bits 0x01 387414c4531SDave Airlie #define MGA1064_MUL_CTL_16bits 0x02 388414c4531SDave Airlie #define MGA1064_MUL_CTL_24bits 0x03 389414c4531SDave Airlie #define MGA1064_MUL_CTL_32bits 0x04 390414c4531SDave Airlie #define MGA1064_MUL_CTL_2G8V16bits 0x05 391414c4531SDave Airlie #define MGA1064_MUL_CTL_G16V16bits 0x06 392414c4531SDave Airlie #define MGA1064_MUL_CTL_32_24bits 0x07 393414c4531SDave Airlie 394414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL 0x1a 395414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_CLK_DIS ( 0x01 << 2 ) 396414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_CLK_POW_DOWN ( 0x01 << 3 ) 397414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_PCI ( 0x00 << 0 ) 398414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_PLL ( 0x01 << 0 ) 399414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_EXT ( 0x02 << 0 ) 400414c4531SDave Airlie #define MGA1064_PIX_CLK_CTL_SEL_MSK ( 0x03 << 0 ) 401414c4531SDave Airlie 402414c4531SDave Airlie #define MGA1064_GEN_CTL 0x1d 403414c4531SDave Airlie #define MGA1064_GEN_CTL_SYNC_ON_GREEN_DIS (0x01 << 5) 404414c4531SDave Airlie #define MGA1064_MISC_CTL 0x1e 405414c4531SDave Airlie #define MGA1064_MISC_CTL_DAC_EN ( 0x01 << 0 ) 406414c4531SDave Airlie #define MGA1064_MISC_CTL_VGA ( 0x01 << 1 ) 407414c4531SDave Airlie #define MGA1064_MISC_CTL_DIS_CON ( 0x03 << 1 ) 408414c4531SDave Airlie #define MGA1064_MISC_CTL_MAFC ( 0x02 << 1 ) 409414c4531SDave Airlie #define MGA1064_MISC_CTL_VGA8 ( 0x01 << 3 ) 410414c4531SDave Airlie #define MGA1064_MISC_CTL_DAC_RAM_CS ( 0x01 << 4 ) 411414c4531SDave Airlie 412414c4531SDave Airlie #define MGA1064_GEN_IO_CTL2 0x29 413414c4531SDave Airlie #define MGA1064_GEN_IO_CTL 0x2a 414414c4531SDave Airlie #define MGA1064_GEN_IO_DATA 0x2b 415414c4531SDave Airlie #define MGA1064_SYS_PLL_M 0x2c 416414c4531SDave Airlie #define MGA1064_SYS_PLL_N 0x2d 417414c4531SDave Airlie #define MGA1064_SYS_PLL_P 0x2e 418414c4531SDave Airlie #define MGA1064_SYS_PLL_STAT 0x2f 419414c4531SDave Airlie 420414c4531SDave Airlie #define MGA1064_REMHEADCTL 0x30 421414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKDIS ( 0x01 << 0 ) 422414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_OFF ( 0x00 << 1 ) 423414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_PLL ( 0x01 << 1 ) 424414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_PCI ( 0x02 << 1 ) 425414c4531SDave Airlie #define MGA1064_REMHEADCTL_CLKSL_MSK ( 0x03 << 1 ) 426414c4531SDave Airlie 427414c4531SDave Airlie #define MGA1064_REMHEADCTL2 0x31 428414c4531SDave Airlie 429414c4531SDave Airlie #define MGA1064_ZOOM_CTL 0x38 430414c4531SDave Airlie #define MGA1064_SENSE_TST 0x3a 431414c4531SDave Airlie 432414c4531SDave Airlie #define MGA1064_CRC_LSB 0x3c 433414c4531SDave Airlie #define MGA1064_CRC_MSB 0x3d 434414c4531SDave Airlie #define MGA1064_CRC_CTL 0x3e 435414c4531SDave Airlie #define MGA1064_COL_KEY_MSK_LSB 0x40 436414c4531SDave Airlie #define MGA1064_COL_KEY_MSK_MSB 0x41 437414c4531SDave Airlie #define MGA1064_COL_KEY_LSB 0x42 438414c4531SDave Airlie #define MGA1064_COL_KEY_MSB 0x43 439414c4531SDave Airlie #define MGA1064_PIX_PLLA_M 0x44 440414c4531SDave Airlie #define MGA1064_PIX_PLLA_N 0x45 441414c4531SDave Airlie #define MGA1064_PIX_PLLA_P 0x46 442414c4531SDave Airlie #define MGA1064_PIX_PLLB_M 0x48 443414c4531SDave Airlie #define MGA1064_PIX_PLLB_N 0x49 444414c4531SDave Airlie #define MGA1064_PIX_PLLB_P 0x4a 445414c4531SDave Airlie #define MGA1064_PIX_PLLC_M 0x4c 446414c4531SDave Airlie #define MGA1064_PIX_PLLC_N 0x4d 447414c4531SDave Airlie #define MGA1064_PIX_PLLC_P 0x4e 448414c4531SDave Airlie 449414c4531SDave Airlie #define MGA1064_PIX_PLL_STAT 0x4f 450414c4531SDave Airlie 451414c4531SDave Airlie /*Added for G450 dual head*/ 452414c4531SDave Airlie 453414c4531SDave Airlie #define MGA1064_VID_PLL_STAT 0x8c 454414c4531SDave Airlie #define MGA1064_VID_PLL_P 0x8D 455414c4531SDave Airlie #define MGA1064_VID_PLL_M 0x8E 456414c4531SDave Airlie #define MGA1064_VID_PLL_N 0x8F 457414c4531SDave Airlie 458414c4531SDave Airlie /* Modified PLL for G200 Winbond (G200WB) */ 459414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_M 0xb7 460414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_N 0xb6 461414c4531SDave Airlie #define MGA1064_WB_PIX_PLLC_P 0xb8 462414c4531SDave Airlie 463414c4531SDave Airlie /* Modified PLL for G200 Maxim (G200EV) */ 464414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_M 0xb6 465414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_N 0xb7 466414c4531SDave Airlie #define MGA1064_EV_PIX_PLLC_P 0xb8 467414c4531SDave Airlie 468414c4531SDave Airlie /* Modified PLL for G200 EH */ 469414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_M 0xb6 470414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_N 0xb7 471414c4531SDave Airlie #define MGA1064_EH_PIX_PLLC_P 0xb8 472414c4531SDave Airlie 473414c4531SDave Airlie /* Modified PLL for G200 Maxim (G200ER) */ 474414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_M 0xb7 475414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_N 0xb6 476414c4531SDave Airlie #define MGA1064_ER_PIX_PLLC_P 0xb8 477414c4531SDave Airlie 478414c4531SDave Airlie #define MGA1064_DISP_CTL 0x8a 479414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_MASK 0x01 480414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_DIS 0x00 481414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC1OUTSEL_EN 0x01 482414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_MASK (0x03 << 2) 483414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_DIS 0x00 484414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC1 (0x01 << 2) 485414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_CRTC2 (0x02 << 2) 486414c4531SDave Airlie #define MGA1064_DISP_CTL_DAC2OUTSEL_TVE (0x03 << 2) 487414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_MASK (0x03 << 5) 488414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_DIS 0x00 489414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC1 (0x01 << 5) 490414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC2RGB (0x02 << 5) 491414c4531SDave Airlie #define MGA1064_DISP_CTL_PANOUTSEL_CRTC2656 (0x03 << 5) 492414c4531SDave Airlie 493414c4531SDave Airlie #define MGA1064_SYNC_CTL 0x8b 494414c4531SDave Airlie 495414c4531SDave Airlie #define MGA1064_PWR_CTL 0xa0 496414c4531SDave Airlie #define MGA1064_PWR_CTL_DAC2_EN (0x01 << 0) 497414c4531SDave Airlie #define MGA1064_PWR_CTL_VID_PLL_EN (0x01 << 1) 498414c4531SDave Airlie #define MGA1064_PWR_CTL_PANEL_EN (0x01 << 2) 499414c4531SDave Airlie #define MGA1064_PWR_CTL_RFIFO_EN (0x01 << 3) 500414c4531SDave Airlie #define MGA1064_PWR_CTL_CFIFO_EN (0x01 << 4) 501414c4531SDave Airlie 502414c4531SDave Airlie #define MGA1064_PAN_CTL 0xa2 503414c4531SDave Airlie 504414c4531SDave Airlie /* Using crtc2 */ 505414c4531SDave Airlie #define MGAREG2_C2CTL 0x10 506414c4531SDave Airlie #define MGAREG2_C2HPARAM 0x14 507414c4531SDave Airlie #define MGAREG2_C2HSYNC 0x18 508414c4531SDave Airlie #define MGAREG2_C2VPARAM 0x1c 509414c4531SDave Airlie #define MGAREG2_C2VSYNC 0x20 510414c4531SDave Airlie #define MGAREG2_C2STARTADD0 0x28 511414c4531SDave Airlie 512414c4531SDave Airlie #define MGAREG2_C2OFFSET 0x40 513414c4531SDave Airlie #define MGAREG2_C2DATACTL 0x4c 514414c4531SDave Airlie 515414c4531SDave Airlie #define MGAREG_C2CTL 0x3c10 516414c4531SDave Airlie #define MGAREG_C2CTL_C2_EN 0x01 517414c4531SDave Airlie 518414c4531SDave Airlie #define MGAREG_C2_HIPRILVL_M (0x07 << 4) 519414c4531SDave Airlie #define MGAREG_C2_MAXHIPRI_M (0x07 << 8) 520414c4531SDave Airlie 521414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_MASK (0x03 << 1) 522414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSELH_MASK (0x01 << 14) 523414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_PCICLK 0x00 524414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VDOCLK (0x01 << 1) 525414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_PIXELPLL (0x02 << 1) 526414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VIDEOPLL (0x03 << 1) 527414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_VDCLK (0x01 << 14) 528414c4531SDave Airlie 529414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_CRISTAL (0x01 << 1) | (0x01 << 14) 530414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKSEL_SYSTEMPLL (0x02 << 1) | (0x01 << 14) 531414c4531SDave Airlie 532414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKDIS_MASK (0x01 << 3) 533414c4531SDave Airlie #define MGAREG_C2CTL_PIXCLKDIS_DISABLE (0x01 << 3) 534414c4531SDave Airlie 535414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_MASK (0x01 << 20) 536414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_CRTC1 0x00 537414c4531SDave Airlie #define MGAREG_C2CTL_CRTCDACSEL_CRTC2 (0x01 << 20) 538414c4531SDave Airlie 539414c4531SDave Airlie #define MGAREG_C2HPARAM 0x3c14 540414c4531SDave Airlie #define MGAREG_C2HSYNC 0x3c18 541414c4531SDave Airlie #define MGAREG_C2VPARAM 0x3c1c 542414c4531SDave Airlie #define MGAREG_C2VSYNC 0x3c20 543414c4531SDave Airlie #define MGAREG_C2STARTADD0 0x3c28 544414c4531SDave Airlie 545414c4531SDave Airlie #define MGAREG_C2OFFSET 0x3c40 546414c4531SDave Airlie #define MGAREG_C2DATACTL 0x3c4c 547414c4531SDave Airlie 548414c4531SDave Airlie /* video register */ 549414c4531SDave Airlie 550414c4531SDave Airlie #define MGAREG_BESA1C3ORG 0x3d60 551414c4531SDave Airlie #define MGAREG_BESA1CORG 0x3d10 552414c4531SDave Airlie #define MGAREG_BESA1ORG 0x3d00 553414c4531SDave Airlie #define MGAREG_BESCTL 0x3d20 554414c4531SDave Airlie #define MGAREG_BESGLOBCTL 0x3dc0 555414c4531SDave Airlie #define MGAREG_BESHCOORD 0x3d28 556414c4531SDave Airlie #define MGAREG_BESHISCAL 0x3d30 557414c4531SDave Airlie #define MGAREG_BESHSRCEND 0x3d3c 558414c4531SDave Airlie #define MGAREG_BESHSRCLST 0x3d50 559414c4531SDave Airlie #define MGAREG_BESHSRCST 0x3d38 560414c4531SDave Airlie #define MGAREG_BESLUMACTL 0x3d40 561414c4531SDave Airlie #define MGAREG_BESPITCH 0x3d24 562414c4531SDave Airlie #define MGAREG_BESV1SRCLST 0x3d54 563414c4531SDave Airlie #define MGAREG_BESV1WGHT 0x3d48 564414c4531SDave Airlie #define MGAREG_BESVCOORD 0x3d2c 565414c4531SDave Airlie #define MGAREG_BESVISCAL 0x3d34 566414c4531SDave Airlie 567414c4531SDave Airlie /* texture engine registers */ 568414c4531SDave Airlie 569414c4531SDave Airlie #define MGAREG_TMR0 0x2c00 570414c4531SDave Airlie #define MGAREG_TMR1 0x2c04 571414c4531SDave Airlie #define MGAREG_TMR2 0x2c08 572414c4531SDave Airlie #define MGAREG_TMR3 0x2c0c 573414c4531SDave Airlie #define MGAREG_TMR4 0x2c10 574414c4531SDave Airlie #define MGAREG_TMR5 0x2c14 575414c4531SDave Airlie #define MGAREG_TMR6 0x2c18 576414c4531SDave Airlie #define MGAREG_TMR7 0x2c1c 577414c4531SDave Airlie #define MGAREG_TMR8 0x2c20 578414c4531SDave Airlie #define MGAREG_TEXORG 0x2c24 579414c4531SDave Airlie #define MGAREG_TEXWIDTH 0x2c28 580414c4531SDave Airlie #define MGAREG_TEXHEIGHT 0x2c2c 581414c4531SDave Airlie #define MGAREG_TEXCTL 0x2c30 582414c4531SDave Airlie # define MGA_TW4 (0x00000000) 583414c4531SDave Airlie # define MGA_TW8 (0x00000001) 584414c4531SDave Airlie # define MGA_TW15 (0x00000002) 585414c4531SDave Airlie # define MGA_TW16 (0x00000003) 586414c4531SDave Airlie # define MGA_TW12 (0x00000004) 587414c4531SDave Airlie # define MGA_TW32 (0x00000006) 588414c4531SDave Airlie # define MGA_TW8A (0x00000007) 589414c4531SDave Airlie # define MGA_TW8AL (0x00000008) 590414c4531SDave Airlie # define MGA_TW422 (0x0000000A) 591414c4531SDave Airlie # define MGA_TW422UYVY (0x0000000B) 592414c4531SDave Airlie # define MGA_PITCHLIN (0x00000100) 593414c4531SDave Airlie # define MGA_NOPERSPECTIVE (0x00200000) 594414c4531SDave Airlie # define MGA_TAKEY (0x02000000) 595414c4531SDave Airlie # define MGA_TAMASK (0x04000000) 596414c4531SDave Airlie # define MGA_CLAMPUV (0x18000000) 597414c4531SDave Airlie # define MGA_TEXMODULATE (0x20000000) 598414c4531SDave Airlie #define MGAREG_TEXCTL2 0x2c3c 599414c4531SDave Airlie # define MGA_G400_TC2_MAGIC (0x00008000) 600414c4531SDave Airlie # define MGA_TC2_DECALBLEND (0x00000001) 601414c4531SDave Airlie # define MGA_TC2_IDECAL (0x00000002) 602414c4531SDave Airlie # define MGA_TC2_DECALDIS (0x00000004) 603414c4531SDave Airlie # define MGA_TC2_CKSTRANSDIS (0x00000010) 604414c4531SDave Airlie # define MGA_TC2_BORDEREN (0x00000020) 605414c4531SDave Airlie # define MGA_TC2_SPECEN (0x00000040) 606414c4531SDave Airlie # define MGA_TC2_DUALTEX (0x00000080) 607414c4531SDave Airlie # define MGA_TC2_TABLEFOG (0x00000100) 608414c4531SDave Airlie # define MGA_TC2_BUMPMAP (0x00000200) 609414c4531SDave Airlie # define MGA_TC2_SELECT_TMU1 (0x80000000) 610414c4531SDave Airlie #define MGAREG_TEXTRANS 0x2c34 611414c4531SDave Airlie #define MGAREG_TEXTRANSHIGH 0x2c38 612414c4531SDave Airlie #define MGAREG_TEXFILTER 0x2c58 613414c4531SDave Airlie # define MGA_MIN_NRST (0x00000000) 614414c4531SDave Airlie # define MGA_MIN_BILIN (0x00000002) 615414c4531SDave Airlie # define MGA_MIN_ANISO (0x0000000D) 616414c4531SDave Airlie # define MGA_MAG_NRST (0x00000000) 617414c4531SDave Airlie # define MGA_MAG_BILIN (0x00000020) 618414c4531SDave Airlie # define MGA_FILTERALPHA (0x00100000) 619414c4531SDave Airlie #define MGAREG_ALPHASTART 0x2c70 620414c4531SDave Airlie #define MGAREG_ALPHAXINC 0x2c74 621414c4531SDave Airlie #define MGAREG_ALPHAYINC 0x2c78 622414c4531SDave Airlie #define MGAREG_ALPHACTRL 0x2c7c 623414c4531SDave Airlie # define MGA_SRC_ZERO (0x00000000) 624414c4531SDave Airlie # define MGA_SRC_ONE (0x00000001) 625414c4531SDave Airlie # define MGA_SRC_DST_COLOR (0x00000002) 626414c4531SDave Airlie # define MGA_SRC_ONE_MINUS_DST_COLOR (0x00000003) 627414c4531SDave Airlie # define MGA_SRC_ALPHA (0x00000004) 628414c4531SDave Airlie # define MGA_SRC_ONE_MINUS_SRC_ALPHA (0x00000005) 629414c4531SDave Airlie # define MGA_SRC_DST_ALPHA (0x00000006) 630414c4531SDave Airlie # define MGA_SRC_ONE_MINUS_DST_ALPHA (0x00000007) 631414c4531SDave Airlie # define MGA_SRC_SRC_ALPHA_SATURATE (0x00000008) 632414c4531SDave Airlie # define MGA_SRC_BLEND_MASK (0x0000000f) 633414c4531SDave Airlie # define MGA_DST_ZERO (0x00000000) 634414c4531SDave Airlie # define MGA_DST_ONE (0x00000010) 635414c4531SDave Airlie # define MGA_DST_SRC_COLOR (0x00000020) 636414c4531SDave Airlie # define MGA_DST_ONE_MINUS_SRC_COLOR (0x00000030) 637414c4531SDave Airlie # define MGA_DST_SRC_ALPHA (0x00000040) 638414c4531SDave Airlie # define MGA_DST_ONE_MINUS_SRC_ALPHA (0x00000050) 639414c4531SDave Airlie # define MGA_DST_DST_ALPHA (0x00000060) 640414c4531SDave Airlie # define MGA_DST_ONE_MINUS_DST_ALPHA (0x00000070) 641414c4531SDave Airlie # define MGA_DST_BLEND_MASK (0x00000070) 642414c4531SDave Airlie # define MGA_ALPHACHANNEL (0x00000100) 643414c4531SDave Airlie # define MGA_VIDEOALPHA (0x00000200) 644414c4531SDave Airlie # define MGA_DIFFUSEDALPHA (0x01000000) 645414c4531SDave Airlie # define MGA_MODULATEDALPHA (0x02000000) 646414c4531SDave Airlie #define MGAREG_TDUALSTAGE0 (0x2CF8) 647414c4531SDave Airlie #define MGAREG_TDUALSTAGE1 (0x2CFC) 648414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_DIFFUSE (0x00000000) 649414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_SPECULAR (0x00000001) 650414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_FCOL (0x00000002) 651414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_PREVSTAGE (0x00000003) 652414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_DIFFUSE (0x00000000) 653414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_FCOL (0x00000004) 654414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_CURRTEX (0x00000008) 655414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_PREVTEX (0x0000000c) 656414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA_PREVSTAGE (0x00000010) 657414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1_REPLICATEALPHA (0x00000020) 658414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1_INV (0x00000040) 659414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_REPLICATEALPHA (0x00000080) 660414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2_INV (0x00000100) 661414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA1INV (0x00000200) 662414c4531SDave Airlie # define MGA_TDS_COLOR_ALPHA2INV (0x00000400) 663414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1MUL_ALPHA1 (0x00000800) 664414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2MUL_ALPHA2 (0x00001000) 665414c4531SDave Airlie # define MGA_TDS_COLOR_ARG1ADD_MULOUT (0x00002000) 666414c4531SDave Airlie # define MGA_TDS_COLOR_ARG2ADD_MULOUT (0x00004000) 667414c4531SDave Airlie # define MGA_TDS_COLOR_MODBRIGHT_2X (0x00008000) 668414c4531SDave Airlie # define MGA_TDS_COLOR_MODBRIGHT_4X (0x00010000) 669414c4531SDave Airlie # define MGA_TDS_COLOR_ADD_SUB (0x00000000) 670414c4531SDave Airlie # define MGA_TDS_COLOR_ADD_ADD (0x00020000) 671414c4531SDave Airlie # define MGA_TDS_COLOR_ADD2X (0x00040000) 672414c4531SDave Airlie # define MGA_TDS_COLOR_ADDBIAS (0x00080000) 673414c4531SDave Airlie # define MGA_TDS_COLOR_BLEND (0x00100000) 674414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_ARG1 (0x00000000) 675414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_ARG2 (0x00200000) 676414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_ADD (0x00400000) 677414c4531SDave Airlie # define MGA_TDS_COLOR_SEL_MUL (0x00600000) 678414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG1_INV (0x00800000) 679414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_DIFFUSE (0x00000000) 680414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_FCOL (0x01000000) 681414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_PREVTEX (0x02000000) 682414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_PREVSTAGE (0x03000000) 683414c4531SDave Airlie # define MGA_TDS_ALPHA_ARG2_INV (0x04000000) 684414c4531SDave Airlie # define MGA_TDS_ALPHA_ADD (0x08000000) 685414c4531SDave Airlie # define MGA_TDS_ALPHA_ADDBIAS (0x10000000) 686414c4531SDave Airlie # define MGA_TDS_ALPHA_ADD2X (0x20000000) 687414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_ARG1 (0x00000000) 688414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_ARG2 (0x40000000) 689414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_ADD (0x80000000) 690414c4531SDave Airlie # define MGA_TDS_ALPHA_SEL_MUL (0xc0000000) 691414c4531SDave Airlie 692414c4531SDave Airlie #define MGAREG_DWGSYNC 0x2c4c 693414c4531SDave Airlie 694414c4531SDave Airlie #define MGAREG_AGP_PLL 0x1e4c 695414c4531SDave Airlie #define MGA_AGP2XPLL_ENABLE 0x1 696414c4531SDave Airlie #define MGA_AGP2XPLL_DISABLE 0x0 697414c4531SDave Airlie 698414c4531SDave Airlie #endif 699