From f9ea05399a0a243ac45860fcbf94c6652d792250 Mon Sep 17 00:00:00 2001 From: jsg Date: Wed, 15 Jun 2022 07:47:22 +0000 Subject: [PATCH] drm/atomic: Force bridge self-refresh-exit on CRTC switch From Brian Norris cab7cd86f9e81834c407e043844779f21653ff3c in linux 5.15.y/5.15.47 e54a4424925a27ed94dff046db3ce5caf4b1e748 in mainline linux --- sys/dev/pci/drm/drm_atomic_helper.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/drm/drm_atomic_helper.c b/sys/dev/pci/drm/drm_atomic_helper.c index ff2bc9a1180..aa09a19fae3 100644 --- a/sys/dev/pci/drm/drm_atomic_helper.c +++ b/sys/dev/pci/drm/drm_atomic_helper.c @@ -996,9 +996,19 @@ crtc_needs_disable(struct drm_crtc_state *old_state, return drm_atomic_crtc_effectively_active(old_state); /* - * We need to run through the crtc_funcs->disable() function if the CRTC - * is currently on, if it's transitioning to self refresh mode, or if - * it's in self refresh mode and needs to be fully disabled. + * We need to disable bridge(s) and CRTC if we're transitioning out of + * self-refresh and changing CRTCs at the same time, because the + * bridge tracks self-refresh status via CRTC state. + */ + if (old_state->self_refresh_active && + old_state->crtc != new_state->crtc) + return true; + + /* + * We also need to run through the crtc_funcs->disable() function if + * the CRTC is currently on, if it's transitioning to self refresh + * mode, or if it's in self refresh mode and needs to be fully + * disabled. */ return old_state->active || (old_state->self_refresh_active && !new_state->active) || -- 2.20.1