Skip to content

Commit 9fc0cbc

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]> (cherry picked from commit 003215f) Cc: [email protected]
1 parent 6825cb0 commit 9fc0cbc

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
@@ -2139,6 +2140,7 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
21392140
struct dml2_pmo_instance *pmo = in_out->instance;
21402141
bool stutter_period_meets_z8_eco = true;
21412142
bool z8_stutter_optimization_too_expensive = false;
2143+
bool stutter_optimization_too_expensive = false;
21422144
double line_time_us, vblank_nom_time_us;
21432145

21442146
unsigned int i;
@@ -2160,10 +2162,15 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
21602162
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;
21612163
vblank_nom_time_us = line_time_us * in_out->base_display_config->display_config.stream_descriptors[i].timing.vblank_nom;
21622164

2163-
if (vblank_nom_time_us < pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us) {
2165+
if (vblank_nom_time_us < pmo->soc_bb->power_management_parameters.z8_stutter_exit_latency_us * MIN_BLANK_STUTTER_FACTOR) {
21642166
z8_stutter_optimization_too_expensive = true;
21652167
break;
21662168
}
2169+
2170+
if (vblank_nom_time_us < pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us * MIN_BLANK_STUTTER_FACTOR) {
2171+
stutter_optimization_too_expensive = true;
2172+
break;
2173+
}
21672174
}
21682175

21692176
pmo->scratch.pmo_dcn4.num_stutter_candidates = 0;
@@ -2179,7 +2186,7 @@ bool pmo_dcn4_fams2_init_for_stutter(struct dml2_pmo_init_for_stutter_in_out *in
21792186
pmo->scratch.pmo_dcn4.z8_vblank_optimizable = false;
21802187
}
21812188

2182-
if (pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us > 0) {
2189+
if (!stutter_optimization_too_expensive && pmo->soc_bb->power_management_parameters.stutter_enter_plus_exit_latency_us > 0) {
21832190
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;
21842191
pmo->scratch.pmo_dcn4.num_stutter_candidates++;
21852192
}

0 commit comments

Comments
 (0)