Skip to content

Commit 1a36568

Browse files
Roman Lialexdeucher
authored andcommitted
drm/amd/display: Delay PSR entry
[Why] After panel power up, if PSR entry attempted too early, PSR state may get stuck in transition. This could happen if the panel is not ready to respond to the SDP PSR entry message. In this case dmub f/w is unable to abort PSR entry since abortion is not permitted after the SDP has been sent. [How] Skip 5 pageflips before PSR enable. Signed-off-by: Roman Li <roman.li@amd.com> Reviewed-by: Hersen Wu <hersenxs.wu@amd.com> Acked-by: Bindu Ramamurthy <bindu.r@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 9253e11 commit 1a36568

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5900,6 +5900,8 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
59005900
stream->use_vsc_sdp_for_colorimetry = true;
59015901
}
59025902
mod_build_vsc_infopacket(stream, &stream->vsc_infopacket);
5903+
aconnector->psr_skip_count = AMDGPU_DM_PSR_ENTRY_DELAY;
5904+
59035905
}
59045906
finish:
59055907
dc_sink_release(sink);
@@ -8713,7 +8715,13 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
87138715
else if ((acrtc_state->update_type == UPDATE_TYPE_FAST) &&
87148716
acrtc_state->stream->link->psr_settings.psr_feature_enabled &&
87158717
!acrtc_state->stream->link->psr_settings.psr_allow_active) {
8716-
amdgpu_dm_psr_enable(acrtc_state->stream);
8718+
struct amdgpu_dm_connector *aconn = (struct amdgpu_dm_connector *)
8719+
acrtc_state->stream->dm_stream_context;
8720+
8721+
if (aconn->psr_skip_count > 0)
8722+
aconn->psr_skip_count--;
8723+
else
8724+
amdgpu_dm_psr_enable(acrtc_state->stream);
87178725
}
87188726

87198727
mutex_unlock(&dm->dc_lock);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ struct amdgpu_dm_connector {
509509
struct dsc_preferred_settings dsc_settings;
510510
/* Cached display modes */
511511
struct drm_display_mode freesync_vid_base;
512+
513+
int psr_skip_count;
512514
};
513515

514516
#define to_amdgpu_dm_connector(x) container_of(x, struct amdgpu_dm_connector, base)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929
#include "amdgpu.h"
3030

31+
/* the number of pageflips before enabling psr */
32+
#define AMDGPU_DM_PSR_ENTRY_DELAY 5
33+
3134
void amdgpu_dm_set_psr_caps(struct dc_link *link);
3235
bool amdgpu_dm_psr_enable(struct dc_stream_state *stream);
3336
bool amdgpu_dm_link_setup_psr(struct dc_stream_state *stream);

0 commit comments

Comments
 (0)