Skip to content

Commit d787934

Browse files
Tom Chungalexdeucher
authored andcommitted
drm/amd/display: Disable replay and psr while VRR is enabled
[Why] Replay and PSR will cause some video corruption while VRR is enabled. [How] 1. Disable the Replay and PSR while VRR is enabled. 2. Change the amdgpu_dm_crtc_vrr_active() parameter to const. Because the function will only read data from dm_crtc_state. Reviewed-by: Sun peng Li <[email protected]> Signed-off-by: Tom Chung <[email protected]> Signed-off-by: Roman Li <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f765e7c commit d787934

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8898,6 +8898,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
88988898
struct replay_settings *pr = &acrtc_state->stream->link->replay_settings;
88998899
struct amdgpu_dm_connector *aconn =
89008900
(struct amdgpu_dm_connector *)acrtc_state->stream->dm_stream_context;
8901+
bool vrr_active = amdgpu_dm_crtc_vrr_active(acrtc_state);
89018902

89028903
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
89038904
if (pr->config.replay_supported && !pr->replay_feature_enabled)
@@ -8924,7 +8925,8 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
89248925
* adequate number of fast atomic commits to notify KMD
89258926
* of update events. See `vblank_control_worker()`.
89268927
*/
8927-
if (acrtc_attach->dm_irq_params.allow_sr_entry &&
8928+
if (!vrr_active &&
8929+
acrtc_attach->dm_irq_params.allow_sr_entry &&
89288930
#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
89298931
!amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&
89308932
#endif
@@ -9268,7 +9270,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
92689270
bundle->stream_update.abm_level = &acrtc_state->abm_level;
92699271

92709272
mutex_lock(&dm->dc_lock);
9271-
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
9273+
if ((acrtc_state->update_type > UPDATE_TYPE_FAST) || vrr_active) {
92729274
if (acrtc_state->stream->link->replay_settings.replay_allow_active)
92739275
amdgpu_dm_replay_disable(acrtc_state->stream);
92749276
if (acrtc_state->stream->link->psr_settings.psr_allow_active)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable)
9393
return rc;
9494
}
9595

96-
bool amdgpu_dm_crtc_vrr_active(struct dm_crtc_state *dm_state)
96+
bool amdgpu_dm_crtc_vrr_active(const struct dm_crtc_state *dm_state)
9797
{
9898
return dm_state->freesync_config.state == VRR_STATE_ACTIVE_VARIABLE ||
9999
dm_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int amdgpu_dm_crtc_set_vupdate_irq(struct drm_crtc *crtc, bool enable);
3737

3838
bool amdgpu_dm_crtc_vrr_active_irq(struct amdgpu_crtc *acrtc);
3939

40-
bool amdgpu_dm_crtc_vrr_active(struct dm_crtc_state *dm_state);
40+
bool amdgpu_dm_crtc_vrr_active(const struct dm_crtc_state *dm_state);
4141

4242
int amdgpu_dm_crtc_enable_vblank(struct drm_crtc *crtc);
4343

0 commit comments

Comments
 (0)