From a34025ce227e8755505b483b1a77c4cf5d7fece5 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 May 2008 08:56:11 -0400 Subject: Radeon IGP: clean up registers and magic numbers --- shared-core/radeon_drv.h | 95 +++++++++++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index e8fb00df..639a1398 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -448,13 +448,13 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_PCIE_DATA 0x0034 #define RADEON_PCIE_TX_GART_CNTL 0x10 # define RADEON_PCIE_TX_GART_EN (1 << 0) -# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0<<1) -# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO (1<<1) -# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD (3<<1) -# define RADEON_PCIE_TX_GART_MODE_32_128_CACHE (0<<3) -# define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE (1<<3) -# define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN (1<<5) -# define RADEON_PCIE_TX_GART_INVALIDATE_TLB (1<<8) +# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0 << 1) +# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO (1 << 1) +# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD (3 << 1) +# define RADEON_PCIE_TX_GART_MODE_32_128_CACHE (0 << 3) +# define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE (1 << 3) +# define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN (1 << 5) +# define RADEON_PCIE_TX_GART_INVALIDATE_TLB (1 << 8) #define RADEON_PCIE_TX_DISCARD_RD_ADDR_LO 0x11 #define RADEON_PCIE_TX_DISCARD_RD_ADDR_HI 0x12 #define RADEON_PCIE_TX_GART_BASE 0x13 @@ -463,14 +463,9 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_PCIE_TX_GART_END_LO 0x16 #define RADEON_PCIE_TX_GART_END_HI 0x17 -#define RADEON_IGPGART_INDEX 0x168 -#define RADEON_IGPGART_DATA 0x16c -#define RADEON_IGPGART_UNK_18 0x18 -#define RADEON_IGPGART_CTRL 0x2b -#define RADEON_IGPGART_BASE_ADDR 0x2c -#define RADEON_IGPGART_FLUSH 0x2e -#define RADEON_IGPGART_ENABLE 0x38 -#define RADEON_IGPGART_UNK_39 0x39 +#define RS400_NB_MC_INDEX 0x168 +# define RS400_NB_MC_IND_WR_EN (1 << 8) +#define RS400_NB_MC_DATA 0x16c #define RS690_MC_INDEX 0x78 # define RS690_MC_INDEX_MASK 0x1ff @@ -478,33 +473,55 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, # define RS690_MC_INDEX_WR_ACK 0x7f #define RS690_MC_DATA 0x7c -#define RS690_MC_MISC_CNTL 0x18 -#define RS690_MC_GART_FEATURE_ID 0x2b -#define RS690_MC_GART_BASE 0x2c -#define RS690_MC_GART_CACHE_CNTL 0x2e -# define RS690_MC_GART_CC_NO_CHANGE 0x0 -# define RS690_MC_GART_CC_CLEAR 0x1 -# define RS690_MC_GART_CLEAR_STATUS (1 << 1) +/* MC indirect registers */ +#define RS400_MC_MISC_CNTL 0x18 +# define RS400_DISABLE_GTW (1 << 1) +/* switch between MCIND GART and MM GART registers. 0 = mmgart, 1 = mcind gart */ +# define RS400_GART_INDEX_REG_EN (1 << 12) +# define RS690_BLOCK_GFX_D3_EN (1 << 14) +#define RS400_K8_FB_LOCATION 0x1e +#define RS400_GART_FEATURE_ID 0x2b +# define RS400_HANG_EN (1 << 11) +# define RS400_TLB_ENABLE (1 << 18) +# define RS400_P2P_ENABLE (1 << 19) +# define RS400_GTW_LAC_EN (1 << 25) +# define RS400_2LEVEL_GART (0 << 30) +# define RS400_1LEVEL_GART (1 << 30) +# define RS400_PDC_EN (1 << 31) +#define RS400_GART_BASE 0x2c +#define RS400_GART_CACHE_CNTRL 0x2e +# define RS400_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ +/* ??? */ +# define RS690_MC_GART_CLEAR_STATUS (1 << 1) # define RS690_MC_GART_CLEAR_DONE (0 << 1) # define RS690_MC_GART_CLEAR_PENDING (1 << 1) -#define RS690_MC_AGP_SIZE 0x38 -# define RS690_MC_GART_DIS 0x0 -# define RS690_MC_GART_EN 0x1 -# define RS690_MC_AGP_SIZE_32MB (0 << 1) -# define RS690_MC_AGP_SIZE_64MB (1 << 1) -# define RS690_MC_AGP_SIZE_128MB (2 << 1) -# define RS690_MC_AGP_SIZE_256MB (3 << 1) -# define RS690_MC_AGP_SIZE_512MB (4 << 1) -# define RS690_MC_AGP_SIZE_1GB (5 << 1) -# define RS690_MC_AGP_SIZE_2GB (6 << 1) -#define RS690_MC_AGP_MODE_CONTROL 0x39 +#define RS400_AGP_ADDRESS_SPACE_SIZE 0x38 +# define RS400_GART_EN (1 << 0) +# define RS400_VA_SIZE_32MB (0 << 1) +# define RS400_VA_SIZE_64MB (1 << 1) +# define RS400_VA_SIZE_128MB (2 << 1) +# define RS400_VA_SIZE_256MB (3 << 1) +# define RS400_VA_SIZE_512MB (4 << 1) +# define RS400_VA_SIZE_1GB (5 << 1) +# define RS400_VA_SIZE_2GB (6 << 1) +#define RS400_AGP_MODE_CNTL 0x39 +# define RS400_POST_GART_Q_SIZE (1 << 18) +# define RS400_NONGART_SNOOP (1 << 19) +# define RS400_AGP_RD_BUF_SIZE (1 << 20) +# define RS400_REQ_TYPE_SNOOP_SHIFT 22 +# define RS400_REQ_TYPE_SNOOP_MASK 0x3 +# define RS400_REQ_TYPE_SNOOP_DIS (1 << 24) +#define RS400_MC_MISC_UMA_CNTL 0x5f +#define RS400_MC_MCLK_CNTL 0x7a +#define RS400_MC_UMA_DUALCH_CNTL 0x86 + #define RS690_MC_FB_LOCATION 0x100 #define RS690_MC_AGP_LOCATION 0x101 #define RS690_MC_AGP_BASE 0x102 #define RS690_MC_AGP_BASE_2 0x103 #define R520_MC_IND_INDEX 0x70 -#define R520_MC_IND_WR_EN (1<<24) +#define R520_MC_IND_WR_EN (1 << 24) #define R520_MC_IND_DATA 0x74 #define RV515_MC_FB_LOCATION 0x01 @@ -516,6 +533,8 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_MPP_TB_CONFIG 0x01c0 #define RADEON_MEM_CNTL 0x0140 #define RADEON_MEM_SDRAM_MODE_REG 0x0158 +#define RADEON_AGP_BASE_2 0x015c +#define RS400_AGP_BASE_2 0x0164 #define RADEON_AGP_BASE 0x0170 #define RADEON_RB3D_COLOROFFSET 0x1c40 @@ -1128,10 +1147,10 @@ do { \ #define RADEON_WRITE_IGPGART( addr, val ) \ do { \ - RADEON_WRITE( RADEON_IGPGART_INDEX, \ - ((addr) & 0x7f) | (1 << 8)); \ - RADEON_WRITE( RADEON_IGPGART_DATA, (val) ); \ - RADEON_WRITE( RADEON_IGPGART_INDEX, 0x7f ); \ + RADEON_WRITE( RS400_NB_MC_INDEX, \ + ((addr) & 0x7f) | RS400_NB_MC_IND_WR_EN); \ + RADEON_WRITE( RS400_NB_MC_DATA, (val) ); \ + RADEON_WRITE( RS400_NB_MC_INDEX, 0x7f ); \ } while (0) #define RADEON_WRITE_PCIE( addr, val ) \ -- cgit v1.2.3 From 68b7f550ba140d275c6f9bb26c2186069354be24 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 May 2008 09:00:40 -0400 Subject: Radeon IGP: wrap MCIND access first step in merging rs4xx/rs6xx gart setup --- shared-core/radeon_drv.h | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 639a1398..452583ef 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -1145,14 +1145,6 @@ do { \ RADEON_WRITE( RADEON_CLOCK_CNTL_DATA, (val) ); \ } while (0) -#define RADEON_WRITE_IGPGART( addr, val ) \ -do { \ - RADEON_WRITE( RS400_NB_MC_INDEX, \ - ((addr) & 0x7f) | RS400_NB_MC_IND_WR_EN); \ - RADEON_WRITE( RS400_NB_MC_DATA, (val) ); \ - RADEON_WRITE( RS400_NB_MC_INDEX, 0x7f ); \ -} while (0) - #define RADEON_WRITE_PCIE( addr, val ) \ do { \ RADEON_WRITE8( RADEON_PCIE_INDEX, \ @@ -1160,12 +1152,20 @@ do { \ RADEON_WRITE( RADEON_PCIE_DATA, (val) ); \ } while (0) -#define RADEON_WRITE_MCIND( addr, val ) \ - do { \ - RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ - RADEON_WRITE(R520_MC_IND_DATA, (val)); \ - RADEON_WRITE(R520_MC_IND_INDEX, 0); \ - } while (0) +#define R500_WRITE_MCIND( addr, val ) \ +do { \ + RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ + RADEON_WRITE(R520_MC_IND_DATA, (val)); \ + RADEON_WRITE(R520_MC_IND_INDEX, 0); \ +} while (0) + +#define RS400_WRITE_MCIND( addr, val ) \ +do { \ + RADEON_WRITE( RS400_NB_MC_INDEX, \ + ((addr) & 0x7f) | RS400_NB_MC_IND_WR_EN); \ + RADEON_WRITE( RS400_NB_MC_DATA, (val) ); \ + RADEON_WRITE( RS400_NB_MC_INDEX, 0x7f ); \ +} while (0) #define RS690_WRITE_MCIND( addr, val ) \ do { \ @@ -1174,6 +1174,14 @@ do { \ RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); \ } while (0) +#define IGP_WRITE_MCIND( addr, val ) \ +do { \ + if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) \ + RS690_WRITE_MCIND( addr, val ); \ + else \ + RS400_WRITE_MCIND( addr, val ); \ +} while (0) + #define CP_PACKET0( reg, n ) \ (RADEON_CP_PACKET0 | ((n) << 16) | ((reg) >> 2)) #define CP_PACKET0_TABLE( reg, n ) \ -- cgit v1.2.3 From fb9eaff74712b7b29a7e76209d803fec21c0318c Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 May 2008 09:13:44 -0400 Subject: Radeon IGP: merge RS4xx/RS6xx gart setup --- shared-core/radeon_drv.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 452583ef..2090cdfc 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -491,10 +491,6 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RS400_GART_BASE 0x2c #define RS400_GART_CACHE_CNTRL 0x2e # define RS400_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ -/* ??? */ -# define RS690_MC_GART_CLEAR_STATUS (1 << 1) -# define RS690_MC_GART_CLEAR_DONE (0 << 1) -# define RS690_MC_GART_CLEAR_PENDING (1 << 1) #define RS400_AGP_ADDRESS_SPACE_SIZE 0x38 # define RS400_GART_EN (1 << 0) # define RS400_VA_SIZE_32MB (0 << 1) @@ -533,7 +529,7 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_MPP_TB_CONFIG 0x01c0 #define RADEON_MEM_CNTL 0x0140 #define RADEON_MEM_SDRAM_MODE_REG 0x0158 -#define RADEON_AGP_BASE_2 0x015c +#define RADEON_AGP_BASE_2 0x015c /* r200+ only */ #define RS400_AGP_BASE_2 0x0164 #define RADEON_AGP_BASE 0x0170 -- cgit v1.2.3 From c307e50724c8d0d88b9ac1788de02b8478261967 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 May 2008 09:18:28 -0400 Subject: R300+: fixup PURGE/FLUSH macros --- shared-core/radeon_drv.h | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 2090cdfc..e580e5c1 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -669,11 +669,18 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, # define RADEON_RB3D_ZC_FREE (1 << 2) # define RADEON_RB3D_ZC_FLUSH_ALL 0x5 # define RADEON_RB3D_ZC_BUSY (1 << 31) +#define R300_ZB_ZCACHE_CTLSTAT 0x4f18 +# define R300_ZC_FLUSH (1 << 0) +# define R300_ZC_FREE (1 << 1) +# define R300_ZC_FLUSH_ALL 0x3 +# define R300_ZC_BUSY (1 << 31) #define RADEON_RB3D_DSTCACHE_CTLSTAT 0x325c # define RADEON_RB3D_DC_FLUSH (3 << 0) # define RADEON_RB3D_DC_FREE (3 << 2) # define RADEON_RB3D_DC_FLUSH_ALL 0xf # define RADEON_RB3D_DC_BUSY (1 << 31) +#define R300_RB3D_DSTCACHE_CTLSTAT 0x4e4c +# define R300_RB3D_DC_FINISH (1 << 4) #define RADEON_RB3D_ZSTENCILCNTL 0x1c2c # define RADEON_Z_TEST_MASK (7 << 4) # define RADEON_Z_TEST_ALWAYS (7 << 4) @@ -1218,23 +1225,43 @@ do { \ } while (0) #define RADEON_FLUSH_CACHE() do { \ - OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ - OUT_RING( RADEON_RB3D_DC_FLUSH ); \ + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ + OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( RADEON_RB3D_DC_FLUSH ); \ + } else { \ + OUT_RING( CP_PACKET0( R300_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( RADEON_RB3D_DC_FLUSH ); \ + } \ } while (0) #define RADEON_PURGE_CACHE() do { \ - OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ - OUT_RING( RADEON_RB3D_DC_FLUSH_ALL ); \ + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ + OUT_RING( CP_PACKET0( RADEON_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( RADEON_RB3D_DC_FLUSH_ALL ); \ + } else { \ + OUT_RING( CP_PACKET0( R300_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( RADEON_RB3D_DC_FLUSH_ALL ); \ + } \ } while (0) #define RADEON_FLUSH_ZCACHE() do { \ - OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \ - OUT_RING( RADEON_RB3D_ZC_FLUSH ); \ + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ + OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( RADEON_RB3D_ZC_FLUSH ); \ + } else { \ + OUT_RING( CP_PACKET0( R300_ZB_ZCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( R300_ZC_FLUSH ); \ + } \ } while (0) #define RADEON_PURGE_ZCACHE() do { \ - OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \ - OUT_RING( RADEON_RB3D_ZC_FLUSH_ALL ); \ + if ((dev_priv->flags & RADEON_FAMILY_MASK) <= CHIP_RV280) { \ + OUT_RING( CP_PACKET0( RADEON_RB3D_ZCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( RADEON_RB3D_ZC_FLUSH_ALL ); \ + } else { \ + OUT_RING( CP_PACKET0( R300_RB3D_DSTCACHE_CTLSTAT, 0 ) ); \ + OUT_RING( R300_ZC_FLUSH_ALL ); \ + } \ } while (0) /* ================================================================ -- cgit v1.2.3 From 3582e82f140cdae947864af8403674e6e117588e Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 May 2008 09:24:13 -0400 Subject: RS4xx: fix MCIND index mask --- shared-core/radeon_drv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index e580e5c1..d5c8fc3e 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -1165,9 +1165,9 @@ do { \ #define RS400_WRITE_MCIND( addr, val ) \ do { \ RADEON_WRITE( RS400_NB_MC_INDEX, \ - ((addr) & 0x7f) | RS400_NB_MC_IND_WR_EN); \ + ((addr) & 0xff) | RS400_NB_MC_IND_WR_EN); \ RADEON_WRITE( RS400_NB_MC_DATA, (val) ); \ - RADEON_WRITE( RS400_NB_MC_INDEX, 0x7f ); \ + RADEON_WRITE( RS400_NB_MC_INDEX, 0xff ); \ } while (0) #define RS690_WRITE_MCIND( addr, val ) \ -- cgit v1.2.3 From 75bc739bee366b8e0520c61c9b9cc10b94524525 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 12 May 2008 09:44:20 -0400 Subject: R3/4/5: init pipe setup in drm Similar (broken) code in mesa needs to be removed --- shared-core/radeon_drv.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index d5c8fc3e..efe702a7 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -533,6 +533,27 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RS400_AGP_BASE_2 0x0164 #define RADEON_AGP_BASE 0x0170 +/* pipe config regs */ +#define R400_GB_PIPE_SELECT 0x402c +#define R500_DYN_SCLK_PWMEM_PIPE 0x000d /* PLL */ +#define R500_SU_REG_DEST 0x42c8 +#define R300_GB_TILE_CONFIG 0x4018 +# define R300_ENABLE_TILING (1 << 0) +# define R300_PIPE_COUNT_RV350 (0 << 1) +# define R300_PIPE_COUNT_R300 (3 << 1) +# define R300_PIPE_COUNT_R420_3P (6 << 1) +# define R300_PIPE_COUNT_R420 (7 << 1) +# define R300_TILE_SIZE_8 (0 << 4) +# define R300_TILE_SIZE_16 (1 << 4) +# define R300_TILE_SIZE_32 (2 << 4) +# define R300_SUBPIXEL_1_12 (0 << 16) +# define R300_SUBPIXEL_1_16 (1 << 16) +#define R300_DST_PIPE_CONFIG 0x170c +# define R300_PIPE_AUTO_CONFIG (1 << 31) +#define R300_RB2D_DSTCACHE_MODE 0x3428 +# define R300_DC_AUTOFLUSH_ENABLE (1 << 8) +# define R300_DC_DC_DISABLE_IGNORE_PE (1 << 17) + #define RADEON_RB3D_COLOROFFSET 0x1c40 #define RADEON_RB3D_COLORPITCH 0x1c48 -- cgit v1.2.3 From caace3692f3121dcc18fa5e9260ffe1a4abbb943 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 13 May 2008 21:02:17 -0400 Subject: RS4xx: separate out RS400 and RS480 IGP chips RS400 (intel based IGP) and RS480 (AMD based IGP) have different MC and GART setups. Currently we only support RS480. --- shared-core/radeon_drv.h | 90 ++++++++++++++++++++++++------------------------ 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index efe702a7..c5a84439 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -123,7 +123,7 @@ enum radeon_family { CHIP_RV380, CHIP_R420, CHIP_RV410, - CHIP_RS400, + CHIP_RS480, CHIP_RS690, CHIP_RV515, CHIP_R520, @@ -463,9 +463,9 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_PCIE_TX_GART_END_LO 0x16 #define RADEON_PCIE_TX_GART_END_HI 0x17 -#define RS400_NB_MC_INDEX 0x168 -# define RS400_NB_MC_IND_WR_EN (1 << 8) -#define RS400_NB_MC_DATA 0x16c +#define RS480_NB_MC_INDEX 0x168 +# define RS480_NB_MC_IND_WR_EN (1 << 8) +#define RS480_NB_MC_DATA 0x16c #define RS690_MC_INDEX 0x78 # define RS690_MC_INDEX_MASK 0x1ff @@ -474,42 +474,42 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RS690_MC_DATA 0x7c /* MC indirect registers */ -#define RS400_MC_MISC_CNTL 0x18 -# define RS400_DISABLE_GTW (1 << 1) +#define RS480_MC_MISC_CNTL 0x18 +# define RS480_DISABLE_GTW (1 << 1) /* switch between MCIND GART and MM GART registers. 0 = mmgart, 1 = mcind gart */ -# define RS400_GART_INDEX_REG_EN (1 << 12) +# define RS480_GART_INDEX_REG_EN (1 << 12) # define RS690_BLOCK_GFX_D3_EN (1 << 14) -#define RS400_K8_FB_LOCATION 0x1e -#define RS400_GART_FEATURE_ID 0x2b -# define RS400_HANG_EN (1 << 11) -# define RS400_TLB_ENABLE (1 << 18) -# define RS400_P2P_ENABLE (1 << 19) -# define RS400_GTW_LAC_EN (1 << 25) -# define RS400_2LEVEL_GART (0 << 30) -# define RS400_1LEVEL_GART (1 << 30) -# define RS400_PDC_EN (1 << 31) -#define RS400_GART_BASE 0x2c -#define RS400_GART_CACHE_CNTRL 0x2e -# define RS400_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ -#define RS400_AGP_ADDRESS_SPACE_SIZE 0x38 -# define RS400_GART_EN (1 << 0) -# define RS400_VA_SIZE_32MB (0 << 1) -# define RS400_VA_SIZE_64MB (1 << 1) -# define RS400_VA_SIZE_128MB (2 << 1) -# define RS400_VA_SIZE_256MB (3 << 1) -# define RS400_VA_SIZE_512MB (4 << 1) -# define RS400_VA_SIZE_1GB (5 << 1) -# define RS400_VA_SIZE_2GB (6 << 1) -#define RS400_AGP_MODE_CNTL 0x39 -# define RS400_POST_GART_Q_SIZE (1 << 18) -# define RS400_NONGART_SNOOP (1 << 19) -# define RS400_AGP_RD_BUF_SIZE (1 << 20) -# define RS400_REQ_TYPE_SNOOP_SHIFT 22 -# define RS400_REQ_TYPE_SNOOP_MASK 0x3 -# define RS400_REQ_TYPE_SNOOP_DIS (1 << 24) -#define RS400_MC_MISC_UMA_CNTL 0x5f -#define RS400_MC_MCLK_CNTL 0x7a -#define RS400_MC_UMA_DUALCH_CNTL 0x86 +#define RS480_K8_FB_LOCATION 0x1e +#define RS480_GART_FEATURE_ID 0x2b +# define RS480_HANG_EN (1 << 11) +# define RS480_TLB_ENABLE (1 << 18) +# define RS480_P2P_ENABLE (1 << 19) +# define RS480_GTW_LAC_EN (1 << 25) +# define RS480_2LEVEL_GART (0 << 30) +# define RS480_1LEVEL_GART (1 << 30) +# define RS480_PDC_EN (1 << 31) +#define RS480_GART_BASE 0x2c +#define RS480_GART_CACHE_CNTRL 0x2e +# define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ +#define RS480_AGP_ADDRESS_SPACE_SIZE 0x38 +# define RS480_GART_EN (1 << 0) +# define RS480_VA_SIZE_32MB (0 << 1) +# define RS480_VA_SIZE_64MB (1 << 1) +# define RS480_VA_SIZE_128MB (2 << 1) +# define RS480_VA_SIZE_256MB (3 << 1) +# define RS480_VA_SIZE_512MB (4 << 1) +# define RS480_VA_SIZE_1GB (5 << 1) +# define RS480_VA_SIZE_2GB (6 << 1) +#define RS480_AGP_MODE_CNTL 0x39 +# define RS480_POST_GART_Q_SIZE (1 << 18) +# define RS480_NONGART_SNOOP (1 << 19) +# define RS480_AGP_RD_BUF_SIZE (1 << 20) +# define RS480_REQ_TYPE_SNOOP_SHIFT 22 +# define RS480_REQ_TYPE_SNOOP_MASK 0x3 +# define RS480_REQ_TYPE_SNOOP_DIS (1 << 24) +#define RS480_MC_MISC_UMA_CNTL 0x5f +#define RS480_MC_MCLK_CNTL 0x7a +#define RS480_MC_UMA_DUALCH_CNTL 0x86 #define RS690_MC_FB_LOCATION 0x100 #define RS690_MC_AGP_LOCATION 0x101 @@ -530,7 +530,7 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_MEM_CNTL 0x0140 #define RADEON_MEM_SDRAM_MODE_REG 0x0158 #define RADEON_AGP_BASE_2 0x015c /* r200+ only */ -#define RS400_AGP_BASE_2 0x0164 +#define RS480_AGP_BASE_2 0x0164 #define RADEON_AGP_BASE 0x0170 /* pipe config regs */ @@ -1183,12 +1183,12 @@ do { \ RADEON_WRITE(R520_MC_IND_INDEX, 0); \ } while (0) -#define RS400_WRITE_MCIND( addr, val ) \ +#define RS480_WRITE_MCIND( addr, val ) \ do { \ - RADEON_WRITE( RS400_NB_MC_INDEX, \ - ((addr) & 0xff) | RS400_NB_MC_IND_WR_EN); \ - RADEON_WRITE( RS400_NB_MC_DATA, (val) ); \ - RADEON_WRITE( RS400_NB_MC_INDEX, 0xff ); \ + RADEON_WRITE( RS480_NB_MC_INDEX, \ + ((addr) & 0xff) | RS480_NB_MC_IND_WR_EN); \ + RADEON_WRITE( RS480_NB_MC_DATA, (val) ); \ + RADEON_WRITE( RS480_NB_MC_INDEX, 0xff ); \ } while (0) #define RS690_WRITE_MCIND( addr, val ) \ @@ -1203,7 +1203,7 @@ do { \ if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) \ RS690_WRITE_MCIND( addr, val ); \ else \ - RS400_WRITE_MCIND( addr, val ); \ + RS480_WRITE_MCIND( addr, val ); \ } while (0) #define CP_PACKET0( reg, n ) \ -- cgit v1.2.3 From 91c6c4b2403caca80273e8010e9ced74cf900be3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 21 May 2008 20:14:45 +1000 Subject: rs690/r500: vblank support. The new display controller has the vblank interrupts in a different place. Add support for vbl interrupts for these chips --- shared-core/radeon_drv.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index c5a84439..4f04f30f 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -296,6 +296,7 @@ typedef struct drm_radeon_private { int vblank_crtc; uint32_t irq_enable_reg; int irq_enabled; + uint32_t r500_disp_irq_reg; struct radeon_surface surfaces[RADEON_MAX_SURFACES]; struct radeon_virt_surface virt_surfaces[2 * RADEON_MAX_SURFACES]; @@ -620,6 +621,8 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, # define RADEON_SW_INT_TEST (1 << 25) # define RADEON_SW_INT_TEST_ACK (1 << 25) # define RADEON_SW_INT_FIRE (1 << 26) +# define R500_DISPLAY_INT_STATUS (1 << 0) + #define RADEON_HOST_PATH_CNTL 0x0130 # define RADEON_HDP_SOFT_RESET (1 << 26) @@ -1139,7 +1142,30 @@ extern int r300_do_cp_cmdbuf(struct drm_device *dev, #define RADEON_VHA_BACKFRAME0_OFF_V_2 0x1894 #define RADEON_VHA_BACKFRAME1_OFF_PITCH_V_2 0x1898 +#define R500_D1CRTC_STATUS 0x609c +#define R500_D2CRTC_STATUS 0x689c +#define R500_CRTC_V_BLANK (1<<0) + +#define R500_D1CRTC_FRAME_COUNT 0x60a4 +#define R500_D2CRTC_FRAME_COUNT 0x68a4 + +#define R500_D1MODE_V_COUNTER 0x6530 +#define R500_D2MODE_V_COUNTER 0x6d30 + +#define R500_D1MODE_VBLANK_STATUS 0x6534 +#define R500_D2MODE_VBLANK_STATUS 0x6d34 +#define R500_VBLANK_OCCURED (1<<0) +#define R500_VBLANK_ACK (1<<4) +#define R500_VBLANK_STAT (1<<12) +#define R500_VBLANK_INT (1<<16) + +#define R500_DxMODE_INT_MASK 0x6540 +#define R500_D1MODE_INT_MASK (1<<0) +#define R500_D2MODE_INT_MASK (1<<8) +#define R500_DISP_INTERRUPT_STATUS 0x7edc +#define R500_D1_VBLANK_INTERRUPT (1 << 4) +#define R500_D2_VBLANK_INTERRUPT (1 << 5) /* Constants */ #define RADEON_MAX_USEC_TIMEOUT 100000 /* 100 ms */ -- cgit v1.2.3 From 8cd045079e21093437b99cb150b97403e945d2c2 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Fri, 23 May 2008 14:36:05 -0400 Subject: [FreeBSD] Add vblank-rework support and get drivers building. The i915 driver now works again. --- shared-core/radeon_drv.h | 1 - 1 file changed, 1 deletion(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index 4f04f30f..c478f542 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -380,7 +380,6 @@ extern void radeon_do_release(struct drm_device * dev); extern u32 radeon_get_vblank_counter(struct drm_device *dev, int crtc); extern int radeon_enable_vblank(struct drm_device *dev, int crtc); extern void radeon_disable_vblank(struct drm_device *dev, int crtc); -extern void radeon_do_release(struct drm_device * dev); extern irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS); extern void radeon_driver_irq_preinstall(struct drm_device * dev); extern int radeon_driver_irq_postinstall(struct drm_device * dev); -- cgit v1.2.3 From 59c953245c583bb1062d3a8409a9b615a3a19654 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 27 May 2008 18:33:33 -0400 Subject: RADEON: add get_param for number of GB pipes --- shared-core/radeon_drv.h | 1 + 1 file changed, 1 insertion(+) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index c478f542..d4a298e4 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -314,6 +314,7 @@ typedef struct drm_radeon_private { uint32_t flags; /* see radeon_chip_flags */ unsigned long fb_aper_offset; + int num_gb_pipes; } drm_radeon_private_t; typedef struct drm_radeon_buf_priv { -- cgit v1.2.3 From c06096d34fa4afb3f24d610ccfb385f92dbc1e83 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 28 May 2008 10:02:20 +1000 Subject: radeon: bump release date/version for r500 3D support --- shared-core/radeon_drv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'shared-core/radeon_drv.h') diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index d4a298e4..1b32b2f4 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -38,7 +38,7 @@ #define DRIVER_NAME "radeon" #define DRIVER_DESC "ATI Radeon" -#define DRIVER_DATE "20060524" +#define DRIVER_DATE "20080528" /* Interface history: * @@ -98,10 +98,11 @@ * 1.26- Add support for variable size PCI(E) gart aperture * 1.27- Add support for IGP GART * 1.28- Add support for VBL on CRTC2 + * 1.29- R500 3D cmd buffer support */ #define DRIVER_MAJOR 1 -#define DRIVER_MINOR 28 +#define DRIVER_MINOR 29 #define DRIVER_PATCHLEVEL 0 /* -- cgit v1.2.3