Skip to content
/ linux Public

Commit 9691c50

Browse files
hogandergregkh
authored andcommitted
drm/i915/psr: Compute PSR entry_setup_frames into intel_crtc_state
commit 7caac65 upstream. PSR entry_setup_frames is currently computed directly into struct intel_dp:intel_psr:entry_setup_frames. This causes a problem if mode change gets rejected after PSR compute config: Psr_entry_setup_frames computed for this rejected state is in intel_dp:intel_psr:entry_setup_frame. Fix this by computing it into intel_crtc_state and copy the value into intel_dp:intel_psr:entry_setup_frames on PSR enable. Fixes: 2b981d5 ("drm/i915/display: Support PSR entry VSC packet to be transmitted one frame earlier") Cc: Mika Kahola <mika.kahola@intel.com> Cc: <stable@vger.kernel.org> # v6.8+ Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com> Link: https://patch.msgid.link/20260312083710.1593781-3-jouni.hogander@intel.com (cherry picked from commit 8c229b4aa00262c13787982e998c61c0783285e0) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> [ adapted context lines to account for missing `no_psr_reason` field and `alpm_state` struct. ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8d0d94f commit 9691c50

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/gpu/drm/i915/display/intel_display_types.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ struct intel_crtc_state {
11271127
u32 dc3co_exitline;
11281128
u16 su_y_granularity;
11291129
u8 active_non_psr_pipes;
1130+
u8 entry_setup_frames;
11301131

11311132
/*
11321133
* Frequency the dpll for the port should run at. Differs from the

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ static bool _psr_compute_config(struct intel_dp *intel_dp,
15851585
entry_setup_frames = intel_psr_entry_setup_frames(intel_dp, adjusted_mode);
15861586

15871587
if (entry_setup_frames >= 0) {
1588-
intel_dp->psr.entry_setup_frames = entry_setup_frames;
1588+
crtc_state->entry_setup_frames = entry_setup_frames;
15891589
} else {
15901590
drm_dbg_kms(display->drm,
15911591
"PSR condition failed: PSR setup timing not met\n");
@@ -1657,7 +1657,7 @@ static bool intel_psr_needs_wa_18037818876(struct intel_dp *intel_dp,
16571657
{
16581658
struct intel_display *display = to_intel_display(intel_dp);
16591659

1660-
return (DISPLAY_VER(display) == 20 && intel_dp->psr.entry_setup_frames > 0 &&
1660+
return (DISPLAY_VER(display) == 20 && crtc_state->entry_setup_frames > 0 &&
16611661
!crtc_state->has_sel_update);
16621662
}
16631663

@@ -2027,6 +2027,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
20272027
crtc_state->req_psr2_sdp_prior_scanline;
20282028
intel_dp->psr.active_non_psr_pipes = crtc_state->active_non_psr_pipes;
20292029
intel_dp->psr.pkg_c_latency_used = crtc_state->pkg_c_latency_used;
2030+
intel_dp->psr.entry_setup_frames = crtc_state->entry_setup_frames;
20302031

20312032
if (!psr_interrupt_error_check(intel_dp))
20322033
return;

0 commit comments

Comments
 (0)