]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/i915/psr: fix pipe to vblank conversion
authorJani Nikula <jani.nikula@intel.com>
Thu, 6 Nov 2025 20:00:00 +0000 (22:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Nov 2025 09:37:49 +0000 (10:37 +0100)
commit 994dec10991b53beac3e16109d876ae363e8a329 upstream.

First, we can't assume pipe == crtc index. If a pipe is fused off in
between, it no longer holds. intel_crtc_for_pipe() is the only proper
way to get from a pipe to the corresponding crtc.

Second, drivers aren't supposed to access or index drm->vblank[]
directly. There's drm_crtc_vblank_crtc() for this.

Use both functions to fix the pipe to vblank conversion.

Fixes: f02658c46cf7 ("drm/i915/psr: Add mechanism to notify PSR of pipe enable/disable")
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: stable@vger.kernel.org # v6.16+
Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patch.msgid.link/20251106200000.1455164-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit 2750f6765d6974f7e163c5d540a96c8703f6d8dd)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/display/intel_psr.c

index 41988e193a415cc16c937f6f799215aa866538ec..85e9aad7ec507f4dde077d8bf2e4b4ab9a8f391c 100644 (file)
@@ -896,7 +896,8 @@ static bool is_dc5_dc6_blocked(struct intel_dp *intel_dp)
 {
        struct intel_display *display = to_intel_display(intel_dp);
        u32 current_dc_state = intel_display_power_get_current_dc_state(display);
-       struct drm_vblank_crtc *vblank = &display->drm->vblank[intel_dp->psr.pipe];
+       struct intel_crtc *crtc = intel_crtc_for_pipe(display, intel_dp->psr.pipe);
+       struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
 
        return (current_dc_state != DC_STATE_EN_UPTO_DC5 &&
                current_dc_state != DC_STATE_EN_UPTO_DC6) ||