Skip to content

Commit 67edb81

Browse files
Tom Chungalexdeucher
Tom Chung
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]> (cherry picked from commit d787934) Cc: [email protected]
1 parent b0a3e84 commit 67edb81

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -8896,6 +8896,7 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
88968896
struct replay_settings *pr = &acrtc_state->stream->link->replay_settings;
88978897
struct amdgpu_dm_connector *aconn =
88988898
(struct amdgpu_dm_connector *)acrtc_state->stream->dm_stream_context;
8899+
bool vrr_active = amdgpu_dm_crtc_vrr_active(acrtc_state);
88998900

89008901
if (acrtc_state->update_type > UPDATE_TYPE_FAST) {
89018902
if (pr->config.replay_supported && !pr->replay_feature_enabled)
@@ -8922,7 +8923,8 @@ static void amdgpu_dm_enable_self_refresh(struct amdgpu_crtc *acrtc_attach,
89228923
* adequate number of fast atomic commits to notify KMD
89238924
* of update events. See `vblank_control_worker()`.
89248925
*/
8925-
if (acrtc_attach->dm_irq_params.allow_sr_entry &&
8926+
if (!vrr_active &&
8927+
acrtc_attach->dm_irq_params.allow_sr_entry &&
89268928
#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
89278929
!amdgpu_dm_crc_window_is_activated(acrtc_state->base.crtc) &&
89288930
#endif
@@ -9266,7 +9268,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
92669268
bundle->stream_update.abm_level = &acrtc_state->abm_level;
92679269

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

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

+1-1
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

+1-1
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)