drm/amd/display: Allow idle opts for no flip case on PSR panel
authorAlvin Lee <alvin.lee2@amd.com>
Mon, 12 Feb 2024 19:43:08 +0000 (14:43 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Mar 2024 05:32:56 +0000 (01:32 -0400)
[Why & How]
There is a corner case where a single PSR panel
fails to enter idle optimizations if the panel
is not flipping (no planes or DPMS_OFF == true).
This is because the panel will not enter PSR if it's
not flipping, but this will prevent the FW idle opt
path from being executed. To handle this case we will
allow entry to idle opt from driver side even when a
PSR panel is connected under the following scenarios:
1. Only a single PSR panel is connected
2. PSR panel is not flipping

Reviewed-by: Samson Tam <samson.tam@amd.com>
Acked-by: Tom Chung <chiahsuan.chung@amd.com>
Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c

index c0b526cf178654f1c9fedb95e08831e965a911a7..a5e92389615ff136c602dce54ab36285a8ffffb0 100644 (file)
@@ -261,7 +261,9 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable)
        for (i = 0; i < dc->current_state->stream_count; i++) {
                /* MALL SS messaging is not supported with PSR at this time */
                if (dc->current_state->streams[i] != NULL &&
-                               dc->current_state->streams[i]->link->psr_settings.psr_version != DC_PSR_VERSION_UNSUPPORTED)
+                               dc->current_state->streams[i]->link->psr_settings.psr_version != DC_PSR_VERSION_UNSUPPORTED &&
+                               (dc->current_state->stream_count > 1 || (!dc->current_state->streams[i]->dpms_off &&
+                                               dc->current_state->stream_status[i].plane_count > 0)))
                        return false;
        }