Intel-GFX 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 6/7] drm/i915/psr: Add PSR specific pre compute config
Date: Mon,  8 Jun 2026 17:11:23 +0300	[thread overview]
Message-ID: <20260608141124.144878-7-jouni.hogander@intel.com> (raw)
In-Reply-To: <20260608141124.144878-1-jouni.hogander@intel.com>

Add _psr_pre_compute_config and move everything possible into it to unify
how Panel Replay and PSR compute config is implemented.

While changing this re-order psr_pre_compute_config a bit as well:

It is confusing to see "PSR disabled due to joiner" on a setup that doesn't
even support PSR or Panel Replay. Move checks for joiner and interlaced
mode after support for PSR/Panel Replay support is checked.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 39 +++++++++++++++++-------
 1 file changed, 28 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index a61fa9d0ff82c..0cd183ffb0f91 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1779,9 +1779,6 @@ static bool _psr_compute_config(struct intel_dp *intel_dp,
 	const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
 	int entry_setup_frames;
 
-	if (!CAN_PSR(intel_dp) || !display->params.enable_psr)
-		return false;
-
 	/*
 	 * Currently PSR doesn't work reliably with VRR enabled.
 	 */
@@ -1907,6 +1904,15 @@ static bool _panel_replay_pre_compute_config(struct intel_dp *intel_dp,
 	return true;
 }
 
+static bool _psr_pre_compute_config(struct intel_dp *intel_dp,
+				    struct intel_crtc_state *crtc_state,
+				    struct drm_connector_state *conn_state)
+{
+	struct intel_display *display = to_intel_display(intel_dp);
+
+	return CAN_PSR(intel_dp) && display->params.enable_psr;
+}
+
 static bool intel_psr_needs_wa_18037818876(struct intel_dp *intel_dp,
 					   struct intel_crtc_state *crtc_state)
 {
@@ -1952,19 +1958,30 @@ void intel_psr_pre_compute_config(struct intel_dp *intel_dp,
 
 	if (!psr_global_enabled(intel_dp)) {
 		drm_dbg_kms(display->drm, "PSR disabled by flag\n");
-		return;
+		goto out_psr_disable;
 	}
 
 	if (intel_dp->psr.sink_not_reliable) {
 		drm_dbg_kms(display->drm,
 			    "PSR sink implementation is not reliable\n");
-		return;
+		goto out_psr_disable;
 	}
 
+	crtc_state->has_psr = crtc_state->has_panel_replay =
+		_panel_replay_pre_compute_config(intel_dp, crtc_state,
+						 conn_state);
+
+	if (!crtc_state->has_psr)
+		crtc_state->has_psr = _psr_pre_compute_config(intel_dp, crtc_state,
+							      conn_state);
+
+	if (!crtc_state->has_psr)
+		goto out_psr_disable;
+
 	if (adjusted_mode->flags & DRM_MODE_FLAG_INTERLACE) {
 		drm_dbg_kms(display->drm,
 			    "PSR condition failed: Interlaced mode enabled\n");
-		return;
+		goto out_psr_disable;
 	}
 
 	/*
@@ -1975,13 +1992,13 @@ void intel_psr_pre_compute_config(struct intel_dp *intel_dp,
 	if (crtc_state->joiner_pipes) {
 		drm_dbg_kms(display->drm,
 			    "PSR disabled due to joiner\n");
-		return;
+		goto out_psr_disable;
 	}
 
-	crtc_state->has_psr = true;
-	crtc_state->has_panel_replay =
-		_panel_replay_pre_compute_config(intel_dp, crtc_state,
-						 conn_state);
+	return;
+
+out_psr_disable:
+	crtc_state->has_psr = crtc_state->has_panel_replay = false;
 }
 
 void intel_psr_compute_config(struct intel_dp *intel_dp,
-- 
2.43.0


  parent reply	other threads:[~2026-06-08 14:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 14:11 [PATCH 0/7] Enable FEC when using DP Panel Replay Jouni Högander
2026-06-08 14:11 ` [PATCH 1/7] drm/i915/psr: Check FEC support for " Jouni Högander
2026-06-09 11:29   ` Nautiyal, Ankit K
2026-06-08 14:11 ` [PATCH 2/7] drm/i915/psr: Stop using intel_dsc_enabled_on_link to detect crtc DSC status Jouni Högander
2026-06-09 12:14   ` Nautiyal, Ankit K
2026-06-09 13:30     ` Hogander, Jouni
2026-06-09 13:45   ` Imre Deak
2026-06-18  6:04     ` Hogander, Jouni
2026-06-08 14:11 ` [PATCH 3/7] drm/i915/display: Rename compression_enabled_on_link and link_dsc_pipes Jouni Högander
2026-06-08 14:11 ` [PATCH 4/7] drm/i915/psr: Split PSR compute config Jouni Högander
2026-06-08 14:11 ` [PATCH 5/7] drm/i915/psr: Move DP/eDP Panel Replay compute config to pre " Jouni Högander
2026-06-08 14:11 ` Jouni Högander [this message]
2026-06-08 14:11 ` [PATCH 7/7] drm/i915/psr: Enable FEC if using DP Panel Replay Jouni Högander
2026-06-08 20:37 ` ✓ i915.CI.BAT: success for Enable FEC when " Patchwork
2026-06-09  1:44 ` ✗ i915.CI.Full: failure " Patchwork

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=20260608141124.144878-7-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