aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv515.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-03-31 00:33:27 -0400
committerDave Airlie <airlied@redhat.com>2010-03-31 00:54:47 -0400
commitf46c01208da1881591e3f55ca77d37f54469f8e4 (patch)
tree39b9169c70da504b80440b85b5ef2ffa4394d25f /drivers/gpu/drm/radeon/rv515.c
parent3b01a1191fe76bd11e5743eceed7c25d8157239e (diff)
drm/radeon/kms: display watermark updates (v2)
- Add module option to force the display priority 0 = auto, 1 = normal, 2 = high - Default to high on r3xx/r4xx/rv515 chips Fixes flickering problems during heavy acceleration due to underflow to the display controllers - Fill in minimal support for RS600 v2 - update display priority when bandwidth is updated so the user can change the parameter at runtime and it will take affect on the next modeset. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rv515.c')
-rw-r--r--drivers/gpu/drm/radeon/rv515.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index d94291add6db..1cf233f7e516 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -1016,7 +1016,7 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
1016 struct drm_display_mode *mode1 = NULL; 1016 struct drm_display_mode *mode1 = NULL;
1017 struct rv515_watermark wm0; 1017 struct rv515_watermark wm0;
1018 struct rv515_watermark wm1; 1018 struct rv515_watermark wm1;
1019 u32 tmp; 1019 u32 tmp, d1mode_priority_a_cnt, d2mode_priority_a_cnt;
1020 fixed20_12 priority_mark02, priority_mark12, fill_rate; 1020 fixed20_12 priority_mark02, priority_mark12, fill_rate;
1021 fixed20_12 a, b; 1021 fixed20_12 a, b;
1022 1022
@@ -1084,10 +1084,16 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
1084 priority_mark12.full = 0; 1084 priority_mark12.full = 0;
1085 if (wm1.priority_mark_max.full > priority_mark12.full) 1085 if (wm1.priority_mark_max.full > priority_mark12.full)
1086 priority_mark12.full = wm1.priority_mark_max.full; 1086 priority_mark12.full = wm1.priority_mark_max.full;
1087 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02)); 1087 d1mode_priority_a_cnt = rfixed_trunc(priority_mark02);
1088 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02)); 1088 d2mode_priority_a_cnt = rfixed_trunc(priority_mark12);
1089 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12)); 1089 if (rdev->disp_priority == 2) {
1090 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12)); 1090 d1mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
1091 d2mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
1092 }
1093 WREG32(D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
1094 WREG32(D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
1095 WREG32(D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
1096 WREG32(D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
1091 } else if (mode0) { 1097 } else if (mode0) {
1092 if (rfixed_trunc(wm0.dbpp) > 64) 1098 if (rfixed_trunc(wm0.dbpp) > 64)
1093 a.full = rfixed_div(wm0.dbpp, wm0.num_line_pair); 1099 a.full = rfixed_div(wm0.dbpp, wm0.num_line_pair);
@@ -1114,8 +1120,11 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
1114 priority_mark02.full = 0; 1120 priority_mark02.full = 0;
1115 if (wm0.priority_mark_max.full > priority_mark02.full) 1121 if (wm0.priority_mark_max.full > priority_mark02.full)
1116 priority_mark02.full = wm0.priority_mark_max.full; 1122 priority_mark02.full = wm0.priority_mark_max.full;
1117 WREG32(D1MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark02)); 1123 d1mode_priority_a_cnt = rfixed_trunc(priority_mark02);
1118 WREG32(D1MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark02)); 1124 if (rdev->disp_priority == 2)
1125 d1mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
1126 WREG32(D1MODE_PRIORITY_A_CNT, d1mode_priority_a_cnt);
1127 WREG32(D1MODE_PRIORITY_B_CNT, d1mode_priority_a_cnt);
1119 WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF); 1128 WREG32(D2MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
1120 WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF); 1129 WREG32(D2MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
1121 } else { 1130 } else {
@@ -1144,10 +1153,13 @@ void rv515_bandwidth_avivo_update(struct radeon_device *rdev)
1144 priority_mark12.full = 0; 1153 priority_mark12.full = 0;
1145 if (wm1.priority_mark_max.full > priority_mark12.full) 1154 if (wm1.priority_mark_max.full > priority_mark12.full)
1146 priority_mark12.full = wm1.priority_mark_max.full; 1155 priority_mark12.full = wm1.priority_mark_max.full;
1156 d2mode_priority_a_cnt = rfixed_trunc(priority_mark12);
1157 if (rdev->disp_priority == 2)
1158 d2mode_priority_a_cnt |= MODE_PRIORITY_ALWAYS_ON;
1147 WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF); 1159 WREG32(D1MODE_PRIORITY_A_CNT, MODE_PRIORITY_OFF);
1148 WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF); 1160 WREG32(D1MODE_PRIORITY_B_CNT, MODE_PRIORITY_OFF);
1149 WREG32(D2MODE_PRIORITY_A_CNT, rfixed_trunc(priority_mark12)); 1161 WREG32(D2MODE_PRIORITY_A_CNT, d2mode_priority_a_cnt);
1150 WREG32(D2MODE_PRIORITY_B_CNT, rfixed_trunc(priority_mark12)); 1162 WREG32(D2MODE_PRIORITY_B_CNT, d2mode_priority_a_cnt);
1151 } 1163 }
1152} 1164}
1153 1165
@@ -1157,6 +1169,8 @@ void rv515_bandwidth_update(struct radeon_device *rdev)
1157 struct drm_display_mode *mode0 = NULL; 1169 struct drm_display_mode *mode0 = NULL;
1158 struct drm_display_mode *mode1 = NULL; 1170 struct drm_display_mode *mode1 = NULL;
1159 1171
1172 radeon_update_display_priority(rdev);
1173
1160 if (rdev->mode_info.crtcs[0]->base.enabled) 1174 if (rdev->mode_info.crtcs[0]->base.enabled)
1161 mode0 = &rdev->mode_info.crtcs[0]->base.mode; 1175 mode0 = &rdev->mode_info.crtcs[0]->base.mode;
1162 if (rdev->mode_info.crtcs[1]->base.enabled) 1176 if (rdev->mode_info.crtcs[1]->base.enabled)
@@ -1166,7 +1180,8 @@ void rv515_bandwidth_update(struct radeon_device *rdev)
1166 * modes if the user specifies HIGH for displaypriority 1180 * modes if the user specifies HIGH for displaypriority
1167 * option. 1181 * option.
1168 */ 1182 */
1169 if (rdev->disp_priority == 2) { 1183 if ((rdev->disp_priority == 2) &&
1184 (rdev->family == CHIP_RV515)) {
1170 tmp = RREG32_MC(MC_MISC_LAT_TIMER); 1185 tmp = RREG32_MC(MC_MISC_LAT_TIMER);
1171 tmp &= ~MC_DISP1R_INIT_LAT_MASK; 1186 tmp &= ~MC_DISP1R_INIT_LAT_MASK;
1172 tmp &= ~MC_DISP0R_INIT_LAT_MASK; 1187 tmp &= ~MC_DISP0R_INIT_LAT_MASK;