@@ -638,22 +638,43 @@ void dcn35_power_down_on_boot(struct dc *dc)
638638
639639bool 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