Skip to content

Commit c805d47

Browse files
jnikulagregkh
authored andcommitted
drm/i915/psr: fix pipe to vblank conversion
commit 994dec1 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: f02658c ("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 2750f67) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a0da941 commit c805d47

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_psr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,8 @@ static bool is_dc5_dc6_blocked(struct intel_dp *intel_dp)
896896
{
897897
struct intel_display *display = to_intel_display(intel_dp);
898898
u32 current_dc_state = intel_display_power_get_current_dc_state(display);
899-
struct drm_vblank_crtc *vblank = &display->drm->vblank[intel_dp->psr.pipe];
899+
struct intel_crtc *crtc = intel_crtc_for_pipe(display, intel_dp->psr.pipe);
900+
struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(&crtc->base);
900901

901902
return (current_dc_state != DC_STATE_EN_UPTO_DC5 &&
902903
current_dc_state != DC_STATE_EN_UPTO_DC6) ||

0 commit comments

Comments
 (0)