Skip to content

Commit b436f1c

Browse files
Nicholas Kazlauskasalexdeucher
authored andcommitted
drm/amd/display: Fix idle optimization checks for multi-display and dual eDP
[Why] Idle optimizations are blocked if there's more than one eDP connector on the board - blocking S0i3 and IPS2 for static screen. [How] Fix the checks to correctly detect number of active eDP. Also restrict the eDP support to panels that have correct feature support. Cc: Mario Limonciello <mario.limonciello@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org Reviewed-by: Charlene Liu <charlene.liu@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 3f0b5af commit b436f1c

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -638,22 +638,43 @@ void dcn35_power_down_on_boot(struct dc *dc)
638638

639639
bool dcn35_apply_idle_power_optimizations(struct dc *dc, bool enable)
640640
{
641-
struct dc_link *edp_links[MAX_NUM_EDP];
642-
int i, edp_num;
643641
if (dc->debug.dmcub_emulation)
644642
return true;
645643

646644
if (enable) {
647-
dc_get_edp_links(dc, edp_links, &edp_num);
648-
if (edp_num == 0 || edp_num > 1)
649-
return false;
645+
uint32_t num_active_edp = 0;
646+
int i;
650647

651648
for (i = 0; i < dc->current_state->stream_count; ++i) {
652649
struct dc_stream_state *stream = dc->current_state->streams[i];
650+
struct dc_link *link = stream->link;
651+
bool is_psr = link && !link->panel_config.psr.disable_psr &&
652+
(link->psr_settings.psr_version == DC_PSR_VERSION_1 ||
653+
link->psr_settings.psr_version == DC_PSR_VERSION_SU_1);
654+
bool is_replay = link && link->replay_settings.replay_feature_enabled;
655+
656+
/* Ignore streams that disabled. */
657+
if (stream->dpms_off)
658+
continue;
659+
660+
/* Active external displays block idle optimizations. */
661+
if (!dc_is_embedded_signal(stream->signal))
662+
return false;
663+
664+
/* If not PWRSEQ0 can't enter idle optimizations */
665+
if (link && link->link_index != 0)
666+
return false;
653667

654-
if (!stream->dpms_off && !dc_is_embedded_signal(stream->signal))
668+
/* Check for panel power features required for idle optimizations. */
669+
if (!is_psr && !is_replay)
655670
return false;
671+
672+
num_active_edp += 1;
656673
}
674+
675+
/* If more than one active eDP then disallow. */
676+
if (num_active_edp > 1)
677+
return false;
657678
}
658679

659680
// TODO: review other cases when idle optimization is allowed

0 commit comments

Comments
 (0)