Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM
@ 2026-05-18  3:54 Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active Ankit Nautiyal
                   ` (11 more replies)
  0 siblings, 12 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

Enable Adaptive Sync SDP for Panel replay + auxless ALPM.
First few patches are fixes in existing AS SDP enablement and drm core
changes for Panel replay with SDP.
Later patches add the support to send AS SDP for Panel replay with Link
ON and with auxless ALPM (Link-Off). 

This series is in continuation from discussions in [1] [2] [3]
and is actually revision 5 of the series [4].

While sending patches Rev 3 of [4], patchwork encountered an issue and
somehow dropped few patches from the series, and created new patchwork
links with incomplete list of patches for rev 3 and 4. With this CI couldnt
pick up the series for testing.

To avoid further confusion and more patchwork links with missing patches,
I am modifying the subject of the series to create new 'final' patchwork
link (with a hope that patchwork doesn't miss anymore patches) for which
we can get the CI results.

As the first few drm core changes get reviews, I intend to send those
separately and get them merge next.

[1] https://lore.kernel.org/all/1b8c6c6de1e5fe0db83e6ae942dfee7e6f950767.camel@intel.com/
[2] https://lore.kernel.org/all/aPtqdAxDwiuQZbrn@intel.com/
[3] https://lore.kernel.org/intel-gfx/7c2d6f4e-69e6-452a-89cc-5fd4254430bd@intel.com/T/#m6e8beab2cc3b6ff9d61f740f107d83a2f4e08114
[4] https://patchwork.freedesktop.org/series/161977/#rev2

Changes from last revision of Series [4]
 - Add helper to print SDP version in the logs and use it.
 - Fill missing sdp_type field in AS SDP unpack.
 - Check PR support also in helper
   intel_psr_pr_async_video_timing_supported()
 - Add #TODO to check Display ID 2.0 blocks for AS SDP for determining
   AS SDP v2 support.
 - Check if PR is enabled along with AS SDP enable before setting
   relevant Downspread CTRL DPCD bits.

Rev 5:
 - Since all DRM core changes and PCON related fixes are merged, rebase
   the remaining patches.

Ankit Nautiyal (11):
  drm/i915/psr: Add helper to get Async Video timing support in PR
    active
  drm/i915/dp: Add member to intel_dp to store AS SDP v2 support
  drm/i915/dp: Allow AS SDP only if v2 is supported
  drm/i915/psr: Write the PR config DPCDs in burst mode
  drm/i915/display: Add helper for AS SDP transmission time selection
  drm/i915/psr: Program Panel Replay CONFIG3 using AS SDP transmission
    time
  drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless
    ALPM
  drm/i915/dp: Program AS SDP DB[1:0] for PR with Link off
  drm/i915/dp: Split AS SDP computation between compute_config and
    compute_config_late
  drm/i915/dp: Compute and include coasting vtotal for AS SDP
  drm/i915/dp: Always enable AS SDP if supported by source + sink

 drivers/gpu/drm/i915/display/intel_alpm.c     |  20 ++-
 drivers/gpu/drm/i915/display/intel_display.c  |   3 +-
 .../drm/i915/display/intel_display_types.h    |   1 +
 drivers/gpu/drm/i915/display/intel_dp.c       | 152 +++++++++++++++---
 drivers/gpu/drm/i915/display/intel_dp.h       |   2 +
 .../drm/i915/display/intel_dp_link_training.c |  15 +-
 .../drm/i915/display/intel_dp_link_training.h |   3 +-
 drivers/gpu/drm/i915/display/intel_dp_mst.c   |   2 +-
 drivers/gpu/drm/i915/display/intel_psr.c      |  40 +++--
 drivers/gpu/drm/i915/display/intel_psr.h      |   1 +
 10 files changed, 196 insertions(+), 43 deletions(-)

-- 
2.45.2


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-22 14:06   ` Ville Syrjälä
  2026-05-18  3:54 ` [PATCH 02/11] drm/i915/dp: Add member to intel_dp to store AS SDP v2 support Ankit Nautiyal
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

Introduce a helper to check if Panel Replay has Async Video Timing support
during PR Active state.

v2: Confirm that Panel Replay is supported before checking for
    Async Video Timing Support during PR active. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 11 +++++++++++
 drivers/gpu/drm/i915/display/intel_psr.h |  1 +
 2 files changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 892d209dce1b..431468103f51 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -4655,3 +4655,14 @@ bool intel_psr_use_trans_push(const struct intel_crtc_state *crtc_state)
 
 	return HAS_PSR_TRANS_PUSH_FRAME_CHANGE(display) && crtc_state->has_psr;
 }
+
+bool intel_psr_pr_async_video_timing_supported(struct intel_dp *intel_dp)
+{
+	struct intel_connector *connector = intel_dp->attached_connector;
+	u8 *dpcd = connector->dp.panel_replay_caps.dpcd;
+	u8 pr_support = dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_SUPPORT)];
+	u8 pr_cap = dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_CAPABILITY)];
+
+	return (pr_support & DP_PANEL_REPLAY_SUPPORT) &&
+		!(pr_cap & DP_PANEL_REPLAY_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_psr.h b/drivers/gpu/drm/i915/display/intel_psr.h
index 394b641840b3..29723e63888f 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.h
+++ b/drivers/gpu/drm/i915/display/intel_psr.h
@@ -86,5 +86,6 @@ void intel_psr_compute_config_late(struct intel_dp *intel_dp,
 				   struct intel_crtc_state *crtc_state);
 int intel_psr_min_guardband(struct intel_crtc_state *crtc_state);
 bool intel_psr_use_trans_push(const struct intel_crtc_state *crtc_state);
+bool intel_psr_pr_async_video_timing_supported(struct intel_dp *intel_dp);
 
 #endif /* __INTEL_PSR_H__ */
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 02/11] drm/i915/dp: Add member to intel_dp to store AS SDP v2 support
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-22 14:08   ` Ville Syrjälä
  2026-05-18  3:54 ` [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported Ankit Nautiyal
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

eDP v1.5a advertises support for Adaptive Sync SDP and with that the
support for AS SDP v2 is mandatory.

DP v2.1 SCR advertises support for FAVT payload fields parsing in DPCD
0x2214 Bit 2. This indicates the support for Adaptive-Sync SDP version 2
(AS SDP v2), which allows the source to set the version in HB2[4:0] and the
payload length in HB3[5:0] of the AS SDP header.

DP v2.1 SCR also introduces ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR in the
Panel Replay Capability DPCD 0x00b1 (Bit 3). When this bit is set, the sink
does not support asynchronous video timing while in a Panel Replay Active
state and the source is required to keep transmitting Adaptive-Sync
SDPs. The spec mandates that such sinks shall support AS SDP v2.

Infer AS SDP v2 support from these capabilities and store it in
struct intel_dp for use by subsequent feature enablement changes.

v2:
 - Include parsing ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR bit to
   determine AS SDP v2 support. (Ville)
v3:
 - Use helper to determine asynch video timing support.
v4:
 - Add AS SDP v2 support for eDP as per v1.5a.
 - Add a check for Panel Replay support before checking for Async video
   timing support in PR
 - Add a TODO for Display ID and PCON considerations. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 .../drm/i915/display/intel_display_types.h    |  1 +
 drivers/gpu/drm/i915/display/intel_dp.c       | 49 +++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index b7bcf8fefa3e..e9b95879c797 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1871,6 +1871,7 @@ struct intel_dp {
 	/* connector directly attached - won't be use for modeset in mst world */
 	struct intel_connector *attached_connector;
 	bool as_sdp_supported;
+	bool as_sdp_v2_supported;
 
 	struct drm_dp_tunnel *tunnel;
 	bool tunnel_suspended:1;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 1920d2f02666..92a650a728d8 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -6365,6 +6365,46 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
 					       false);
 }
 
+static bool
+intel_dp_sink_supports_as_sdp_v2(struct intel_dp *intel_dp)
+{
+	u8 rx_features;
+
+	/*
+	 * The DP spec does not explicitly provide the AS SDP v2 capability.
+	 * So based on the DP v2.1 SCR, we infer it from the following bits:
+	 *
+	 * DP_AS_SDP_FAVT_PAYLOAD_FIELDS_PARSING_SUPPORTED indicates support for
+	 * FAVT, which is explicitly defined to use AS SDP v2.
+	 *
+	 * DP_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR indicates that the sink
+	 * does not support asynchronous video timing while in PR Active,
+	 * requiring the source to keep transmitting Adaptive-Sync SDPs. The
+	 * spec mandates that such sinks shall support AS SDP v2.
+	 *
+	 * #TODO: Check the Adaptive-Sync DisplayID 2.1 block once DisplayID
+	 * parsing is available. This may help detect AS SDP v2 support for
+	 * native DP 2.1 sinks that do not expose FAVT or PR-based capability
+	 * bits.
+	 *
+	 * In the presence of PCONs, check PCON support from DPCD and sink
+	 * support from Display ID.
+	 */
+
+	if (drm_dp_dpcd_read_byte(&intel_dp->aux,
+				  DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1,
+				  &rx_features) == 1) {
+		if (rx_features & DP_AS_SDP_FAVT_PAYLOAD_FIELDS_PARSING_SUPPORTED)
+			return true;
+	}
+
+	if (intel_dp->psr.sink_panel_replay_support &&
+	    !intel_psr_pr_async_video_timing_supported(intel_dp))
+		return true;
+
+	return false;
+}
+
 static void
 intel_dp_detect_sdp_caps(struct intel_dp *intel_dp)
 {
@@ -6372,6 +6412,15 @@ intel_dp_detect_sdp_caps(struct intel_dp *intel_dp)
 
 	intel_dp->as_sdp_supported = HAS_AS_SDP(display) &&
 		drm_dp_as_sdp_supported(&intel_dp->aux, intel_dp->dpcd);
+
+	if (!intel_dp->as_sdp_supported)
+		return;
+
+	/* eDP Adaptive-Sync SDP always uses AS SDP v2 */
+	if (intel_dp_is_edp(intel_dp))
+		intel_dp->as_sdp_v2_supported =  true;
+	else
+		intel_dp->as_sdp_v2_supported = intel_dp_sink_supports_as_sdp_v2(intel_dp);
 }
 
 static bool intel_dp_needs_dpcd_probe(struct intel_dp *intel_dp, bool force_on_external)
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 02/11] drm/i915/dp: Add member to intel_dp to store AS SDP v2 support Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-22 14:10   ` Ville Syrjälä
  2026-05-18  3:54 ` [PATCH 04/11] drm/i915/psr: Write the PR config DPCDs in burst mode Ankit Nautiyal
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

We do not support AS SDP version 1, so allow AS SDP only if AS SDP v2 is
supported.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 92a650a728d8..d1b40db7e2a3 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3172,7 +3172,7 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc
 static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
 				  struct intel_crtc_state *crtc_state)
 {
-	if (!intel_dp->as_sdp_supported)
+	if (!intel_dp->as_sdp_v2_supported)
 		return false;
 
 	/*
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 04/11] drm/i915/psr: Write the PR config DPCDs in burst mode
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (2 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 05/11] drm/i915/display: Add helper for AS SDP transmission time selection Ankit Nautiyal
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

Replace the consecutive single-byte writes to PANEL_REPLAY_CONFIG and
CONFIG2 with one drm_dp_dpcd_write() burst starting at PANEL_REPLAY_CONFIG,
reducing AUX transactions.

v2: Drop extra conditions, and optimize variables. (Ville)
v3: Drop the error check after write. (Ville)

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 26 ++++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 431468103f51..363349bdb529 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -786,27 +786,27 @@ static bool psr2_su_region_et_valid(struct intel_connector *connector, bool pane
 static void _panel_replay_enable_sink(struct intel_dp *intel_dp,
 				      const struct intel_crtc_state *crtc_state)
 {
-	u8 val = DP_PANEL_REPLAY_ENABLE |
-		DP_PANEL_REPLAY_VSC_SDP_CRC_EN |
-		DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN |
-		DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN |
-		DP_PANEL_REPLAY_ACTIVE_FRAME_CRC_ERROR_EN;
-	u8 panel_replay_config2 = DP_PANEL_REPLAY_CRC_VERIFICATION;
+	u8 panel_replay_config[2];
+
+	panel_replay_config[0] = DP_PANEL_REPLAY_ENABLE |
+				 DP_PANEL_REPLAY_VSC_SDP_CRC_EN |
+				 DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN |
+				 DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN |
+				 DP_PANEL_REPLAY_ACTIVE_FRAME_CRC_ERROR_EN;
+	panel_replay_config[1] = DP_PANEL_REPLAY_CRC_VERIFICATION;
 
 	if (crtc_state->has_sel_update)
-		val |= DP_PANEL_REPLAY_SU_ENABLE;
+		panel_replay_config[0] |= DP_PANEL_REPLAY_SU_ENABLE;
 
 	if (crtc_state->enable_psr2_su_region_et)
-		val |= DP_PANEL_REPLAY_ENABLE_SU_REGION_ET;
+		panel_replay_config[0] |= DP_PANEL_REPLAY_ENABLE_SU_REGION_ET;
 
 	if (crtc_state->req_psr2_sdp_prior_scanline)
-		panel_replay_config2 |=
+		panel_replay_config[1] |=
 			DP_PANEL_REPLAY_SU_REGION_SCANLINE_CAPTURE;
 
-	drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG, val);
-
-	drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG2,
-			   panel_replay_config2);
+	drm_dp_dpcd_write(&intel_dp->aux, PANEL_REPLAY_CONFIG,
+			  panel_replay_config, sizeof(panel_replay_config));
 }
 
 static void _psr_enable_sink(struct intel_dp *intel_dp,
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 05/11] drm/i915/display: Add helper for AS SDP transmission time selection
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (3 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 04/11] drm/i915/psr: Write the PR config DPCDs in burst mode Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 06/11] drm/i915/psr: Program Panel Replay CONFIG3 using AS SDP transmission time Ankit Nautiyal
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

AS SDP may be transmitted at T1 or T2 depending on Panel Replay and
Adaptive Sync SDP configuration as per DP 2.1. Current we are using
T1 only, but future PR/AS SDP modes/features may require T2 or dynamic
selection.

Introduce a helper to return the appropriate AS SDP transmission time so
that a single value is consistently used for programming PR_ALPM.
For now this returns T1.

v2: Avoid adding new member to crtc_state; use a helper. (Ville)
v3: Clarify why AS SDP transmission time is fixed to T1. (Ville)
v4: Return u8 from intel_dp_as_sdp_transmission_time(). (Ville)

Bspec: 68920
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_alpm.c | 20 +++++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_dp.c   | 11 +++++++++++
 drivers/gpu/drm/i915/display/intel_dp.h   |  2 ++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
index a7350ce8e716..c6963ea420cc 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -11,6 +11,7 @@
 #include "intel_crtc.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
+#include "intel_display_utils.h"
 #include "intel_dp.h"
 #include "intel_dp_aux.h"
 #include "intel_psr.h"
@@ -359,6 +360,23 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
 	crtc_state->has_lobf = true;
 }
 
+static u32 get_pr_alpm_as_sdp_transmission_time(const struct intel_crtc_state *crtc_state)
+{
+	u8 as_sdp_setup_time = intel_dp_as_sdp_transmission_time();
+
+	switch (as_sdp_setup_time) {
+	case DP_PR_AS_SDP_SETUP_TIME_T1:
+		return PR_ALPM_CTL_ADAPTIVE_SYNC_SDP_POSITION_T1;
+	case DP_PR_AS_SDP_SETUP_TIME_DYNAMIC:
+		return PR_ALPM_CTL_ADAPTIVE_SYNC_SDP_POSITION_T1_OR_T2;
+	case DP_PR_AS_SDP_SETUP_TIME_T2:
+		return PR_ALPM_CTL_ADAPTIVE_SYNC_SDP_POSITION_T2;
+	default:
+		MISSING_CASE(as_sdp_setup_time);
+		return PR_ALPM_CTL_ADAPTIVE_SYNC_SDP_POSITION_T1;
+	}
+}
+
 static void lnl_alpm_configure(struct intel_dp *intel_dp,
 			       const struct intel_crtc_state *crtc_state)
 {
@@ -382,7 +400,7 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp,
 			ALPM_CTL_AUX_LESS_WAKE_TIME(crtc_state->alpm_state.aux_less_wake_lines);
 
 		if (intel_dp->as_sdp_supported) {
-			u32 pr_alpm_ctl = PR_ALPM_CTL_ADAPTIVE_SYNC_SDP_POSITION_T1;
+			u32 pr_alpm_ctl = get_pr_alpm_as_sdp_transmission_time(crtc_state);
 
 			if (crtc_state->link_off_after_as_sdp_when_pr_active)
 				pr_alpm_ctl |= PR_ALPM_CTL_ALLOW_LINK_OFF_BETWEEN_AS_SDP_AND_SU;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index d1b40db7e2a3..7f243463bf7b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -7555,3 +7555,14 @@ bool intel_dp_joiner_candidate_valid(struct intel_connector *connector,
 
 	return true;
 }
+
+u8 intel_dp_as_sdp_transmission_time(void)
+{
+	/*
+	 * DP allows AS SDP position to move during PR active in some cases, but
+	 * software-controlled refresh rate changes with DC6v / ALPM require the
+	 * AS SDP to remain at T1. Use T1 unconditionally for now.
+	 */
+
+	return DP_PR_AS_SDP_SETUP_TIME_T1;
+}
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index f41480d24714..46a7f5c70981 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -241,4 +241,6 @@ bool intel_dp_joiner_candidate_valid(struct intel_connector *connector,
 	for ((__num_joined_pipes) = 1; (__num_joined_pipes) <= (I915_MAX_PIPES); (__num_joined_pipes)++) \
 		for_each_if(intel_dp_joiner_candidate_valid(__connector, (__mode)->hdisplay, __num_joined_pipes))
 
+u8 intel_dp_as_sdp_transmission_time(void);
+
 #endif /* __INTEL_DP_H__ */
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 06/11] drm/i915/psr: Program Panel Replay CONFIG3 using AS SDP transmission time
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (4 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 05/11] drm/i915/display: Add helper for AS SDP transmission time selection Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 07/11] drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM Ankit Nautiyal
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

Panel Replay requires the AS SDP transmission time to be written into
PANEL_REPLAY_CONFIG3. This field was previously not programmed.

Use the AS SDP transmission-time helper to populate CONFIG3.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 363349bdb529..8f70b7dcd881 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -787,6 +787,7 @@ static void _panel_replay_enable_sink(struct intel_dp *intel_dp,
 				      const struct intel_crtc_state *crtc_state)
 {
 	u8 panel_replay_config[2];
+	u8 panel_replay_config_3;
 
 	panel_replay_config[0] = DP_PANEL_REPLAY_ENABLE |
 				 DP_PANEL_REPLAY_VSC_SDP_CRC_EN |
@@ -794,7 +795,6 @@ static void _panel_replay_enable_sink(struct intel_dp *intel_dp,
 				 DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN |
 				 DP_PANEL_REPLAY_ACTIVE_FRAME_CRC_ERROR_EN;
 	panel_replay_config[1] = DP_PANEL_REPLAY_CRC_VERIFICATION;
-
 	if (crtc_state->has_sel_update)
 		panel_replay_config[0] |= DP_PANEL_REPLAY_SU_ENABLE;
 
@@ -807,6 +807,9 @@ static void _panel_replay_enable_sink(struct intel_dp *intel_dp,
 
 	drm_dp_dpcd_write(&intel_dp->aux, PANEL_REPLAY_CONFIG,
 			  panel_replay_config, sizeof(panel_replay_config));
+
+	panel_replay_config_3 = intel_dp_as_sdp_transmission_time();
+	drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG3, panel_replay_config_3);
 }
 
 static void _psr_enable_sink(struct intel_dp *intel_dp,
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 07/11] drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (5 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 06/11] drm/i915/psr: Program Panel Replay CONFIG3 using AS SDP transmission time Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-22 15:08   ` Ville Syrjälä
  2026-05-18  3:54 ` [PATCH 08/11] drm/i915/dp: Program AS SDP DB[1:0] for PR with Link off Ankit Nautiyal
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

If a Panel Replay capable sink, supports Async Video timing in
PR active state, then source does not necessarily need to send AS SDPs
during PR active.

However, if asynchronous video timing is not supported, then for PR with
Aux-less ALPM, the source must transmit Adaptive-Sync SDPs for video
timing synchronization while PR is active.

If the source needs to send AS SDP during PR active, this requires setting
DPCD 0x0107[6] (FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE). This applies whether
VRR is enabled (AVT/FAVT) or fixed-timing mode is used.

This bit defines AS SDP timing behavior during PR Active, even if AS SDPs
are briefly suspended.

Program the relevant Downspread Ctrl DPCD bits accordingly.

v2: Instead of Panel Replay check simply use AS SDP enable check. (Ville)
v3: Since the bit is defined in context of Panel Replay and AS SDP, add
    a check for both. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 .../gpu/drm/i915/display/intel_dp_link_training.c | 15 +++++++++++++--
 .../gpu/drm/i915/display/intel_dp_link_training.h |  3 ++-
 drivers/gpu/drm/i915/display/intel_dp_mst.c       |  2 +-
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index a26094223f78..d0b033d2cfb4 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -34,8 +34,10 @@
 #include "intel_dp.h"
 #include "intel_dp_link_training.h"
 #include "intel_encoder.h"
+#include "intel_hdmi.h"
 #include "intel_hotplug.h"
 #include "intel_panel.h"
+#include "intel_psr.h"
 
 #define LT_MSG_PREFIX			"[CONNECTOR:%d:%s][ENCODER:%d:%s][%s] "
 #define LT_MSG_ARGS(_intel_dp, _dp_phy)	(_intel_dp)->attached_connector->base.base.id, \
@@ -710,11 +712,14 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp,
 	return true;
 }
 
-void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate, bool is_vrr)
+void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate,
+				     bool is_vrr,
+				     bool pr_with_as_sdp_enable)
 {
 	u8 link_config[2];
 
 	link_config[0] = is_vrr ? DP_MSA_TIMING_PAR_IGNORE_EN : 0;
+	link_config[0] |= pr_with_as_sdp_enable ? DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE : 0;
 	link_config[1] = drm_dp_is_uhbr_rate(link_rate) ?
 			 DP_SET_ANSI_128B132B : DP_SET_ANSI_8B10B;
 	drm_dp_dpcd_write(&intel_dp->aux, DP_DOWNSPREAD_CTRL, link_config, 2);
@@ -723,6 +728,10 @@ void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate, b
 static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
 					    const struct intel_crtc_state *crtc_state)
 {
+	bool pr_with_as_sdp_enable =
+		intel_psr_needs_alpm_aux_less(intel_dp, crtc_state) &&
+		crtc_state->infoframes.enable & intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
+
 	 /*
 	  * Currently, we set the MSA ignore bit based on vrr.in_range.
 	  * We can't really read that out during driver load since we don't have
@@ -737,7 +746,9 @@ static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
 	  * especially on the first real commit when clearing the inherited flag.
 	  */
 	intel_dp_link_training_set_mode(intel_dp,
-					crtc_state->port_clock, crtc_state->vrr.in_range);
+					crtc_state->port_clock,
+					crtc_state->vrr.in_range,
+					pr_with_as_sdp_enable);
 }
 
 void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.h b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
index 33dcbde6a408..18c34c1a472f 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.h
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
@@ -18,7 +18,8 @@ int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp);
 bool intel_dp_lttpr_transparent_mode_enabled(struct intel_dp *intel_dp);
 
 void intel_dp_link_training_set_mode(struct intel_dp *intel_dp,
-				     int link_rate, bool is_vrr);
+				     int link_rate, bool is_vrr,
+				     bool pr_with_as_sdp_enable);
 void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
 				   int link_bw, int rate_select, int lane_count,
 				   bool enhanced_framing, bool post_lt_adj_req);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 8f73e01db17c..a238f7948cec 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -2145,7 +2145,7 @@ void intel_dp_mst_prepare_probe(struct intel_dp *intel_dp)
 
 	intel_dp_compute_rate(intel_dp, link_rate, &link_bw, &rate_select);
 
-	intel_dp_link_training_set_mode(intel_dp, link_rate, false);
+	intel_dp_link_training_set_mode(intel_dp, link_rate, false, false);
 	intel_dp_link_training_set_bw(intel_dp, link_bw, rate_select, lane_count,
 				      drm_dp_enhanced_frame_cap(intel_dp->dpcd), false);
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 08/11] drm/i915/dp: Program AS SDP DB[1:0] for PR with Link off
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (6 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 07/11] drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-18  3:54 ` [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late Ankit Nautiyal
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

For Panel Replay with AUX-less ALPM (link-off PR), the source must send
Adaptive-Sync SDP v2. Program DB[1:0] per DP spec v2.1:
- VRR AVT: 00b (variable VTotal)
- VRR FAVT: 10b/11b (TRR not reached/reached)
- Fixed timing with PR link-off (VRR off): 01b (AS disabled; VTotal fixed)

Also, drop the redundant target_rr assignment.

v2: Fix the else case. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 7f243463bf7b..8d0d04f306a7 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3211,9 +3211,10 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
 		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
 		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
 		as_sdp->target_rr_divider = true;
-	} else {
+	} else if (crtc_state->vrr.enable) {
 		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
-		as_sdp->target_rr = 0;
+	} else {
+		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
 	}
 }
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (7 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 08/11] drm/i915/dp: Program AS SDP DB[1:0] for PR with Link off Ankit Nautiyal
@ 2026-05-18  3:54 ` Ankit Nautiyal
  2026-05-22 15:24   ` Ville Syrjälä
  2026-05-18  3:55 ` [PATCH 10/11] drm/i915/dp: Compute and include coasting vtotal for AS SDP Ankit Nautiyal
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:54 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

Currently we enable AS SDP only when VRR is enabled. As we start using
AS SDP for other features, this becomes a problem. The AS SDP
configuration can change dynamically based on VRR, CMRR, PR, ALPM, etc.
Since these features may be enabled or disabled after the initial
configuration, the AS SDP parameters need to be computed later in the
pipeline.

However, not all of the AS SDP logic can be moved to the late stage:
the VRR guardband optimization depends on knowing early whether AS SDP
can be used. Without this, we would end up accounting for AS SDP on all
platforms that support it, even for panels that do not support AS SDP.
Therefore we set the infoframe enable bit for AS SDP during
compute_config(), before the guardband is computed.

To handle these constraints, split the AS SDP programming into two
phases:

 - intel_dp_compute_as_sdp()
   Runs during compute_config().
   Sets only the infoframe enable bit so that the guardband logic can
   account for AS SDP requirements.

 - intel_dp_as_sdp_compute_config_late()
   Runs during compute_config_late().
   Computes all remaining AS SDP fields based on the features that need
   it.

The late-stage computation is called from
intel_dp_sdp_compute_config_late(), before computing the minimum guardband
for SDPs.

This is a preparatory change. A subsequent patches will compute PR related
AS SDP fields and enable AS SDP not only for VRR but for other features
as well.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 66 ++++++++++++++++---------
 1 file changed, 43 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 8d0d04f306a7..c1c6f394eb0b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3187,10 +3187,6 @@ static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
 static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
 				    struct intel_crtc_state *crtc_state)
 {
-	struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
-	const struct drm_display_mode *adjusted_mode =
-		&crtc_state->hw.adjusted_mode;
-
 	/*
 	 * #FIXME: SDP/infoframe updates aren’t truly atomic, and with the new
 	 * cdclk->tc clock crossing we may transiently send a corrupted packet
@@ -3199,23 +3195,13 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
 	if (!intel_dp_needs_as_sdp(intel_dp, crtc_state))
 		return;
 
+	/*
+	 * Only set the infoframes.enable flag here. The remaining AS SDP fields
+	 * are programmed in the compute_config_late() phase. We need this flag
+	 * early so that the VRR guardband calculation can properly account for
+	 * AS SDP requirements.
+	 */
 	crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
-
-	as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
-	as_sdp->length = 0x9;
-	as_sdp->duration_incr_ms = 0;
-	as_sdp->revision = 0x2;
-	as_sdp->vtotal = intel_vrr_vmin_vtotal(crtc_state);
-
-	if (crtc_state->cmrr.enable) {
-		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
-		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
-		as_sdp->target_rr_divider = true;
-	} else if (crtc_state->vrr.enable) {
-		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
-	} else {
-		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
-	}
 }
 
 static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,
@@ -7459,11 +7445,45 @@ void intel_dp_mst_resume(struct intel_display *display)
 }
 
 static
-int intel_dp_sdp_compute_config_late(struct intel_crtc_state *crtc_state)
+void intel_dp_as_sdp_compute_config_late(struct intel_dp *intel_dp,
+					 struct intel_crtc_state *crtc_state)
+{
+	struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
+	const struct drm_display_mode *adjusted_mode =
+		&crtc_state->hw.adjusted_mode;
+
+	if ((crtc_state->infoframes.enable &
+	    intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC)) == 0)
+		return;
+
+	as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
+	as_sdp->length = 0x9;
+	as_sdp->duration_incr_ms = 0;
+	as_sdp->revision = 0x2;
+	as_sdp->vtotal = intel_vrr_vmin_vtotal(crtc_state);
+
+	if (crtc_state->cmrr.enable) {
+		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
+		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
+		as_sdp->target_rr_divider = true;
+	} else if (crtc_state->vrr.enable) {
+		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
+	} else {
+		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
+	}
+}
+
+static
+int intel_dp_sdp_compute_config_late(struct intel_dp *intel_dp,
+				     struct intel_crtc_state *crtc_state)
 {
 	struct intel_display *display = to_intel_display(crtc_state);
 	int guardband = intel_crtc_vblank_length(crtc_state);
-	int min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
+	int min_sdp_guardband;
+
+	intel_dp_as_sdp_compute_config_late(intel_dp, crtc_state);
+
+	min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
 
 	if (guardband < min_sdp_guardband) {
 		drm_dbg_kms(display->drm, "guardband %d < min sdp guardband %d\n",
@@ -7483,7 +7503,7 @@ int intel_dp_compute_config_late(struct intel_encoder *encoder,
 
 	intel_psr_compute_config_late(intel_dp, crtc_state);
 
-	ret = intel_dp_sdp_compute_config_late(crtc_state);
+	ret = intel_dp_sdp_compute_config_late(intel_dp, crtc_state);
 	if (ret)
 		return ret;
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 10/11] drm/i915/dp: Compute and include coasting vtotal for AS SDP
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (8 preceding siblings ...)
  2026-05-18  3:54 ` [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late Ankit Nautiyal
@ 2026-05-18  3:55 ` Ankit Nautiyal
  2026-05-23  4:34   ` Nautiyal, Ankit K
  2026-05-18  3:55 ` [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink Ankit Nautiyal
  2026-05-18  5:44 ` ✓ i915.CI.BAT: success for Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM (rev2) Patchwork
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:55 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

DP v2.1 allows the source to temporarily suspend Adaptive-Sync SDP
transmission while Panel Replay is active when the sink supports
asynchronous video timing.

In such cases, the sink relies on the last transmitted AS SDP timing
information to maintain the refresh rate. To support this behavior,
compute and populate the coasting vtotal field in the AS SDP payload.

Include coasting vtotal in AS SDP packing, unpacking, and comparison,
and set it during late AS SDP configuration for PR with Aux-less ALPM
when asynchronous video timing is supported.

Note:
The coasting vtotal value is fully under driver control i.e. the HW does
not overwrite these payload bytes. HW only samples the PR_ALPM_CTL[AS SDP
Transmission in Active Disable] bit during PR active state and reflects it
in the AS SDP payload at the appropriate time.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c |  3 ++-
 drivers/gpu/drm/i915/display/intel_dp.c      | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 757a78c75bbf..043d1c667379 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -4889,7 +4889,8 @@ intel_compare_dp_as_sdp(const struct drm_dp_as_sdp *a,
 		a->duration_incr_ms == b->duration_incr_ms &&
 		a->duration_decr_ms == b->duration_decr_ms &&
 		a->target_rr_divider == b->target_rr_divider &&
-		a->mode == b->mode;
+		a->mode == b->mode &&
+		a->coasting_vtotal == b->coasting_vtotal;
 }
 
 static bool
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index c1c6f394eb0b..69eb474fede7 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5181,6 +5181,9 @@ static ssize_t intel_dp_as_sdp_pack(const struct drm_dp_as_sdp *as_sdp,
 	if (as_sdp->target_rr_divider)
 		sdp->db[4] |= 0x20;
 
+	sdp->db[7] = as_sdp->coasting_vtotal & 0xFF;
+	sdp->db[8] = (as_sdp->coasting_vtotal >> 8) & 0xFF;
+
 	return length;
 }
 
@@ -5365,6 +5368,7 @@ int intel_dp_as_sdp_unpack(struct drm_dp_as_sdp *as_sdp,
 	as_sdp->vtotal = (sdp->db[2] << 8) | sdp->db[1];
 	as_sdp->target_rr = ((sdp->db[4] & 0x3) << 8) | sdp->db[3];
 	as_sdp->target_rr_divider = sdp->db[4] & 0x20 ? true : false;
+	as_sdp->coasting_vtotal = (sdp->db[8] << 8) | sdp->db[7];
 
 	return 0;
 }
@@ -7471,6 +7475,21 @@ void intel_dp_as_sdp_compute_config_late(struct intel_dp *intel_dp,
 	} else {
 		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
 	}
+
+	/*
+	 * For Panel Replay with Async Video Timing support, the source can
+	 * disable sending the AS SDP during PR Active state. In that case,
+	 * the sink needs the coasting vtotal value to maintain the refresh
+	 * rate.
+	 *
+	 * #TODO:
+	 * If we ever advertise support for coasting at other refresh targets,
+	 * this logic could be revisited. For now, use the minimum refresh rate
+	 * as the only safe coasting value.
+	 */
+	if (intel_alpm_is_alpm_aux_less(intel_dp, crtc_state) &&
+	    intel_psr_pr_async_video_timing_supported(intel_dp))
+		as_sdp->coasting_vtotal = crtc_state->vrr.vmax;
 }
 
 static
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (9 preceding siblings ...)
  2026-05-18  3:55 ` [PATCH 10/11] drm/i915/dp: Compute and include coasting vtotal for AS SDP Ankit Nautiyal
@ 2026-05-18  3:55 ` Ankit Nautiyal
  2026-05-22 15:25   ` Ville Syrjälä
  2026-05-18  5:44 ` ✓ i915.CI.BAT: success for Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM (rev2) Patchwork
  11 siblings, 1 reply; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-18  3:55 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

Currently AS SDP is only configured when VRR is enabled. However, other
use cases like CMRR, Panel Replay, etc. also send information to the sink
via AS SDPs.

With optimized guardband, we also need to account for wakeup time and other
relevant details that depend on the AS SDP position whenever AS SDP is
enabled. If a feature enabling AS SDP gets turned on later (after modeset),
the guardband might not be sufficient and may need to increase, triggering
a full modeset.

To avoid this, always send AS SDP whenever:
 - the source and sink both support it, AND,
 - there is a possibility to use it for VRR and Panel Replay for
   synchronization.

v2: Check if AS SDP can be used for synchronization for VRR or PR. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 69eb474fede7..2c1dbcb0a2ca 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3181,7 +3181,11 @@ static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
 	if (drm_dp_is_branch(intel_dp->dpcd))
 		return false;
 
-	return crtc_state->vrr.enable;
+	if (intel_alpm_is_alpm_aux_less(intel_dp, crtc_state) &&
+	    !intel_psr_pr_async_video_timing_supported(intel_dp))
+		return true;
+
+	return intel_vrr_possible(crtc_state);
 }
 
 static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* ✓ i915.CI.BAT: success for Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM (rev2)
  2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
                   ` (10 preceding siblings ...)
  2026-05-18  3:55 ` [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink Ankit Nautiyal
@ 2026-05-18  5:44 ` Patchwork
  11 siblings, 0 replies; 23+ messages in thread
From: Patchwork @ 2026-05-18  5:44 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx

[-- Attachment #1: Type: text/plain, Size: 3830 bytes --]

== Series Details ==

Series: Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM (rev2)
URL   : https://patchwork.freedesktop.org/series/164512/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_18501 -> Patchwork_164512v2
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/index.html

Participating hosts (42 -> 40)
------------------------------

  Missing    (2): bat-dg2-13 fi-snb-2520m 

Known issues
------------

  Here are the changes found in Patchwork_164512v2 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@core_hotunplug@unbind-rebind:
    - bat-rpls-4:         [PASS][1] -> [DMESG-WARN][2] ([i915#13400])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-rpls-4/igt@core_hotunplug@unbind-rebind.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-rpls-4/igt@core_hotunplug@unbind-rebind.html

  
#### Possible fixes ####

  * igt@i915_selftest@live:
    - bat-mtlp-8:         [DMESG-FAIL][3] ([i915#12061]) -> [PASS][4] +1 other test pass
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-mtlp-8/igt@i915_selftest@live.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-mtlp-8/igt@i915_selftest@live.html
    - bat-dg2-8:          [DMESG-FAIL][5] ([i915#12061]) -> [PASS][6] +1 other test pass
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-dg2-8/igt@i915_selftest@live.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-dg2-8/igt@i915_selftest@live.html

  * igt@i915_selftest@live@mman:
    - bat-atsm-1:         [DMESG-FAIL][7] ([i915#14204]) -> [PASS][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-atsm-1/igt@i915_selftest@live@mman.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-atsm-1/igt@i915_selftest@live@mman.html

  * igt@i915_selftest@live@workarounds:
    - bat-dg2-9:          [DMESG-FAIL][9] ([i915#12061]) -> [PASS][10] +1 other test pass
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-dg2-9/igt@i915_selftest@live@workarounds.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-dg2-9/igt@i915_selftest@live@workarounds.html
    - bat-dg2-14:         [DMESG-FAIL][11] ([i915#12061]) -> [PASS][12] +1 other test pass
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-dg2-14/igt@i915_selftest@live@workarounds.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-dg2-14/igt@i915_selftest@live@workarounds.html

  
#### Warnings ####

  * igt@i915_selftest@live:
    - bat-atsm-1:         [DMESG-FAIL][13] ([i915#12061] / [i915#14204]) -> [DMESG-FAIL][14] ([i915#12061])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_18501/bat-atsm-1/igt@i915_selftest@live.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/bat-atsm-1/igt@i915_selftest@live.html

  
  [i915#12061]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/12061
  [i915#13400]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13400
  [i915#14204]: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/14204


Build changes
-------------

  * Linux: CI_DRM_18501 -> Patchwork_164512v2

  CI-20190529: 20190529
  CI_DRM_18501: 797d0aca0868ffe43518f35cc490c77cfeeef338 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_8917: 65d691069f26fc2a42c79e2364241320b85d48bc @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_164512v2: 797d0aca0868ffe43518f35cc490c77cfeeef338 @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_164512v2/index.html

[-- Attachment #2: Type: text/html, Size: 4988 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active
  2026-05-18  3:54 ` [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active Ankit Nautiyal
@ 2026-05-22 14:06   ` Ville Syrjälä
  0 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjälä @ 2026-05-22 14:06 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna

On Mon, May 18, 2026 at 09:24:51AM +0530, Ankit Nautiyal wrote:
> Introduce a helper to check if Panel Replay has Async Video Timing support
> during PR Active state.
> 
> v2: Confirm that Panel Replay is supported before checking for
>     Async Video Timing Support during PR active. (Ville)
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_psr.c | 11 +++++++++++
>  drivers/gpu/drm/i915/display/intel_psr.h |  1 +
>  2 files changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index 892d209dce1b..431468103f51 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -4655,3 +4655,14 @@ bool intel_psr_use_trans_push(const struct intel_crtc_state *crtc_state)
>  
>  	return HAS_PSR_TRANS_PUSH_FRAME_CHANGE(display) && crtc_state->has_psr;
>  }
> +
> +bool intel_psr_pr_async_video_timing_supported(struct intel_dp *intel_dp)
> +{
> +	struct intel_connector *connector = intel_dp->attached_connector;
> +	u8 *dpcd = connector->dp.panel_replay_caps.dpcd;
> +	u8 pr_support = dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_SUPPORT)];
> +	u8 pr_cap = dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_CAPABILITY)];
> +
> +	return (pr_support & DP_PANEL_REPLAY_SUPPORT) &&
> +		!(pr_cap & DP_PANEL_REPLAY_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR);
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.h b/drivers/gpu/drm/i915/display/intel_psr.h
> index 394b641840b3..29723e63888f 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.h
> +++ b/drivers/gpu/drm/i915/display/intel_psr.h
> @@ -86,5 +86,6 @@ void intel_psr_compute_config_late(struct intel_dp *intel_dp,
>  				   struct intel_crtc_state *crtc_state);
>  int intel_psr_min_guardband(struct intel_crtc_state *crtc_state);
>  bool intel_psr_use_trans_push(const struct intel_crtc_state *crtc_state);
> +bool intel_psr_pr_async_video_timing_supported(struct intel_dp *intel_dp);
>  
>  #endif /* __INTEL_PSR_H__ */
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 02/11] drm/i915/dp: Add member to intel_dp to store AS SDP v2 support
  2026-05-18  3:54 ` [PATCH 02/11] drm/i915/dp: Add member to intel_dp to store AS SDP v2 support Ankit Nautiyal
@ 2026-05-22 14:08   ` Ville Syrjälä
  0 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjälä @ 2026-05-22 14:08 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna

On Mon, May 18, 2026 at 09:24:52AM +0530, Ankit Nautiyal wrote:
> eDP v1.5a advertises support for Adaptive Sync SDP and with that the
> support for AS SDP v2 is mandatory.
> 
> DP v2.1 SCR advertises support for FAVT payload fields parsing in DPCD
> 0x2214 Bit 2. This indicates the support for Adaptive-Sync SDP version 2
> (AS SDP v2), which allows the source to set the version in HB2[4:0] and the
> payload length in HB3[5:0] of the AS SDP header.
> 
> DP v2.1 SCR also introduces ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR in the
> Panel Replay Capability DPCD 0x00b1 (Bit 3). When this bit is set, the sink
> does not support asynchronous video timing while in a Panel Replay Active
> state and the source is required to keep transmitting Adaptive-Sync
> SDPs. The spec mandates that such sinks shall support AS SDP v2.
> 
> Infer AS SDP v2 support from these capabilities and store it in
> struct intel_dp for use by subsequent feature enablement changes.
> 
> v2:
>  - Include parsing ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR bit to
>    determine AS SDP v2 support. (Ville)
> v3:
>  - Use helper to determine asynch video timing support.
> v4:
>  - Add AS SDP v2 support for eDP as per v1.5a.
>  - Add a check for Panel Replay support before checking for Async video
>    timing support in PR
>  - Add a TODO for Display ID and PCON considerations. (Ville)
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  .../drm/i915/display/intel_display_types.h    |  1 +
>  drivers/gpu/drm/i915/display/intel_dp.c       | 49 +++++++++++++++++++
>  2 files changed, 50 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index b7bcf8fefa3e..e9b95879c797 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1871,6 +1871,7 @@ struct intel_dp {
>  	/* connector directly attached - won't be use for modeset in mst world */
>  	struct intel_connector *attached_connector;
>  	bool as_sdp_supported;
> +	bool as_sdp_v2_supported;
>  
>  	struct drm_dp_tunnel *tunnel;
>  	bool tunnel_suspended:1;
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 1920d2f02666..92a650a728d8 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -6365,6 +6365,46 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
>  					       false);
>  }
>  
> +static bool
> +intel_dp_sink_supports_as_sdp_v2(struct intel_dp *intel_dp)
> +{
> +	u8 rx_features;
> +
> +	/*
> +	 * The DP spec does not explicitly provide the AS SDP v2 capability.
> +	 * So based on the DP v2.1 SCR, we infer it from the following bits:
> +	 *
> +	 * DP_AS_SDP_FAVT_PAYLOAD_FIELDS_PARSING_SUPPORTED indicates support for
> +	 * FAVT, which is explicitly defined to use AS SDP v2.
> +	 *
> +	 * DP_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR indicates that the sink
> +	 * does not support asynchronous video timing while in PR Active,
> +	 * requiring the source to keep transmitting Adaptive-Sync SDPs. The
> +	 * spec mandates that such sinks shall support AS SDP v2.
> +	 *
> +	 * #TODO: Check the Adaptive-Sync DisplayID 2.1 block once DisplayID
> +	 * parsing is available. This may help detect AS SDP v2 support for
> +	 * native DP 2.1 sinks that do not expose FAVT or PR-based capability
> +	 * bits.
> +	 *
> +	 * In the presence of PCONs, check PCON support from DPCD and sink
> +	 * support from Display ID.
> +	 */
> +
> +	if (drm_dp_dpcd_read_byte(&intel_dp->aux,
> +				  DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1,
> +				  &rx_features) == 1) {
> +		if (rx_features & DP_AS_SDP_FAVT_PAYLOAD_FIELDS_PARSING_SUPPORTED)
> +			return true;
> +	}
> +
> +	if (intel_dp->psr.sink_panel_replay_support &&
> +	    !intel_psr_pr_async_video_timing_supported(intel_dp))
> +		return true;
> +
> +	return false;
> +}
> +
>  static void
>  intel_dp_detect_sdp_caps(struct intel_dp *intel_dp)
>  {
> @@ -6372,6 +6412,15 @@ intel_dp_detect_sdp_caps(struct intel_dp *intel_dp)
>  
>  	intel_dp->as_sdp_supported = HAS_AS_SDP(display) &&
>  		drm_dp_as_sdp_supported(&intel_dp->aux, intel_dp->dpcd);
> +
> +	if (!intel_dp->as_sdp_supported)
> +		return;
> +
> +	/* eDP Adaptive-Sync SDP always uses AS SDP v2 */
> +	if (intel_dp_is_edp(intel_dp))
> +		intel_dp->as_sdp_v2_supported =  true;

I really hope eDP 1.5 (not 1.5a) was never adopted by anyone because it
seems to make a complete mess of the AS SDP version number.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +	else
> +		intel_dp->as_sdp_v2_supported = intel_dp_sink_supports_as_sdp_v2(intel_dp);
>  }
>  
>  static bool intel_dp_needs_dpcd_probe(struct intel_dp *intel_dp, bool force_on_external)
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported
  2026-05-18  3:54 ` [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported Ankit Nautiyal
@ 2026-05-22 14:10   ` Ville Syrjälä
  0 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjälä @ 2026-05-22 14:10 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna

On Mon, May 18, 2026 at 09:24:53AM +0530, Ankit Nautiyal wrote:
> We do not support AS SDP version 1, so allow AS SDP only if AS SDP v2 is
> supported.
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 92a650a728d8..d1b40db7e2a3 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3172,7 +3172,7 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc
>  static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
>  				  struct intel_crtc_state *crtc_state)
>  {
> -	if (!intel_dp->as_sdp_supported)
> +	if (!intel_dp->as_sdp_v2_supported)

Should perhaps add a TODO here about adding AS SDP v1 support for PCONs.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  		return false;
>  
>  	/*
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 07/11] drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM
  2026-05-18  3:54 ` [PATCH 07/11] drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM Ankit Nautiyal
@ 2026-05-22 15:08   ` Ville Syrjälä
  0 siblings, 0 replies; 23+ messages in thread
From: Ville Syrjälä @ 2026-05-22 15:08 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna

On Mon, May 18, 2026 at 09:24:57AM +0530, Ankit Nautiyal wrote:
> If a Panel Replay capable sink, supports Async Video timing in
> PR active state, then source does not necessarily need to send AS SDPs
> during PR active.
> 
> However, if asynchronous video timing is not supported, then for PR with
> Aux-less ALPM, the source must transmit Adaptive-Sync SDPs for video
> timing synchronization while PR is active.
> 
> If the source needs to send AS SDP during PR active, this requires setting
> DPCD 0x0107[6] (FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE). This applies whether
> VRR is enabled (AVT/FAVT) or fixed-timing mode is used.
> 
> This bit defines AS SDP timing behavior during PR Active, even if AS SDPs
> are briefly suspended.
> 
> Program the relevant Downspread Ctrl DPCD bits accordingly.
> 
> v2: Instead of Panel Replay check simply use AS SDP enable check. (Ville)
> v3: Since the bit is defined in context of Panel Replay and AS SDP, add
>     a check for both. (Ville)
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  .../gpu/drm/i915/display/intel_dp_link_training.c | 15 +++++++++++++--
>  .../gpu/drm/i915/display/intel_dp_link_training.h |  3 ++-
>  drivers/gpu/drm/i915/display/intel_dp_mst.c       |  2 +-
>  3 files changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> index a26094223f78..d0b033d2cfb4 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> @@ -34,8 +34,10 @@
>  #include "intel_dp.h"
>  #include "intel_dp_link_training.h"
>  #include "intel_encoder.h"
> +#include "intel_hdmi.h"
>  #include "intel_hotplug.h"
>  #include "intel_panel.h"
> +#include "intel_psr.h"
>  
>  #define LT_MSG_PREFIX			"[CONNECTOR:%d:%s][ENCODER:%d:%s][%s] "
>  #define LT_MSG_ARGS(_intel_dp, _dp_phy)	(_intel_dp)->attached_connector->base.base.id, \
> @@ -710,11 +712,14 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp,
>  	return true;
>  }
>  
> -void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate, bool is_vrr)
> +void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate,
> +				     bool is_vrr,
> +				     bool pr_with_as_sdp_enable)
>  {
>  	u8 link_config[2];
>  
>  	link_config[0] = is_vrr ? DP_MSA_TIMING_PAR_IGNORE_EN : 0;
> +	link_config[0] |= pr_with_as_sdp_enable ? DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE : 0;
>  	link_config[1] = drm_dp_is_uhbr_rate(link_rate) ?
>  			 DP_SET_ANSI_128B132B : DP_SET_ANSI_8B10B;
>  	drm_dp_dpcd_write(&intel_dp->aux, DP_DOWNSPREAD_CTRL, link_config, 2);
> @@ -723,6 +728,10 @@ void intel_dp_link_training_set_mode(struct intel_dp *intel_dp, int link_rate, b
>  static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
>  					    const struct intel_crtc_state *crtc_state)
>  {
> +	bool pr_with_as_sdp_enable =
> +		intel_psr_needs_alpm_aux_less(intel_dp, crtc_state) &&
> +		crtc_state->infoframes.enable & intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);

This whole thing could be a function instead of a variable.

The use of intel_psr_needs_alpm_aux_less() is a bit confusing here,
but I guess it (at least currently) does the right thing.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> +
>  	 /*
>  	  * Currently, we set the MSA ignore bit based on vrr.in_range.
>  	  * We can't really read that out during driver load since we don't have
> @@ -737,7 +746,9 @@ static void intel_dp_update_downspread_ctrl(struct intel_dp *intel_dp,
>  	  * especially on the first real commit when clearing the inherited flag.
>  	  */
>  	intel_dp_link_training_set_mode(intel_dp,
> -					crtc_state->port_clock, crtc_state->vrr.in_range);
> +					crtc_state->port_clock,
> +					crtc_state->vrr.in_range,
> +					pr_with_as_sdp_enable);
>  }
>  
>  void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.h b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> index 33dcbde6a408..18c34c1a472f 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> @@ -18,7 +18,8 @@ int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp);
>  bool intel_dp_lttpr_transparent_mode_enabled(struct intel_dp *intel_dp);
>  
>  void intel_dp_link_training_set_mode(struct intel_dp *intel_dp,
> -				     int link_rate, bool is_vrr);
> +				     int link_rate, bool is_vrr,
> +				     bool pr_with_as_sdp_enable);
>  void intel_dp_link_training_set_bw(struct intel_dp *intel_dp,
>  				   int link_bw, int rate_select, int lane_count,
>  				   bool enhanced_framing, bool post_lt_adj_req);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index 8f73e01db17c..a238f7948cec 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -2145,7 +2145,7 @@ void intel_dp_mst_prepare_probe(struct intel_dp *intel_dp)
>  
>  	intel_dp_compute_rate(intel_dp, link_rate, &link_bw, &rate_select);
>  
> -	intel_dp_link_training_set_mode(intel_dp, link_rate, false);
> +	intel_dp_link_training_set_mode(intel_dp, link_rate, false, false);
>  	intel_dp_link_training_set_bw(intel_dp, link_bw, rate_select, lane_count,
>  				      drm_dp_enhanced_frame_cap(intel_dp->dpcd), false);
>  
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late
  2026-05-18  3:54 ` [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late Ankit Nautiyal
@ 2026-05-22 15:24   ` Ville Syrjälä
  2026-05-23  4:27     ` Nautiyal, Ankit K
  0 siblings, 1 reply; 23+ messages in thread
From: Ville Syrjälä @ 2026-05-22 15:24 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna

On Mon, May 18, 2026 at 09:24:59AM +0530, Ankit Nautiyal wrote:
> Currently we enable AS SDP only when VRR is enabled. As we start using
> AS SDP for other features, this becomes a problem. The AS SDP
> configuration can change dynamically based on VRR, CMRR, PR, ALPM, etc.
> Since these features may be enabled or disabled after the initial
> configuration, the AS SDP parameters need to be computed later in the
> pipeline.
> 
> However, not all of the AS SDP logic can be moved to the late stage:
> the VRR guardband optimization depends on knowing early whether AS SDP
> can be used. Without this, we would end up accounting for AS SDP on all
> platforms that support it, even for panels that do not support AS SDP.
> Therefore we set the infoframe enable bit for AS SDP during
> compute_config(), before the guardband is computed.
> 
> To handle these constraints, split the AS SDP programming into two
> phases:
> 
>  - intel_dp_compute_as_sdp()
>    Runs during compute_config().
>    Sets only the infoframe enable bit so that the guardband logic can
>    account for AS SDP requirements.
> 
>  - intel_dp_as_sdp_compute_config_late()
>    Runs during compute_config_late().
>    Computes all remaining AS SDP fields based on the features that need
>    it.
> 
> The late-stage computation is called from
> intel_dp_sdp_compute_config_late(), before computing the minimum guardband
> for SDPs.
> 
> This is a preparatory change. A subsequent patches will compute PR related
> AS SDP fields and enable AS SDP not only for VRR but for other features
> as well.

I don't think we actually need this. Based on what I see in the spec it
should be perfectly fine to always provide the coasting vtotal whenever
the sink supports panel replay.

Also I don't think we support the "suspend AS SDP during PR active" mode
yet, so for the moment the sink should never even use the coasting
vtotal value we provide.

> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 66 ++++++++++++++++---------
>  1 file changed, 43 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 8d0d04f306a7..c1c6f394eb0b 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3187,10 +3187,6 @@ static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
>  static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
>  				    struct intel_crtc_state *crtc_state)
>  {
> -	struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
> -	const struct drm_display_mode *adjusted_mode =
> -		&crtc_state->hw.adjusted_mode;
> -
>  	/*
>  	 * #FIXME: SDP/infoframe updates aren’t truly atomic, and with the new
>  	 * cdclk->tc clock crossing we may transiently send a corrupted packet
> @@ -3199,23 +3195,13 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
>  	if (!intel_dp_needs_as_sdp(intel_dp, crtc_state))
>  		return;
>  
> +	/*
> +	 * Only set the infoframes.enable flag here. The remaining AS SDP fields
> +	 * are programmed in the compute_config_late() phase. We need this flag
> +	 * early so that the VRR guardband calculation can properly account for
> +	 * AS SDP requirements.
> +	 */
>  	crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
> -
> -	as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
> -	as_sdp->length = 0x9;
> -	as_sdp->duration_incr_ms = 0;
> -	as_sdp->revision = 0x2;
> -	as_sdp->vtotal = intel_vrr_vmin_vtotal(crtc_state);
> -
> -	if (crtc_state->cmrr.enable) {
> -		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
> -		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
> -		as_sdp->target_rr_divider = true;
> -	} else if (crtc_state->vrr.enable) {
> -		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
> -	} else {
> -		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
> -	}
>  }
>  
>  static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,
> @@ -7459,11 +7445,45 @@ void intel_dp_mst_resume(struct intel_display *display)
>  }
>  
>  static
> -int intel_dp_sdp_compute_config_late(struct intel_crtc_state *crtc_state)
> +void intel_dp_as_sdp_compute_config_late(struct intel_dp *intel_dp,
> +					 struct intel_crtc_state *crtc_state)
> +{
> +	struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
> +	const struct drm_display_mode *adjusted_mode =
> +		&crtc_state->hw.adjusted_mode;
> +
> +	if ((crtc_state->infoframes.enable &
> +	    intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC)) == 0)
> +		return;
> +
> +	as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
> +	as_sdp->length = 0x9;
> +	as_sdp->duration_incr_ms = 0;
> +	as_sdp->revision = 0x2;
> +	as_sdp->vtotal = intel_vrr_vmin_vtotal(crtc_state);
> +
> +	if (crtc_state->cmrr.enable) {
> +		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
> +		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
> +		as_sdp->target_rr_divider = true;
> +	} else if (crtc_state->vrr.enable) {
> +		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
> +	} else {
> +		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
> +	}
> +}
> +
> +static
> +int intel_dp_sdp_compute_config_late(struct intel_dp *intel_dp,
> +				     struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_display *display = to_intel_display(crtc_state);
>  	int guardband = intel_crtc_vblank_length(crtc_state);
> -	int min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
> +	int min_sdp_guardband;
> +
> +	intel_dp_as_sdp_compute_config_late(intel_dp, crtc_state);
> +
> +	min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
>  
>  	if (guardband < min_sdp_guardband) {
>  		drm_dbg_kms(display->drm, "guardband %d < min sdp guardband %d\n",
> @@ -7483,7 +7503,7 @@ int intel_dp_compute_config_late(struct intel_encoder *encoder,
>  
>  	intel_psr_compute_config_late(intel_dp, crtc_state);
>  
> -	ret = intel_dp_sdp_compute_config_late(crtc_state);
> +	ret = intel_dp_sdp_compute_config_late(intel_dp, crtc_state);
>  	if (ret)
>  		return ret;
>  
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink
  2026-05-18  3:55 ` [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink Ankit Nautiyal
@ 2026-05-22 15:25   ` Ville Syrjälä
  2026-05-23  4:29     ` Nautiyal, Ankit K
  0 siblings, 1 reply; 23+ messages in thread
From: Ville Syrjälä @ 2026-05-22 15:25 UTC (permalink / raw)
  To: Ankit Nautiyal; +Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna

On Mon, May 18, 2026 at 09:25:01AM +0530, Ankit Nautiyal wrote:
> Currently AS SDP is only configured when VRR is enabled. However, other
> use cases like CMRR, Panel Replay, etc. also send information to the sink
> via AS SDPs.
> 
> With optimized guardband, we also need to account for wakeup time and other
> relevant details that depend on the AS SDP position whenever AS SDP is
> enabled. If a feature enabling AS SDP gets turned on later (after modeset),
> the guardband might not be sufficient and may need to increase, triggering
> a full modeset.
> 
> To avoid this, always send AS SDP whenever:
>  - the source and sink both support it, AND,
>  - there is a possibility to use it for VRR and Panel Replay for
>    synchronization.
> 
> v2: Check if AS SDP can be used for synchronization for VRR or PR. (Ville)
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 69eb474fede7..2c1dbcb0a2ca 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3181,7 +3181,11 @@ static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
>  	if (drm_dp_is_branch(intel_dp->dpcd))
>  		return false;
>  
> -	return crtc_state->vrr.enable;
> +	if (intel_alpm_is_alpm_aux_less(intel_dp, crtc_state) &&

That also includes lobf stuff in the check which we presumably don't want.

> +	    !intel_psr_pr_async_video_timing_supported(intel_dp))
> +		return true;
> +
> +	return intel_vrr_possible(crtc_state);
>  }
>  
>  static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
> -- 
> 2.45.2

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late
  2026-05-22 15:24   ` Ville Syrjälä
@ 2026-05-23  4:27     ` Nautiyal, Ankit K
  0 siblings, 0 replies; 23+ messages in thread
From: Nautiyal, Ankit K @ 2026-05-23  4:27 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna


On 5/22/2026 8:54 PM, Ville Syrjälä wrote:
> On Mon, May 18, 2026 at 09:24:59AM +0530, Ankit Nautiyal wrote:
>> Currently we enable AS SDP only when VRR is enabled. As we start using
>> AS SDP for other features, this becomes a problem. The AS SDP
>> configuration can change dynamically based on VRR, CMRR, PR, ALPM, etc.
>> Since these features may be enabled or disabled after the initial
>> configuration, the AS SDP parameters need to be computed later in the
>> pipeline.
>>
>> However, not all of the AS SDP logic can be moved to the late stage:
>> the VRR guardband optimization depends on knowing early whether AS SDP
>> can be used. Without this, we would end up accounting for AS SDP on all
>> platforms that support it, even for panels that do not support AS SDP.
>> Therefore we set the infoframe enable bit for AS SDP during
>> compute_config(), before the guardband is computed.
>>
>> To handle these constraints, split the AS SDP programming into two
>> phases:
>>
>>   - intel_dp_compute_as_sdp()
>>     Runs during compute_config().
>>     Sets only the infoframe enable bit so that the guardband logic can
>>     account for AS SDP requirements.
>>
>>   - intel_dp_as_sdp_compute_config_late()
>>     Runs during compute_config_late().
>>     Computes all remaining AS SDP fields based on the features that need
>>     it.
>>
>> The late-stage computation is called from
>> intel_dp_sdp_compute_config_late(), before computing the minimum guardband
>> for SDPs.
>>
>> This is a preparatory change. A subsequent patches will compute PR related
>> AS SDP fields and enable AS SDP not only for VRR but for other features
>> as well.
> I don't think we actually need this. Based on what I see in the spec it
> should be perfectly fine to always provide the coasting vtotal whenever
> the sink supports panel replay.
>
> Also I don't think we support the "suspend AS SDP during PR active" mode
> yet, so for the moment the sink should never even use the coasting
> vtotal value we provide.


Hmm ok, I will drop this change for now.

Regards,

Ankit

>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_dp.c | 66 ++++++++++++++++---------
>>   1 file changed, 43 insertions(+), 23 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index 8d0d04f306a7..c1c6f394eb0b 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -3187,10 +3187,6 @@ static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
>>   static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
>>   				    struct intel_crtc_state *crtc_state)
>>   {
>> -	struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
>> -	const struct drm_display_mode *adjusted_mode =
>> -		&crtc_state->hw.adjusted_mode;
>> -
>>   	/*
>>   	 * #FIXME: SDP/infoframe updates aren’t truly atomic, and with the new
>>   	 * cdclk->tc clock crossing we may transiently send a corrupted packet
>> @@ -3199,23 +3195,13 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
>>   	if (!intel_dp_needs_as_sdp(intel_dp, crtc_state))
>>   		return;
>>   
>> +	/*
>> +	 * Only set the infoframes.enable flag here. The remaining AS SDP fields
>> +	 * are programmed in the compute_config_late() phase. We need this flag
>> +	 * early so that the VRR guardband calculation can properly account for
>> +	 * AS SDP requirements.
>> +	 */
>>   	crtc_state->infoframes.enable |= intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC);
>> -
>> -	as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
>> -	as_sdp->length = 0x9;
>> -	as_sdp->duration_incr_ms = 0;
>> -	as_sdp->revision = 0x2;
>> -	as_sdp->vtotal = intel_vrr_vmin_vtotal(crtc_state);
>> -
>> -	if (crtc_state->cmrr.enable) {
>> -		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
>> -		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
>> -		as_sdp->target_rr_divider = true;
>> -	} else if (crtc_state->vrr.enable) {
>> -		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
>> -	} else {
>> -		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
>> -	}
>>   }
>>   
>>   static void intel_dp_compute_vsc_sdp(struct intel_dp *intel_dp,
>> @@ -7459,11 +7445,45 @@ void intel_dp_mst_resume(struct intel_display *display)
>>   }
>>   
>>   static
>> -int intel_dp_sdp_compute_config_late(struct intel_crtc_state *crtc_state)
>> +void intel_dp_as_sdp_compute_config_late(struct intel_dp *intel_dp,
>> +					 struct intel_crtc_state *crtc_state)
>> +{
>> +	struct drm_dp_as_sdp *as_sdp = &crtc_state->infoframes.as_sdp;
>> +	const struct drm_display_mode *adjusted_mode =
>> +		&crtc_state->hw.adjusted_mode;
>> +
>> +	if ((crtc_state->infoframes.enable &
>> +	    intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC)) == 0)
>> +		return;
>> +
>> +	as_sdp->sdp_type = DP_SDP_ADAPTIVE_SYNC;
>> +	as_sdp->length = 0x9;
>> +	as_sdp->duration_incr_ms = 0;
>> +	as_sdp->revision = 0x2;
>> +	as_sdp->vtotal = intel_vrr_vmin_vtotal(crtc_state);
>> +
>> +	if (crtc_state->cmrr.enable) {
>> +		as_sdp->mode = DP_AS_SDP_FAVT_TRR_REACHED;
>> +		as_sdp->target_rr = drm_mode_vrefresh(adjusted_mode);
>> +		as_sdp->target_rr_divider = true;
>> +	} else if (crtc_state->vrr.enable) {
>> +		as_sdp->mode = DP_AS_SDP_AVT_DYNAMIC_VTOTAL;
>> +	} else {
>> +		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
>> +	}
>> +}
>> +
>> +static
>> +int intel_dp_sdp_compute_config_late(struct intel_dp *intel_dp,
>> +				     struct intel_crtc_state *crtc_state)
>>   {
>>   	struct intel_display *display = to_intel_display(crtc_state);
>>   	int guardband = intel_crtc_vblank_length(crtc_state);
>> -	int min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
>> +	int min_sdp_guardband;
>> +
>> +	intel_dp_as_sdp_compute_config_late(intel_dp, crtc_state);
>> +
>> +	min_sdp_guardband = intel_dp_sdp_min_guardband(crtc_state, false);
>>   
>>   	if (guardband < min_sdp_guardband) {
>>   		drm_dbg_kms(display->drm, "guardband %d < min sdp guardband %d\n",
>> @@ -7483,7 +7503,7 @@ int intel_dp_compute_config_late(struct intel_encoder *encoder,
>>   
>>   	intel_psr_compute_config_late(intel_dp, crtc_state);
>>   
>> -	ret = intel_dp_sdp_compute_config_late(crtc_state);
>> +	ret = intel_dp_sdp_compute_config_late(intel_dp, crtc_state);
>>   	if (ret)
>>   		return ret;
>>   
>> -- 
>> 2.45.2

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink
  2026-05-22 15:25   ` Ville Syrjälä
@ 2026-05-23  4:29     ` Nautiyal, Ankit K
  0 siblings, 0 replies; 23+ messages in thread
From: Nautiyal, Ankit K @ 2026-05-23  4:29 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: intel-gfx, intel-xe, jouni.hogander, animesh.manna


On 5/22/2026 8:55 PM, Ville Syrjälä wrote:
> On Mon, May 18, 2026 at 09:25:01AM +0530, Ankit Nautiyal wrote:
>> Currently AS SDP is only configured when VRR is enabled. However, other
>> use cases like CMRR, Panel Replay, etc. also send information to the sink
>> via AS SDPs.
>>
>> With optimized guardband, we also need to account for wakeup time and other
>> relevant details that depend on the AS SDP position whenever AS SDP is
>> enabled. If a feature enabling AS SDP gets turned on later (after modeset),
>> the guardband might not be sufficient and may need to increase, triggering
>> a full modeset.
>>
>> To avoid this, always send AS SDP whenever:
>>   - the source and sink both support it, AND,
>>   - there is a possibility to use it for VRR and Panel Replay for
>>     synchronization.
>>
>> v2: Check if AS SDP can be used for synchronization for VRR or PR. (Ville)
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> ---
>>   drivers/gpu/drm/i915/display/intel_dp.c | 6 +++++-
>>   1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
>> index 69eb474fede7..2c1dbcb0a2ca 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
>> @@ -3181,7 +3181,11 @@ static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
>>   	if (drm_dp_is_branch(intel_dp->dpcd))
>>   		return false;
>>   
>> -	return crtc_state->vrr.enable;
>> +	if (intel_alpm_is_alpm_aux_less(intel_dp, crtc_state) &&
> That also includes lobf stuff in the check which we presumably don't want.


I think I will remove this check and just have intel_vrr_possible() for now.

Regards,

Ankit

>
>> +	    !intel_psr_pr_async_video_timing_supported(intel_dp))
>> +		return true;
>> +
>> +	return intel_vrr_possible(crtc_state);
>>   }
>>   
>>   static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
>> -- 
>> 2.45.2

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 10/11] drm/i915/dp: Compute and include coasting vtotal for AS SDP
  2026-05-18  3:55 ` [PATCH 10/11] drm/i915/dp: Compute and include coasting vtotal for AS SDP Ankit Nautiyal
@ 2026-05-23  4:34   ` Nautiyal, Ankit K
  0 siblings, 0 replies; 23+ messages in thread
From: Nautiyal, Ankit K @ 2026-05-23  4:34 UTC (permalink / raw)
  To: intel-gfx, intel-xe, Ville Syrjala; +Cc: jouni.hogander, animesh.manna


On 5/18/2026 9:25 AM, Ankit Nautiyal wrote:
> DP v2.1 allows the source to temporarily suspend Adaptive-Sync SDP
> transmission while Panel Replay is active when the sink supports
> asynchronous video timing.
>
> In such cases, the sink relies on the last transmitted AS SDP timing
> information to maintain the refresh rate. To support this behavior,
> compute and populate the coasting vtotal field in the AS SDP payload.
>
> Include coasting vtotal in AS SDP packing, unpacking, and comparison,
> and set it during late AS SDP configuration for PR with Aux-less ALPM
> when asynchronous video timing is supported.
>
> Note:
> The coasting vtotal value is fully under driver control i.e. the HW does
> not overwrite these payload bytes. HW only samples the PR_ALPM_CTL[AS SDP
> Transmission in Active Disable] bit during PR active state and reflects it
> in the AS SDP payload at the appropriate time.
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_display.c |  3 ++-
>   drivers/gpu/drm/i915/display/intel_dp.c      | 19 +++++++++++++++++++
>   2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 757a78c75bbf..043d1c667379 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -4889,7 +4889,8 @@ intel_compare_dp_as_sdp(const struct drm_dp_as_sdp *a,
>   		a->duration_incr_ms == b->duration_incr_ms &&
>   		a->duration_decr_ms == b->duration_decr_ms &&
>   		a->target_rr_divider == b->target_rr_divider &&
> -		a->mode == b->mode;
> +		a->mode == b->mode &&
> +		a->coasting_vtotal == b->coasting_vtotal;
>   }
>   
>   static bool
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index c1c6f394eb0b..69eb474fede7 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5181,6 +5181,9 @@ static ssize_t intel_dp_as_sdp_pack(const struct drm_dp_as_sdp *as_sdp,
>   	if (as_sdp->target_rr_divider)
>   		sdp->db[4] |= 0x20;
>   
> +	sdp->db[7] = as_sdp->coasting_vtotal & 0xFF;
> +	sdp->db[8] = (as_sdp->coasting_vtotal >> 8) & 0xFF;
> +
>   	return length;
>   }
>   
> @@ -5365,6 +5368,7 @@ int intel_dp_as_sdp_unpack(struct drm_dp_as_sdp *as_sdp,
>   	as_sdp->vtotal = (sdp->db[2] << 8) | sdp->db[1];
>   	as_sdp->target_rr = ((sdp->db[4] & 0x3) << 8) | sdp->db[3];
>   	as_sdp->target_rr_divider = sdp->db[4] & 0x20 ? true : false;
> +	as_sdp->coasting_vtotal = (sdp->db[8] << 8) | sdp->db[7];
>   
>   	return 0;
>   }
> @@ -7471,6 +7475,21 @@ void intel_dp_as_sdp_compute_config_late(struct intel_dp *intel_dp,
>   	} else {
>   		as_sdp->mode = DP_AS_SDP_AVT_FIXED_VTOTAL;
>   	}
> +
> +	/*
> +	 * For Panel Replay with Async Video Timing support, the source can
> +	 * disable sending the AS SDP during PR Active state. In that case,
> +	 * the sink needs the coasting vtotal value to maintain the refresh
> +	 * rate.
> +	 *
> +	 * #TODO:
> +	 * If we ever advertise support for coasting at other refresh targets,
> +	 * this logic could be revisited. For now, use the minimum refresh rate
> +	 * as the only safe coasting value.
> +	 */
> +	if (intel_alpm_is_alpm_aux_less(intel_dp, crtc_state) &&
> +	    intel_psr_pr_async_video_timing_supported(intel_dp))
> +		as_sdp->coasting_vtotal = crtc_state->vrr.vmax;

As suggested in previous patch, I will drop the condition and always 
populate coasting_vtotal with vrr.vmax for now.

Regards,
Ankit


>   }
>   
>   static

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported
  2026-05-25  5:22 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
@ 2026-05-25  5:22 ` Ankit Nautiyal
  0 siblings, 0 replies; 23+ messages in thread
From: Ankit Nautiyal @ 2026-05-25  5:22 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: ville.syrjala, jouni.hogander, animesh.manna, Ankit Nautiyal

We do not support AS SDP version 1, so allow AS SDP only if AS SDP v2 is
supported.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 92a650a728d8..7ce45c28cc3a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3172,11 +3172,11 @@ static void intel_dp_compute_vsc_colorimetry(const struct intel_crtc_state *crtc
 static bool intel_dp_needs_as_sdp(struct intel_dp *intel_dp,
 				  struct intel_crtc_state *crtc_state)
 {
-	if (!intel_dp->as_sdp_supported)
+	if (!intel_dp->as_sdp_v2_supported)
 		return false;
 
 	/*
-	 * #TODO Implement AS SDP for DP branch device.
+	 * #TODO: Add AS SDP v1 support for PCONs (DP branch devices).
 	 */
 	if (drm_dp_is_branch(intel_dp->dpcd))
 		return false;
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2026-05-25  5:40 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-18  3:54 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
2026-05-18  3:54 ` [PATCH 01/11] drm/i915/psr: Add helper to get Async Video timing support in PR active Ankit Nautiyal
2026-05-22 14:06   ` Ville Syrjälä
2026-05-18  3:54 ` [PATCH 02/11] drm/i915/dp: Add member to intel_dp to store AS SDP v2 support Ankit Nautiyal
2026-05-22 14:08   ` Ville Syrjälä
2026-05-18  3:54 ` [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported Ankit Nautiyal
2026-05-22 14:10   ` Ville Syrjälä
2026-05-18  3:54 ` [PATCH 04/11] drm/i915/psr: Write the PR config DPCDs in burst mode Ankit Nautiyal
2026-05-18  3:54 ` [PATCH 05/11] drm/i915/display: Add helper for AS SDP transmission time selection Ankit Nautiyal
2026-05-18  3:54 ` [PATCH 06/11] drm/i915/psr: Program Panel Replay CONFIG3 using AS SDP transmission time Ankit Nautiyal
2026-05-18  3:54 ` [PATCH 07/11] drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM Ankit Nautiyal
2026-05-22 15:08   ` Ville Syrjälä
2026-05-18  3:54 ` [PATCH 08/11] drm/i915/dp: Program AS SDP DB[1:0] for PR with Link off Ankit Nautiyal
2026-05-18  3:54 ` [PATCH 09/11] drm/i915/dp: Split AS SDP computation between compute_config and compute_config_late Ankit Nautiyal
2026-05-22 15:24   ` Ville Syrjälä
2026-05-23  4:27     ` Nautiyal, Ankit K
2026-05-18  3:55 ` [PATCH 10/11] drm/i915/dp: Compute and include coasting vtotal for AS SDP Ankit Nautiyal
2026-05-23  4:34   ` Nautiyal, Ankit K
2026-05-18  3:55 ` [PATCH 11/11] drm/i915/dp: Always enable AS SDP if supported by source + sink Ankit Nautiyal
2026-05-22 15:25   ` Ville Syrjälä
2026-05-23  4:29     ` Nautiyal, Ankit K
2026-05-18  5:44 ` ✓ i915.CI.BAT: success for Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-05-25  5:22 [PATCH 00/11] Fix Adaptive-Sync SDP for PR with Link ON + Auxless-ALPM Ankit Nautiyal
2026-05-25  5:22 ` [PATCH 03/11] drm/i915/dp: Allow AS SDP only if v2 is supported Ankit Nautiyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox