diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-02-19 16:22:31 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-02-22 18:46:23 -0500 |
commit | d03f5d5971f2dd4bd259c46e065299661d8fdc9f (patch) | |
tree | dd4164b08a02261e7360a6b0c1bf1177dc92bb80 /drivers/gpu/drm/radeon/r600.c | |
parent | 6271901d828b34b27607314026deaf417f9f9b75 (diff) |
drm/radeon: fixes for r6xx/r7xx gfx init
- updated swizzle modes for backend map setup
- fix programming of a few gfx regs
- properly handle pipe/backend setup on LE cards
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 694a4c564f52..b3c7e0f87b91 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -980,6 +980,9 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
980 | { | 980 | { |
981 | u32 tiling_config; | 981 | u32 tiling_config; |
982 | u32 ramcfg; | 982 | u32 ramcfg; |
983 | u32 backend_map; | ||
984 | u32 cc_rb_backend_disable; | ||
985 | u32 cc_gc_shader_pipe_config; | ||
983 | u32 tmp; | 986 | u32 tmp; |
984 | int i, j; | 987 | int i, j; |
985 | u32 sq_config; | 988 | u32 sq_config; |
@@ -1076,23 +1079,20 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
1076 | switch (rdev->config.r600.max_tile_pipes) { | 1079 | switch (rdev->config.r600.max_tile_pipes) { |
1077 | case 1: | 1080 | case 1: |
1078 | tiling_config |= PIPE_TILING(0); | 1081 | tiling_config |= PIPE_TILING(0); |
1079 | rdev->config.r600.tiling_npipes = 1; | ||
1080 | break; | 1082 | break; |
1081 | case 2: | 1083 | case 2: |
1082 | tiling_config |= PIPE_TILING(1); | 1084 | tiling_config |= PIPE_TILING(1); |
1083 | rdev->config.r600.tiling_npipes = 2; | ||
1084 | break; | 1085 | break; |
1085 | case 4: | 1086 | case 4: |
1086 | tiling_config |= PIPE_TILING(2); | 1087 | tiling_config |= PIPE_TILING(2); |
1087 | rdev->config.r600.tiling_npipes = 4; | ||
1088 | break; | 1088 | break; |
1089 | case 8: | 1089 | case 8: |
1090 | tiling_config |= PIPE_TILING(3); | 1090 | tiling_config |= PIPE_TILING(3); |
1091 | rdev->config.r600.tiling_npipes = 8; | ||
1092 | break; | 1091 | break; |
1093 | default: | 1092 | default: |
1094 | break; | 1093 | break; |
1095 | } | 1094 | } |
1095 | rdev->config.r600.tiling_npipes = rdev->config.r600.max_tile_pipes; | ||
1096 | rdev->config.r600.tiling_nbanks = 4 << ((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT); | 1096 | rdev->config.r600.tiling_nbanks = 4 << ((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT); |
1097 | tiling_config |= BANK_TILING((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT); | 1097 | tiling_config |= BANK_TILING((ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT); |
1098 | tiling_config |= GROUP_SIZE(0); | 1098 | tiling_config |= GROUP_SIZE(0); |
@@ -1106,24 +1106,33 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
1106 | tiling_config |= SAMPLE_SPLIT(tmp); | 1106 | tiling_config |= SAMPLE_SPLIT(tmp); |
1107 | } | 1107 | } |
1108 | tiling_config |= BANK_SWAPS(1); | 1108 | tiling_config |= BANK_SWAPS(1); |
1109 | tmp = r600_get_tile_pipe_to_backend_map(rdev->config.r600.max_tile_pipes, | 1109 | |
1110 | rdev->config.r600.max_backends, | 1110 | cc_rb_backend_disable = RREG32(CC_RB_BACKEND_DISABLE) & 0x00ff0000; |
1111 | (0xff << rdev->config.r600.max_backends) & 0xff); | 1111 | cc_rb_backend_disable |= |
1112 | tiling_config |= BACKEND_MAP(tmp); | 1112 | BACKEND_DISABLE((R6XX_MAX_BACKENDS_MASK << rdev->config.r600.max_backends) & R6XX_MAX_BACKENDS_MASK); |
1113 | |||
1114 | cc_gc_shader_pipe_config = RREG32(CC_GC_SHADER_PIPE_CONFIG) & 0xffffff00; | ||
1115 | cc_gc_shader_pipe_config |= | ||
1116 | INACTIVE_QD_PIPES((R6XX_MAX_PIPES_MASK << rdev->config.r600.max_pipes) & R6XX_MAX_PIPES_MASK); | ||
1117 | cc_gc_shader_pipe_config |= | ||
1118 | INACTIVE_SIMDS((R6XX_MAX_SIMDS_MASK << rdev->config.r600.max_simds) & R6XX_MAX_SIMDS_MASK); | ||
1119 | |||
1120 | backend_map = r600_get_tile_pipe_to_backend_map(rdev->config.r600.max_tile_pipes, | ||
1121 | (R6XX_MAX_BACKENDS - | ||
1122 | r600_count_pipe_bits((cc_rb_backend_disable & | ||
1123 | R6XX_MAX_BACKENDS_MASK) >> 16)), | ||
1124 | (cc_rb_backend_disable >> 16)); | ||
1125 | |||
1126 | tiling_config |= BACKEND_MAP(backend_map); | ||
1113 | WREG32(GB_TILING_CONFIG, tiling_config); | 1127 | WREG32(GB_TILING_CONFIG, tiling_config); |
1114 | WREG32(DCP_TILING_CONFIG, tiling_config & 0xffff); | 1128 | WREG32(DCP_TILING_CONFIG, tiling_config & 0xffff); |
1115 | WREG32(HDP_TILING_CONFIG, tiling_config & 0xffff); | 1129 | WREG32(HDP_TILING_CONFIG, tiling_config & 0xffff); |
1116 | 1130 | ||
1117 | tmp = BACKEND_DISABLE((R6XX_MAX_BACKENDS_MASK << rdev->config.r600.max_backends) & R6XX_MAX_BACKENDS_MASK); | ||
1118 | WREG32(CC_RB_BACKEND_DISABLE, tmp); | ||
1119 | |||
1120 | /* Setup pipes */ | 1131 | /* Setup pipes */ |
1121 | tmp = INACTIVE_QD_PIPES((R6XX_MAX_PIPES_MASK << rdev->config.r600.max_pipes) & R6XX_MAX_PIPES_MASK); | 1132 | WREG32(CC_RB_BACKEND_DISABLE, cc_rb_backend_disable); |
1122 | tmp |= INACTIVE_SIMDS((R6XX_MAX_SIMDS_MASK << rdev->config.r600.max_simds) & R6XX_MAX_SIMDS_MASK); | 1133 | WREG32(CC_GC_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config); |
1123 | WREG32(CC_GC_SHADER_PIPE_CONFIG, tmp); | ||
1124 | WREG32(GC_USER_SHADER_PIPE_CONFIG, tmp); | ||
1125 | 1134 | ||
1126 | tmp = R6XX_MAX_BACKENDS - r600_count_pipe_bits(tmp & INACTIVE_QD_PIPES_MASK); | 1135 | tmp = R6XX_MAX_PIPES - r600_count_pipe_bits((cc_gc_shader_pipe_config & INACTIVE_QD_PIPES_MASK) >> 8); |
1127 | WREG32(VGT_OUT_DEALLOC_CNTL, (tmp * 4) & DEALLOC_DIST_MASK); | 1136 | WREG32(VGT_OUT_DEALLOC_CNTL, (tmp * 4) & DEALLOC_DIST_MASK); |
1128 | WREG32(VGT_VERTEX_REUSE_BLOCK_CNTL, ((tmp * 4) - 2) & VTX_REUSE_DEPTH_MASK); | 1137 | WREG32(VGT_VERTEX_REUSE_BLOCK_CNTL, ((tmp * 4) - 2) & VTX_REUSE_DEPTH_MASK); |
1129 | 1138 | ||