Skip to content

Commit 003215f

Browse files
Dillon Varonealexdeucher
authored andcommitted
drm/amd/display: Require minimum VBlank size for stutter optimization
If the nominal VBlank is too small, optimizing for stutter can cause the prefetch bandwidth to increase drasticaly, resulting in higher clock and power requirements. Only optimize if it is >3x the stutter latency. Reviewed-by: Austin Zheng <[email protected]> Signed-off-by: Dillon Varone <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bcafdc6 commit 003215f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_dcn4_fams2.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "dml2_pmo_dcn4_fams2.h"
99

1010
static const double MIN_VACTIVE_MARGIN_PCT = 0.25; // We need more than non-zero margin because DET buffer granularity can alter vactive latency hiding
11+
static const double MIN_BLANK_STUTTER_FACTOR = 3.0;
1112

1213
static const struct dml2_pmo_pstate_strategy base_strategy_list_1_display[] = {
1314
// VActive Preferred
@@ -2140,6 +2141,7 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
21402141
struct dml2_pmo_instance *pmo = in_out->instance;
21412142
bool stutter_period_meets_z8_eco = true;
21422143
bool z8_stutter_optimization_too_expensive = false;
2144+
bool stutter_optimization_too_expensive = false;
21432145
double line_time_us, vblank_nom_time_us;
21442146

21452147
unsigned int i;
@@ -2161,10 +2163,15 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
21612163
line_time_us = (double)in_out->base_display_config->display_config.stream_descriptors[i].timing.h_total / (in_out->base_display_config->display_config.stream_descriptors[i].timing.pixel_clock_khz * 1000) * 1000000;
21622164
vblank_nom_time_us = line_time_us * in_out->base_display_config->display_config.stream_descriptors[i].timing.vblank_nom;
21632165

2164-
if (vblank_nom_time_us < pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us) {
2166+
if (vblank_nom_time_us < pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us * MIN_BLANK_STUTTER_FACTOR) {
21652167
z8_stutter_optimization_too_expensive = true;
21662168
break;
21672169
}
2170+
2171+
if (vblank_nom_time_us < pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us * MIN_BLANK_STUTTER_FACTOR) {
2172+
stutter_optimization_too_expensive = true;
2173+
break;
2174+
}
21682175
}
21692176

21702177
pmo->scratch.pmo_dcn4.num_stutter_candidates = 0;
@@ -2180,7 +2187,7 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
21802187
pmo->scratch.pmo_dcn4.z8_vblank_optimizable = false;
21812188
}
21822189

2183-
if (pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us > 0) {
2190+
if (!stutter_optimization_too_expensive && pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us > 0) {
21842191
pmo->scratch.pmo_dcn4.optimal_vblank_reserved_time_for_stutter_us[pmo->scratch.pmo_dcn4.num_stutter_candidates] = (unsigned int)pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us;
21852192
pmo->scratch.pmo_dcn4.num_stutter_candidates++;
21862193
}

0 commit comments

Comments
 (0)