Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: [PATCH v3 02/13] drm/i915/psr: Store enabled non-psr pipes into intel_crtc_state
Date: Mon, 14 Apr 2025 13:04:57 +0300	[thread overview]
Message-ID: <20250414100508.1208774-3-jouni.hogander@intel.com> (raw)
In-Reply-To: <20250414100508.1208774-1-jouni.hogander@intel.com>

To implement workaround for underrun on idle PSR HW issue (Wa_16025596647)
we need to know enabled. Figure out which non-PSR pipes we will have active
and store it into intel_crtc_state->active_non_psr_pipes. This is currently
assuming only one eDP on a time. I.e. possible secondary eDP with PSR
capable panel is not considered.

Bspec: 74151

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 .../drm/i915/display/intel_display_types.h    |  3 +++
 drivers/gpu/drm/i915/display/intel_psr.c      | 23 +++++++++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 94468a9d2e0d..0e2945aa6057 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1114,6 +1114,7 @@ struct intel_crtc_state {
 	bool wm_level_disabled;
 	u32 dc3co_exitline;
 	u16 su_y_granularity;
+	u8 active_non_psr_pipes;
 
 	/*
 	 * Frequency the dpll for the port should run at. Differs from the
@@ -1650,6 +1651,8 @@ struct intel_psr {
 	u8 entry_setup_frames;
 
 	bool link_ok;
+
+	u8 active_non_psr_pipes;
 };
 
 struct intel_dp {
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index eef48c014112..20d53292c3b3 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1649,6 +1649,9 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
 {
 	struct intel_display *display = to_intel_display(intel_dp);
 	const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
+	struct intel_atomic_state *state = to_intel_atomic_state(crtc_state->uapi.state);
+	struct intel_crtc *crtc;
+	u8 active_pipes = 0;
 
 	if (!psr_global_enabled(intel_dp)) {
 		drm_dbg_kms(display->drm, "PSR disabled by flag\n");
@@ -1702,6 +1705,24 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
 		drm_dbg_kms(display->drm,
 			    "PSR disabled to workaround PSR FSM hang issue\n");
 	}
+
+	/* Rest is for Wa_16025596647 */
+	if (DISPLAY_VER(display) != 20 &&
+	    !IS_DISPLAY_VERx100_STEP(display, 3000, STEP_A0, STEP_B0))
+		return;
+
+	/* Not needed by Panel Replay  */
+	if (crtc_state->has_panel_replay)
+		return;
+
+	/* We ignore possible secondary PSR/Panel Replay capable eDP */
+	for_each_intel_crtc(display->drm, crtc)
+		active_pipes |= crtc->active ? BIT(crtc->pipe) : 0;
+
+	active_pipes = intel_calc_active_pipes(state, active_pipes);
+
+	crtc_state->active_non_psr_pipes = active_pipes &
+		~BIT(to_intel_crtc(crtc_state->uapi.crtc)->pipe);
 }
 
 void intel_psr_get_config(struct intel_encoder *encoder,
@@ -1985,6 +2006,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 	intel_dp->psr.psr2_sel_fetch_cff_enabled = false;
 	intel_dp->psr.req_psr2_sdp_prior_scanline =
 		crtc_state->req_psr2_sdp_prior_scanline;
+	intel_dp->psr.active_non_psr_pipes = crtc_state->active_non_psr_pipes;
 
 	if (!psr_interrupt_error_check(intel_dp))
 		return;
@@ -2159,6 +2181,7 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp)
 	intel_dp->psr.psr2_sel_fetch_enabled = false;
 	intel_dp->psr.su_region_et_enabled = false;
 	intel_dp->psr.psr2_sel_fetch_cff_enabled = false;
+	intel_dp->psr.active_non_psr_pipes = 0;
 }
 
 /**
-- 
2.43.0


  parent reply	other threads:[~2025-04-14 10:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 10:04 [PATCH v3 00/13] Underrun on idle PSR workaround Jouni Högander
2025-04-14 10:04 ` [PATCH v3 01/13] drm/i915/display: Add new interface for getting dc_state Jouni Högander
2025-04-22  8:27   ` Kahola, Mika
2025-04-14 10:04 ` Jouni Högander [this message]
2025-04-22  7:49   ` [PATCH v3 02/13] drm/i915/psr: Store enabled non-psr pipes into intel_crtc_state Kahola, Mika
2025-04-14 10:04 ` [PATCH v3 03/13] drm/i915/dmc: Add PIPEDMC_EVT_CTL register definition Jouni Högander
2025-04-22  8:26   ` Kahola, Mika
2025-04-14 10:04 ` [PATCH v3 04/13] drm/i915/dmc: Add PIPEDMC_BLOCK_PKGC_SW definitions Jouni Högander
2025-04-14 10:05 ` [PATCH v3 05/13] drm/i915/dmc: Add interface to block PKG C-state Jouni Högander
2025-04-22  8:28   ` Kahola, Mika
2025-04-23  9:54     ` Hogander, Jouni
2025-04-14 10:05 ` [PATCH v3 06/13] drm/i915/psr: Block PKG C-State when enabling PSR Jouni Högander
2025-04-22  9:38   ` Kahola, Mika
2025-04-14 10:05 ` [PATCH v3 07/13] drm/i915/psr: Add mechanism to notify PSR of pipe enable/disable Jouni Högander
2025-04-14 10:05 ` [PATCH v3 08/13] drm/i915/psr: Add mechanism to notify PSR of DC5/6 enable disable Jouni Högander
2025-04-14 10:05 ` [PATCH v3 09/13] drm/i915/psr: Add interface to notify PSR of vblank enable/disable Jouni Högander
2025-04-14 10:05 ` [PATCH v3 10/13] drm/i915/dmc: Add interface to control start of PKG C-state exit Jouni Högander
2025-04-22 10:08   ` Kahola, Mika
2025-05-12 10:57   ` Ville Syrjälä
2025-05-12 11:24     ` Hogander, Jouni
2025-04-14 10:05 ` [PATCH v3 11/13] drm/i915/psr: Apply underrun on PSR idle workaround Jouni Högander
2025-04-22 10:16   ` Kahola, Mika
2025-04-14 10:05 ` [PATCH v3 12/13] drm/i915/display: Rename intel_psr_needs_block_dc_vblank Jouni Högander
2025-04-14 10:05 ` [PATCH v3 13/13] drm/i915/display: Rename vblank DC workaround functions and variables Jouni Högander
2025-04-14 11:08 ` ✓ CI.Patch_applied: success for Underrun on idle PSR workaround (rev6) Patchwork
2025-04-14 11:09 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-14 11:10 ` ✓ CI.KUnit: success " Patchwork
2025-04-14 11:19 ` ✓ CI.Build: " Patchwork
2025-04-14 11:21 ` ✓ CI.Hooks: " Patchwork
2025-04-14 11:24 ` ✗ CI.checksparse: warning " Patchwork
2025-04-14 12:09 ` ✓ Xe.CI.BAT: success " Patchwork
2025-04-14 14:37 ` ✗ Xe.CI.Full: failure " Patchwork
2025-04-23  9:04   ` Hogander, Jouni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250414100508.1208774-3-jouni.hogander@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox