]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/i915/psr: Disable PSR before disable pipe
authorJosé Roberto de Souza <jose.souza@intel.com>
Thu, 14 Jul 2022 15:07:55 +0000 (08:07 -0700)
committerJosé Roberto de Souza <jose.souza@intel.com>
Mon, 18 Jul 2022 13:53:38 +0000 (06:53 -0700)
The issue here was on for_each_intel_encoder_mask_with_psr() over the
new_crtc_state encoder mask, so if the CRTC was being disabled mask
would be zero and it would not have any chance to disable PSR.

So here doing for_each_intel_encoder_mask_with_psr() over the
old_crtc_state encoder mask and then using the new_crtc_state to
check if PSR needs to be disabled.

Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220714150755.154985-2-jose.souza@intel.com
drivers/gpu/drm/i915/display/intel_psr.c

index e6a870641cd2532d14337994c71debcae98441d0..98c3c8015a5c4278a31189ae60a09eb77f6b23f4 100644 (file)
@@ -1863,7 +1863,9 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state,
                                struct intel_crtc *crtc)
 {
        struct drm_i915_private *i915 = to_i915(state->base.dev);
-       const struct intel_crtc_state *crtc_state =
+       const struct intel_crtc_state *old_crtc_state =
+               intel_atomic_get_old_crtc_state(state, crtc);
+       const struct intel_crtc_state *new_crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
        struct intel_encoder *encoder;
 
@@ -1871,7 +1873,7 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state,
                return;
 
        for_each_intel_encoder_mask_with_psr(state->base.dev, encoder,
-                                            crtc_state->uapi.encoder_mask) {
+                                            old_crtc_state->uapi.encoder_mask) {
                struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
                struct intel_psr *psr = &intel_dp->psr;
                bool needs_to_disable = false;
@@ -1884,10 +1886,10 @@ void intel_psr_pre_plane_update(struct intel_atomic_state *state,
                 * - All planes will go inactive
                 * - Changing between PSR versions
                 */
-               needs_to_disable |= intel_crtc_needs_modeset(crtc_state);
-               needs_to_disable |= !crtc_state->has_psr;
-               needs_to_disable |= !crtc_state->active_planes;
-               needs_to_disable |= crtc_state->has_psr2 != psr->psr2_enabled;
+               needs_to_disable |= intel_crtc_needs_modeset(new_crtc_state);
+               needs_to_disable |= !new_crtc_state->has_psr;
+               needs_to_disable |= !new_crtc_state->active_planes;
+               needs_to_disable |= new_crtc_state->has_psr2 != psr->psr2_enabled;
 
                if (psr->enabled && needs_to_disable)
                        intel_psr_disable_locked(intel_dp);