Skip to content

Commit d6be09d

Browse files
Tom ChungSasha Levin
authored andcommitted
drm/amd/display: Fix Xorg desktop unresponsive on Replay panel
commit 66af73a upstream. [WHY & HOW] IPS & self-fresh feature can cause vblank counter resets between vblank disable and enable. It may cause system stuck due to wait the vblank counter. Call the drm_crtc_vblank_restore() during vblank enable to estimate missed vblanks by using timestamps and update the vblank counter in DRM. It can make the vblank counter increase smoothly and resolve this issue. Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Sun peng (Leo) Li <[email protected]> Signed-off-by: Tom Chung <[email protected]> Signed-off-by: Alex Hung <[email protected]> Tested-by: Dan Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit 34d66bc7ff10e146a4cec76cf286979740a10954) Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 928d8b6 commit d6be09d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,25 @@ static inline int amdgpu_dm_crtc_set_vblank(struct drm_crtc *crtc, bool enable)
299299
irq_type = amdgpu_display_crtc_idx_to_irq_type(adev, acrtc->crtc_id);
300300

301301
if (enable) {
302+
struct dc *dc = adev->dm.dc;
303+
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
304+
struct psr_settings *psr = &acrtc_state->stream->link->psr_settings;
305+
struct replay_settings *pr = &acrtc_state->stream->link->replay_settings;
306+
bool sr_supported = (psr->psr_version != DC_PSR_VERSION_UNSUPPORTED) ||
307+
pr->config.replay_supported;
308+
309+
/*
310+
* IPS & self-refresh feature can cause vblank counter resets between
311+
* vblank disable and enable.
312+
* It may cause system stuck due to waiting for the vblank counter.
313+
* Call this function to estimate missed vblanks by using timestamps and
314+
* update the vblank counter in DRM.
315+
*/
316+
if (dc->caps.ips_support &&
317+
dc->config.disable_ips != DMUB_IPS_DISABLE_ALL &&
318+
sr_supported && vblank->config.disable_immediate)
319+
drm_crtc_vblank_restore(crtc);
320+
302321
/* vblank irq on -> Only need vupdate irq in vrr mode */
303322
if (amdgpu_dm_crtc_vrr_active(acrtc_state))
304323
rc = amdgpu_dm_crtc_set_vupdate_irq(crtc, true);

0 commit comments

Comments
 (0)