diff mbox series

[v3,5/5] drm/i915/panelreplay: Added state checker for panel replay state

Message ID 20211010121039.14725-6-animesh.manna@intel.com (mailing list archive)
State New, archived
Headers show
Series Panel replay phase1 implementation | expand

Commit Message

Animesh Manna Oct. 10, 2021, 12:10 p.m. UTC
has_panel_replay flag is used to check panel replay state
which is part of crtc_state structure.

v1: RFC version.
v2: has_panel_replay flag updated as per hw readout. [Jani]

Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 1 +
 drivers/gpu/drm/i915/display/intel_psr.c     | 6 ++++++
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 4f0badb11bbb..a30b6fe87dfc 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -8136,6 +8136,7 @@  intel_pipe_config_compare(const struct intel_crtc_state *current_config,
 			PIPE_CONF_CHECK_BOOL(has_psr);
 			PIPE_CONF_CHECK_BOOL(has_psr2);
 			PIPE_CONF_CHECK_BOOL(enable_psr2_sel_fetch);
+			PIPE_CONF_CHECK_BOOL(has_panel_replay);
 			PIPE_CONF_CHECK_I(dc3co_exitline);
 		}
 	}
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 49f6242c2fde..d1a30b82ce6f 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1054,6 +1054,12 @@  void intel_psr_get_config(struct intel_encoder *encoder,
 	pipe_config->has_psr2 = intel_dp->psr.psr2_enabled;
 	pipe_config->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_VSC);
 
+	if (HAS_PANEL_REPLAY(dev_priv) && HAS_DP20(dev_priv)) {
+		val = intel_de_read(dev_priv, TRANS_DP2_CTL(intel_dp->psr.transcoder));
+		if (val & TRANS_DP2_PANEL_REPLAY_ENABLE)
+			pipe_config->has_panel_replay = true;
+	}
+
 	if (!intel_dp->psr.psr2_enabled)
 		goto unlock;