From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 03/12] drm/i915/psr: Unify panel replay enable sink
Date: Thu, 4 Jan 2024 12:48:12 +0200 [thread overview]
Message-ID: <20240104104821.1822988-4-jouni.hogander@intel.com> (raw)
In-Reply-To: <20240104104821.1822988-1-jouni.hogander@intel.com>
Panel replay enable for a sink is currently done in
intel_ddi.c:intel_ddi_pre_enable_dp. Move it to intel_psr_enable_sink to
unify psr/panel replay paths. Also enable some additional hpd interrupts
for panel replay.
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
drivers/gpu/drm/i915/display/intel_ddi.c | 7 +-----
drivers/gpu/drm/i915/display/intel_psr.c | 31 +++++++++++++++++-------
2 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 2746655bcb26..e5ad3ace7678 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -2800,15 +2800,10 @@ static void intel_ddi_pre_enable_dp(struct intel_atomic_state *state,
const struct drm_connector_state *conn_state)
{
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
- struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
- if (HAS_DP20(dev_priv)) {
+ if (HAS_DP20(dev_priv))
intel_dp_128b132b_sdp_crc16(enc_to_intel_dp(encoder),
crtc_state);
- if (crtc_state->has_panel_replay)
- drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG,
- DP_PANEL_REPLAY_ENABLE);
- }
if (DISPLAY_VER(dev_priv) >= 14)
mtl_ddi_pre_enable_dp(state, encoder, crtc_state, conn_state);
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 35cef210ff2f..6bdd202ad882 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -606,22 +606,30 @@ static void hsw_psr_setup_aux(struct intel_dp *intel_dp)
aux_ctl);
}
+static unsigned int intel_psr_get_enable_sink_offset(struct intel_dp *intel_dp)
+{
+ return intel_dp->psr.panel_replay_enabled ?
+ PANEL_REPLAY_CONFIG : DP_PSR_EN_CFG;
+}
+
+/*
+ * Note: Most of the bits are same in PANEL_REPLAY_CONFIG and DP_PSR_EN_CFG. We
+ * are relying on PSR definitions on these "common" bits.
+ */
static void intel_psr_enable_sink(struct intel_dp *intel_dp)
{
struct drm_i915_private *dev_priv = dp_to_i915(intel_dp);
u8 dpcd_val = DP_PSR_ENABLE;
- if (intel_dp->psr.panel_replay_enabled)
- return;
-
if (intel_dp->psr.psr2_enabled) {
/* Enable ALPM at sink for psr2 */
- drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG,
- DP_ALPM_ENABLE |
- DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE);
+ if (intel_dp_is_edp(intel_dp))
+ drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG,
+ DP_ALPM_ENABLE |
+ DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE);
dpcd_val |= DP_PSR_ENABLE_PSR2 | DP_PSR_IRQ_HPD_WITH_CRC_ERRORS;
- } else {
+ } else if (!intel_dp->psr.panel_replay_enabled) {
if (intel_dp->psr.link_standby)
dpcd_val |= DP_PSR_MAIN_LINK_ACTIVE;
@@ -629,15 +637,20 @@ static void intel_psr_enable_sink(struct intel_dp *intel_dp)
dpcd_val |= DP_PSR_CRC_VERIFICATION;
}
+ if (intel_dp->psr.panel_replay_enabled)
+ dpcd_val |= DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN |
+ DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN;
+
if (intel_dp->psr.req_psr2_sdp_prior_scanline)
dpcd_val |= DP_PSR_SU_REGION_SCANLINE_CAPTURE;
if (intel_dp->psr.entry_setup_frames > 0)
dpcd_val |= DP_PSR_FRAME_CAPTURE;
- drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, dpcd_val);
+ drm_dp_dpcd_writeb(&intel_dp->aux, intel_psr_get_enable_sink_offset(intel_dp), dpcd_val);
- drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
+ if (intel_dp_is_edp(intel_dp))
+ drm_dp_dpcd_writeb(&intel_dp->aux, DP_SET_POWER, DP_SET_POWER_D0);
}
static u32 intel_psr1_get_tp_time(struct intel_dp *intel_dp)
--
2.34.1
next prev parent reply other threads:[~2024-01-04 10:49 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 10:48 [PATCH 00/12] Panel replay selective update support Jouni Högander
2024-01-04 10:48 ` [PATCH 01/12] drm/i915/psr: Disable panel replay for now Jouni Högander
2024-01-04 10:48 ` [PATCH 02/12] drm/i915/psr: Do not check alpm on DP or capability change for panel replay Jouni Högander
2024-01-04 10:48 ` Jouni Högander [this message]
2024-01-04 10:48 ` [PATCH 04/12] drm/i915/psr: Rename has_psr2 as has_sel_update Jouni Högander
2024-01-04 10:48 ` [PATCH 05/12] drm/i915/psr: Rename psr2_enabled as sel_update_enabled Jouni Högander
2024-01-04 10:48 ` [PATCH 06/12] drm/i915/psr: Add some documentation of variables used in psr code Jouni Högander
2024-01-04 10:48 ` [PATCH 07/12] drm/i915/psr: Add sink_panel_replay_su_support to intel_psr Jouni Högander
2024-01-04 10:48 ` [PATCH 08/12] drm/i915/psr: Detect panel replay selective update support Jouni Högander
2024-01-04 10:48 ` [PATCH 09/12] drm/i915/psr: Split intel_psr2_config_valid for panel replay Jouni Högander
2024-01-04 10:48 ` [PATCH 10/12] drm/panelreplay: dpcd register definition for panelreplay SU Jouni Högander
2024-01-04 10:59 ` Dmitry Baryshkov
2024-01-10 13:20 ` Hogander, Jouni
2024-01-04 10:48 ` [PATCH 11/12] drm/i915/psr: Modify intel_dp_get_su_granularity to support panel replay Jouni Högander
2024-01-04 10:48 ` [PATCH 12/12] drm/i915/psr: Add panel replay sel update support to debugfs interface Jouni Högander
2024-01-04 13:14 ` ✗ Fi.CI.CHECKPATCH: warning for Panel replay selective update support Patchwork
2024-01-04 13:14 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-01-04 13:33 ` ✓ Fi.CI.BAT: success " Patchwork
2024-01-04 14:45 ` ✗ Fi.CI.IGT: 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=20240104104821.1822988-4-jouni.hogander@intel.com \
--to=jouni.hogander@intel.com \
--cc=intel-gfx@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