Skip to content

Commit 7caac65

Browse files
hoganderjlahtine-intel
authored andcommitted
drm/i915/psr: Compute PSR entry_setup_frames into intel_crtc_state
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 <[email protected]> Cc: <[email protected]> # v6.8+ Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Suraj Kandpal <[email protected]> Link: https://patch.msgid.link/[email protected] (cherry picked from commit 8c229b4) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent b0a4dba commit 7caac65

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,7 @@ struct intel_crtc_state {
11861186
u32 dc3co_exitline;
11871187
u16 su_y_granularity;
11881188
u8 active_non_psr_pipes;
1189+
u8 entry_setup_frames;
11891190
const char *no_psr_reason;
11901191

11911192
/*

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

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

17191719
if (entry_setup_frames >= 0) {
1720-
intel_dp->psr.entry_setup_frames = entry_setup_frames;
1720+
crtc_state->entry_setup_frames = entry_setup_frames;
17211721
} else {
17221722
crtc_state->no_psr_reason = "PSR setup timing not met";
17231723
drm_dbg_kms(display->drm,
@@ -1815,7 +1815,7 @@ static bool intel_psr_needs_wa_18037818876(struct intel_dp *intel_dp,
18151815
{
18161816
struct intel_display *display = to_intel_display(intel_dp);
18171817

1818-
return (DISPLAY_VER(display) == 20 && intel_dp->psr.entry_setup_frames > 0 &&
1818+
return (DISPLAY_VER(display) == 20 && crtc_state->entry_setup_frames > 0 &&
18191819
!crtc_state->has_sel_update);
18201820
}
18211821

@@ -2189,6 +2189,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
21892189
intel_dp->psr.pkg_c_latency_used = crtc_state->pkg_c_latency_used;
21902190
intel_dp->psr.io_wake_lines = crtc_state->alpm_state.io_wake_lines;
21912191
intel_dp->psr.fast_wake_lines = crtc_state->alpm_state.fast_wake_lines;
2192+
intel_dp->psr.entry_setup_frames = crtc_state->entry_setup_frames;
21922193

21932194
if (!psr_interrupt_error_check(intel_dp))
21942195
return;

0 commit comments

Comments
 (0)