aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c18
-rw-r--r--drivers/gpu/drm/amd/display/dc/dc.h52
2 files changed, 70 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
index d7aece82e4fe..1b4b51657f5e 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
@@ -704,6 +704,12 @@ bool dcn_validate_bandwidth(
704 struct dc_state *context, 704 struct dc_state *context,
705 bool fast_validate) 705 bool fast_validate)
706{ 706{
707 /*
708 * we want a breakdown of the various stages of validation, which the
709 * perf_trace macro doesn't support
710 */
711 BW_VAL_TRACE_SETUP();
712
707 const struct resource_pool *pool = dc->res_pool; 713 const struct resource_pool *pool = dc->res_pool;
708 struct dcn_bw_internal_vars *v = &context->dcn_bw_vars; 714 struct dcn_bw_internal_vars *v = &context->dcn_bw_vars;
709 int i, input_idx; 715 int i, input_idx;
@@ -712,6 +718,9 @@ bool dcn_validate_bandwidth(
712 float bw_limit; 718 float bw_limit;
713 719
714 PERFORMANCE_TRACE_START(); 720 PERFORMANCE_TRACE_START();
721
722 BW_VAL_TRACE_COUNT();
723
715 if (dcn_bw_apply_registry_override(dc)) 724 if (dcn_bw_apply_registry_override(dc))
716 dcn_bw_sync_calcs_and_dml(dc); 725 dcn_bw_sync_calcs_and_dml(dc);
717 726
@@ -1014,6 +1023,8 @@ bool dcn_validate_bandwidth(
1014 mode_support_and_system_configuration(v); 1023 mode_support_and_system_configuration(v);
1015 } 1024 }
1016 1025
1026 BW_VAL_TRACE_END_VOLTAGE_LEVEL();
1027
1017 if (v->voltage_level != number_of_states_plus_one && !fast_validate) { 1028 if (v->voltage_level != number_of_states_plus_one && !fast_validate) {
1018 float bw_consumed = v->total_bandwidth_consumed_gbyte_per_second; 1029 float bw_consumed = v->total_bandwidth_consumed_gbyte_per_second;
1019 1030
@@ -1089,6 +1100,8 @@ bool dcn_validate_bandwidth(
1089 break; 1100 break;
1090 } 1101 }
1091 1102
1103 BW_VAL_TRACE_END_WATERMARKS();
1104
1092 for (i = 0, input_idx = 0; i < pool->pipe_count; i++) { 1105 for (i = 0, input_idx = 0; i < pool->pipe_count; i++) {
1093 struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i]; 1106 struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
1094 1107
@@ -1179,6 +1192,10 @@ bool dcn_validate_bandwidth(
1179 1192
1180 input_idx++; 1193 input_idx++;
1181 } 1194 }
1195 } else if (v->voltage_level == number_of_states_plus_one) {
1196 BW_VAL_TRACE_SKIP(fail);
1197 } else if (fast_validate) {
1198 BW_VAL_TRACE_SKIP(fast);
1182 } 1199 }
1183 1200
1184 if (v->voltage_level == 0) { 1201 if (v->voltage_level == 0) {
@@ -1198,6 +1215,7 @@ bool dcn_validate_bandwidth(
1198 kernel_fpu_end(); 1215 kernel_fpu_end();
1199 1216
1200 PERFORMANCE_TRACE_END(); 1217 PERFORMANCE_TRACE_END();
1218 BW_VAL_TRACE_FINISH();
1201 1219
1202 if (bw_limit_pass && v->voltage_level != 5) 1220 if (bw_limit_pass && v->voltage_level != 5)
1203 return true; 1221 return true;
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 978ce365b4a7..3459e39714bc 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -246,6 +246,57 @@ struct dc_clocks {
246 bool p_state_change_support; 246 bool p_state_change_support;
247}; 247};
248 248
249struct dc_bw_validation_profile {
250 bool enable;
251
252 unsigned long long total_ticks;
253 unsigned long long voltage_level_ticks;
254 unsigned long long watermark_ticks;
255 unsigned long long rq_dlg_ticks;
256
257 unsigned long long total_count;
258 unsigned long long skip_fast_count;
259 unsigned long long skip_pass_count;
260 unsigned long long skip_fail_count;
261};
262
263#define BW_VAL_TRACE_SETUP() \
264 unsigned long long end_tick = 0; \
265 unsigned long long voltage_level_tick = 0; \
266 unsigned long long watermark_tick = 0; \
267 unsigned long long start_tick = dc->debug.bw_val_profile.enable ? \
268 dm_get_timestamp(dc->ctx) : 0
269
270#define BW_VAL_TRACE_COUNT() \
271 if (dc->debug.bw_val_profile.enable) \
272 dc->debug.bw_val_profile.total_count++
273
274#define BW_VAL_TRACE_SKIP(status) \
275 if (dc->debug.bw_val_profile.enable) { \
276 if (!voltage_level_tick) \
277 voltage_level_tick = dm_get_timestamp(dc->ctx); \
278 dc->debug.bw_val_profile.skip_ ## status ## _count++; \
279 }
280
281#define BW_VAL_TRACE_END_VOLTAGE_LEVEL() \
282 if (dc->debug.bw_val_profile.enable) \
283 voltage_level_tick = dm_get_timestamp(dc->ctx)
284
285#define BW_VAL_TRACE_END_WATERMARKS() \
286 if (dc->debug.bw_val_profile.enable) \
287 watermark_tick = dm_get_timestamp(dc->ctx)
288
289#define BW_VAL_TRACE_FINISH() \
290 if (dc->debug.bw_val_profile.enable) { \
291 end_tick = dm_get_timestamp(dc->ctx); \
292 dc->debug.bw_val_profile.total_ticks += end_tick - start_tick; \
293 dc->debug.bw_val_profile.voltage_level_ticks += voltage_level_tick - start_tick; \
294 if (watermark_tick) { \
295 dc->debug.bw_val_profile.watermark_ticks += watermark_tick - voltage_level_tick; \
296 dc->debug.bw_val_profile.rq_dlg_ticks += end_tick - watermark_tick; \
297 } \
298 }
299
249struct dc_debug_options { 300struct dc_debug_options {
250 enum visual_confirm visual_confirm; 301 enum visual_confirm visual_confirm;
251 bool sanity_checks; 302 bool sanity_checks;
@@ -299,6 +350,7 @@ struct dc_debug_options {
299 unsigned int force_odm_combine; //bit vector based on otg inst 350 unsigned int force_odm_combine; //bit vector based on otg inst
300 unsigned int force_fclk_khz; 351 unsigned int force_fclk_khz;
301 bool disable_tri_buf; 352 bool disable_tri_buf;
353 struct dc_bw_validation_profile bw_val_profile;
302}; 354};
303 355
304struct dc_debug_data { 356struct dc_debug_data {