drm/atomic: Force bridge self-refresh-exit on CRTC switch
authorjsg <jsg@openbsd.org>
Wed, 15 Jun 2022 07:47:22 +0000 (07:47 +0000)
committerjsg <jsg@openbsd.org>
Wed, 15 Jun 2022 07:47:22 +0000 (07:47 +0000)
From Brian Norris
cab7cd86f9e81834c407e043844779f21653ff3c in linux 5.15.y/5.15.47
e54a4424925a27ed94dff046db3ce5caf4b1e748 in mainline linux

sys/dev/pci/drm/drm_atomic_helper.c

index ff2bc9a..aa09a19 100644 (file)
@@ -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) ||