aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/mga_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/drm/mga_drv.h')
-rw-r--r--drivers/char/drm/mga_drv.h123
1 files changed, 61 insertions, 62 deletions
diff --git a/drivers/char/drm/mga_drv.h b/drivers/char/drm/mga_drv.h
index cd94c04e31c0..f6ebd24bd587 100644
--- a/drivers/char/drm/mga_drv.h
+++ b/drivers/char/drm/mga_drv.h
@@ -216,8 +216,8 @@ static inline u32 _MGA_READ(u32 * addr)
216#define MGA_WRITE( reg, val ) DRM_WRITE32(dev_priv->mmio, (reg), (val)) 216#define MGA_WRITE( reg, val ) DRM_WRITE32(dev_priv->mmio, (reg), (val))
217#endif 217#endif
218 218
219#define DWGREG0 0x1c00 219#define DWGREG0 0x1c00
220#define DWGREG0_END 0x1dff 220#define DWGREG0_END 0x1dff
221#define DWGREG1 0x2c00 221#define DWGREG1 0x2c00
222#define DWGREG1_END 0x2dff 222#define DWGREG1_END 0x2dff
223 223
@@ -249,7 +249,7 @@ do { \
249 } else if ( dev_priv->prim.space < \ 249 } else if ( dev_priv->prim.space < \
250 dev_priv->prim.high_mark ) { \ 250 dev_priv->prim.high_mark ) { \
251 if ( MGA_DMA_DEBUG ) \ 251 if ( MGA_DMA_DEBUG ) \
252 DRM_INFO( "%s: wrap...\n", __FUNCTION__ ); \ 252 DRM_INFO( "wrap...\n"); \
253 return -EBUSY; \ 253 return -EBUSY; \
254 } \ 254 } \
255 } \ 255 } \
@@ -260,7 +260,7 @@ do { \
260 if ( test_bit( 0, &dev_priv->prim.wrapped ) ) { \ 260 if ( test_bit( 0, &dev_priv->prim.wrapped ) ) { \
261 if ( mga_do_wait_for_idle( dev_priv ) < 0 ) { \ 261 if ( mga_do_wait_for_idle( dev_priv ) < 0 ) { \
262 if ( MGA_DMA_DEBUG ) \ 262 if ( MGA_DMA_DEBUG ) \
263 DRM_INFO( "%s: wrap...\n", __FUNCTION__ ); \ 263 DRM_INFO( "wrap...\n"); \
264 return -EBUSY; \ 264 return -EBUSY; \
265 } \ 265 } \
266 mga_do_dma_wrap_end( dev_priv ); \ 266 mga_do_dma_wrap_end( dev_priv ); \
@@ -280,8 +280,7 @@ do { \
280#define BEGIN_DMA( n ) \ 280#define BEGIN_DMA( n ) \
281do { \ 281do { \
282 if ( MGA_VERBOSE ) { \ 282 if ( MGA_VERBOSE ) { \
283 DRM_INFO( "BEGIN_DMA( %d ) in %s\n", \ 283 DRM_INFO( "BEGIN_DMA( %d )\n", (n) ); \
284 (n), __FUNCTION__ ); \
285 DRM_INFO( " space=0x%x req=0x%Zx\n", \ 284 DRM_INFO( " space=0x%x req=0x%Zx\n", \
286 dev_priv->prim.space, (n) * DMA_BLOCK_SIZE ); \ 285 dev_priv->prim.space, (n) * DMA_BLOCK_SIZE ); \
287 } \ 286 } \
@@ -292,7 +291,7 @@ do { \
292#define BEGIN_DMA_WRAP() \ 291#define BEGIN_DMA_WRAP() \
293do { \ 292do { \
294 if ( MGA_VERBOSE ) { \ 293 if ( MGA_VERBOSE ) { \
295 DRM_INFO( "BEGIN_DMA() in %s\n", __FUNCTION__ ); \ 294 DRM_INFO( "BEGIN_DMA()\n" ); \
296 DRM_INFO( " space=0x%x\n", dev_priv->prim.space ); \ 295 DRM_INFO( " space=0x%x\n", dev_priv->prim.space ); \
297 } \ 296 } \
298 prim = dev_priv->prim.start; \ 297 prim = dev_priv->prim.start; \
@@ -311,7 +310,7 @@ do { \
311#define FLUSH_DMA() \ 310#define FLUSH_DMA() \
312do { \ 311do { \
313 if ( 0 ) { \ 312 if ( 0 ) { \
314 DRM_INFO( "%s:\n", __FUNCTION__ ); \ 313 DRM_INFO( "\n" ); \
315 DRM_INFO( " tail=0x%06x head=0x%06lx\n", \ 314 DRM_INFO( " tail=0x%06x head=0x%06lx\n", \
316 dev_priv->prim.tail, \ 315 dev_priv->prim.tail, \
317 MGA_READ( MGA_PRIMADDRESS ) - \ 316 MGA_READ( MGA_PRIMADDRESS ) - \
@@ -394,22 +393,22 @@ do { \
394#define MGA_VINTCLR (1 << 4) 393#define MGA_VINTCLR (1 << 4)
395#define MGA_VINTEN (1 << 5) 394#define MGA_VINTEN (1 << 5)
396 395
397#define MGA_ALPHACTRL 0x2c7c 396#define MGA_ALPHACTRL 0x2c7c
398#define MGA_AR0 0x1c60 397#define MGA_AR0 0x1c60
399#define MGA_AR1 0x1c64 398#define MGA_AR1 0x1c64
400#define MGA_AR2 0x1c68 399#define MGA_AR2 0x1c68
401#define MGA_AR3 0x1c6c 400#define MGA_AR3 0x1c6c
402#define MGA_AR4 0x1c70 401#define MGA_AR4 0x1c70
403#define MGA_AR5 0x1c74 402#define MGA_AR5 0x1c74
404#define MGA_AR6 0x1c78 403#define MGA_AR6 0x1c78
405 404
406#define MGA_CXBNDRY 0x1c80 405#define MGA_CXBNDRY 0x1c80
407#define MGA_CXLEFT 0x1ca0 406#define MGA_CXLEFT 0x1ca0
408#define MGA_CXRIGHT 0x1ca4 407#define MGA_CXRIGHT 0x1ca4
409 408
410#define MGA_DMAPAD 0x1c54 409#define MGA_DMAPAD 0x1c54
411#define MGA_DSTORG 0x2cb8 410#define MGA_DSTORG 0x2cb8
412#define MGA_DWGCTL 0x1c00 411#define MGA_DWGCTL 0x1c00
413# define MGA_OPCOD_MASK (15 << 0) 412# define MGA_OPCOD_MASK (15 << 0)
414# define MGA_OPCOD_TRAP (4 << 0) 413# define MGA_OPCOD_TRAP (4 << 0)
415# define MGA_OPCOD_TEXTURE_TRAP (6 << 0) 414# define MGA_OPCOD_TEXTURE_TRAP (6 << 0)
@@ -455,27 +454,27 @@ do { \
455# define MGA_CLIPDIS (1 << 31) 454# define MGA_CLIPDIS (1 << 31)
456#define MGA_DWGSYNC 0x2c4c 455#define MGA_DWGSYNC 0x2c4c
457 456
458#define MGA_FCOL 0x1c24 457#define MGA_FCOL 0x1c24
459#define MGA_FIFOSTATUS 0x1e10 458#define MGA_FIFOSTATUS 0x1e10
460#define MGA_FOGCOL 0x1cf4 459#define MGA_FOGCOL 0x1cf4
461#define MGA_FXBNDRY 0x1c84 460#define MGA_FXBNDRY 0x1c84
462#define MGA_FXLEFT 0x1ca8 461#define MGA_FXLEFT 0x1ca8
463#define MGA_FXRIGHT 0x1cac 462#define MGA_FXRIGHT 0x1cac
464 463
465#define MGA_ICLEAR 0x1e18 464#define MGA_ICLEAR 0x1e18
466# define MGA_SOFTRAPICLR (1 << 0) 465# define MGA_SOFTRAPICLR (1 << 0)
467# define MGA_VLINEICLR (1 << 5) 466# define MGA_VLINEICLR (1 << 5)
468#define MGA_IEN 0x1e1c 467#define MGA_IEN 0x1e1c
469# define MGA_SOFTRAPIEN (1 << 0) 468# define MGA_SOFTRAPIEN (1 << 0)
470# define MGA_VLINEIEN (1 << 5) 469# define MGA_VLINEIEN (1 << 5)
471 470
472#define MGA_LEN 0x1c5c 471#define MGA_LEN 0x1c5c
473 472
474#define MGA_MACCESS 0x1c04 473#define MGA_MACCESS 0x1c04
475 474
476#define MGA_PITCH 0x1c8c 475#define MGA_PITCH 0x1c8c
477#define MGA_PLNWT 0x1c1c 476#define MGA_PLNWT 0x1c1c
478#define MGA_PRIMADDRESS 0x1e58 477#define MGA_PRIMADDRESS 0x1e58
479# define MGA_DMA_GENERAL (0 << 0) 478# define MGA_DMA_GENERAL (0 << 0)
480# define MGA_DMA_BLIT (1 << 0) 479# define MGA_DMA_BLIT (1 << 0)
481# define MGA_DMA_VECTOR (2 << 0) 480# define MGA_DMA_VECTOR (2 << 0)
@@ -487,43 +486,43 @@ do { \
487# define MGA_PRIMPTREN0 (1 << 0) 486# define MGA_PRIMPTREN0 (1 << 0)
488# define MGA_PRIMPTREN1 (1 << 1) 487# define MGA_PRIMPTREN1 (1 << 1)
489 488
490#define MGA_RST 0x1e40 489#define MGA_RST 0x1e40
491# define MGA_SOFTRESET (1 << 0) 490# define MGA_SOFTRESET (1 << 0)
492# define MGA_SOFTEXTRST (1 << 1) 491# define MGA_SOFTEXTRST (1 << 1)
493 492
494#define MGA_SECADDRESS 0x2c40 493#define MGA_SECADDRESS 0x2c40
495#define MGA_SECEND 0x2c44 494#define MGA_SECEND 0x2c44
496#define MGA_SETUPADDRESS 0x2cd0 495#define MGA_SETUPADDRESS 0x2cd0
497#define MGA_SETUPEND 0x2cd4 496#define MGA_SETUPEND 0x2cd4
498#define MGA_SGN 0x1c58 497#define MGA_SGN 0x1c58
499#define MGA_SOFTRAP 0x2c48 498#define MGA_SOFTRAP 0x2c48
500#define MGA_SRCORG 0x2cb4 499#define MGA_SRCORG 0x2cb4
501# define MGA_SRMMAP_MASK (1 << 0) 500# define MGA_SRMMAP_MASK (1 << 0)
502# define MGA_SRCMAP_FB (0 << 0) 501# define MGA_SRCMAP_FB (0 << 0)
503# define MGA_SRCMAP_SYSMEM (1 << 0) 502# define MGA_SRCMAP_SYSMEM (1 << 0)
504# define MGA_SRCACC_MASK (1 << 1) 503# define MGA_SRCACC_MASK (1 << 1)
505# define MGA_SRCACC_PCI (0 << 1) 504# define MGA_SRCACC_PCI (0 << 1)
506# define MGA_SRCACC_AGP (1 << 1) 505# define MGA_SRCACC_AGP (1 << 1)
507#define MGA_STATUS 0x1e14 506#define MGA_STATUS 0x1e14
508# define MGA_SOFTRAPEN (1 << 0) 507# define MGA_SOFTRAPEN (1 << 0)
509# define MGA_VSYNCPEN (1 << 4) 508# define MGA_VSYNCPEN (1 << 4)
510# define MGA_VLINEPEN (1 << 5) 509# define MGA_VLINEPEN (1 << 5)
511# define MGA_DWGENGSTS (1 << 16) 510# define MGA_DWGENGSTS (1 << 16)
512# define MGA_ENDPRDMASTS (1 << 17) 511# define MGA_ENDPRDMASTS (1 << 17)
513#define MGA_STENCIL 0x2cc8 512#define MGA_STENCIL 0x2cc8
514#define MGA_STENCILCTL 0x2ccc 513#define MGA_STENCILCTL 0x2ccc
515 514
516#define MGA_TDUALSTAGE0 0x2cf8 515#define MGA_TDUALSTAGE0 0x2cf8
517#define MGA_TDUALSTAGE1 0x2cfc 516#define MGA_TDUALSTAGE1 0x2cfc
518#define MGA_TEXBORDERCOL 0x2c5c 517#define MGA_TEXBORDERCOL 0x2c5c
519#define MGA_TEXCTL 0x2c30 518#define MGA_TEXCTL 0x2c30
520#define MGA_TEXCTL2 0x2c3c 519#define MGA_TEXCTL2 0x2c3c
521# define MGA_DUALTEX (1 << 7) 520# define MGA_DUALTEX (1 << 7)
522# define MGA_G400_TC2_MAGIC (1 << 15) 521# define MGA_G400_TC2_MAGIC (1 << 15)
523# define MGA_MAP1_ENABLE (1 << 31) 522# define MGA_MAP1_ENABLE (1 << 31)
524#define MGA_TEXFILTER 0x2c58 523#define MGA_TEXFILTER 0x2c58
525#define MGA_TEXHEIGHT 0x2c2c 524#define MGA_TEXHEIGHT 0x2c2c
526#define MGA_TEXORG 0x2c24 525#define MGA_TEXORG 0x2c24
527# define MGA_TEXORGMAP_MASK (1 << 0) 526# define MGA_TEXORGMAP_MASK (1 << 0)
528# define MGA_TEXORGMAP_FB (0 << 0) 527# define MGA_TEXORGMAP_FB (0 << 0)
529# define MGA_TEXORGMAP_SYSMEM (1 << 0) 528# define MGA_TEXORGMAP_SYSMEM (1 << 0)
@@ -534,45 +533,45 @@ do { \
534#define MGA_TEXORG2 0x2ca8 533#define MGA_TEXORG2 0x2ca8
535#define MGA_TEXORG3 0x2cac 534#define MGA_TEXORG3 0x2cac
536#define MGA_TEXORG4 0x2cb0 535#define MGA_TEXORG4 0x2cb0
537#define MGA_TEXTRANS 0x2c34 536#define MGA_TEXTRANS 0x2c34
538#define MGA_TEXTRANSHIGH 0x2c38 537#define MGA_TEXTRANSHIGH 0x2c38
539#define MGA_TEXWIDTH 0x2c28 538#define MGA_TEXWIDTH 0x2c28
540 539
541#define MGA_WACCEPTSEQ 0x1dd4 540#define MGA_WACCEPTSEQ 0x1dd4
542#define MGA_WCODEADDR 0x1e6c 541#define MGA_WCODEADDR 0x1e6c
543#define MGA_WFLAG 0x1dc4 542#define MGA_WFLAG 0x1dc4
544#define MGA_WFLAG1 0x1de0 543#define MGA_WFLAG1 0x1de0
545#define MGA_WFLAGNB 0x1e64 544#define MGA_WFLAGNB 0x1e64
546#define MGA_WFLAGNB1 0x1e08 545#define MGA_WFLAGNB1 0x1e08
547#define MGA_WGETMSB 0x1dc8 546#define MGA_WGETMSB 0x1dc8
548#define MGA_WIADDR 0x1dc0 547#define MGA_WIADDR 0x1dc0
549#define MGA_WIADDR2 0x1dd8 548#define MGA_WIADDR2 0x1dd8
550# define MGA_WMODE_SUSPEND (0 << 0) 549# define MGA_WMODE_SUSPEND (0 << 0)
551# define MGA_WMODE_RESUME (1 << 0) 550# define MGA_WMODE_RESUME (1 << 0)
552# define MGA_WMODE_JUMP (2 << 0) 551# define MGA_WMODE_JUMP (2 << 0)
553# define MGA_WMODE_START (3 << 0) 552# define MGA_WMODE_START (3 << 0)
554# define MGA_WAGP_ENABLE (1 << 2) 553# define MGA_WAGP_ENABLE (1 << 2)
555#define MGA_WMISC 0x1e70 554#define MGA_WMISC 0x1e70
556# define MGA_WUCODECACHE_ENABLE (1 << 0) 555# define MGA_WUCODECACHE_ENABLE (1 << 0)
557# define MGA_WMASTER_ENABLE (1 << 1) 556# define MGA_WMASTER_ENABLE (1 << 1)
558# define MGA_WCACHEFLUSH_ENABLE (1 << 3) 557# define MGA_WCACHEFLUSH_ENABLE (1 << 3)
559#define MGA_WVRTXSZ 0x1dcc 558#define MGA_WVRTXSZ 0x1dcc
560 559
561#define MGA_YBOT 0x1c9c 560#define MGA_YBOT 0x1c9c
562#define MGA_YDST 0x1c90 561#define MGA_YDST 0x1c90
563#define MGA_YDSTLEN 0x1c88 562#define MGA_YDSTLEN 0x1c88
564#define MGA_YDSTORG 0x1c94 563#define MGA_YDSTORG 0x1c94
565#define MGA_YTOP 0x1c98 564#define MGA_YTOP 0x1c98
566 565
567#define MGA_ZORG 0x1c0c 566#define MGA_ZORG 0x1c0c
568 567
569/* This finishes the current batch of commands 568/* This finishes the current batch of commands
570 */ 569 */
571#define MGA_EXEC 0x0100 570#define MGA_EXEC 0x0100
572 571
573/* AGP PLL encoding (for G200 only). 572/* AGP PLL encoding (for G200 only).
574 */ 573 */
575#define MGA_AGP_PLL 0x1e4c 574#define MGA_AGP_PLL 0x1e4c
576# define MGA_AGP2XPLL_DISABLE (0 << 0) 575# define MGA_AGP2XPLL_DISABLE (0 << 0)
577# define MGA_AGP2XPLL_ENABLE (1 << 0) 576# define MGA_AGP2XPLL_ENABLE (1 << 0)
578 577