Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
@ 2026-09-23  4:13 Jake Steinman
  2026-09-23 14:27 ` sashiko-bot
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Jake Steinman @ 2026-09-23  4:13 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: jani.nikula, rodrigo.vivi, Jouni Högander, Animesh Manna,
	Ankit Nautiyal, Uma Shankar, Ville Syrjälä

Since commit 38a7e9bf69bd ("drm/i915/dp: Set relevant Downspread Ctrl
DPCD bits for PR + Auxless ALPM") link training sets
DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE (DPCD 0x107 bit 6) whenever eDP
Panel Replay runs with the Adaptive-Sync SDP enabled. That tells the
sink that fixed-vtotal AS SDPs keep coming while PR is active.

When the sink supports asynchronous video timing in PR (DPCD 0xb1
ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR clear),
disable_as_sdp_when_pr_active is set and PR_ALPM_CTL[AS SDP
Transmission in Active Disable] is programmed, so the source stops
sending the AS SDP for as long as PR is active. The sink is promised
AS SDPs that never arrive.

This is not a VRR-only case: intel_vrr_compute_config() always
computes fixed refresh timings with vrr.flipline set, so the AS SDP is
enabled on every eDP sink that supports it (from code reading; the
measurements below used an EDID override).

The commit that added the bit notes that it applies even if AS SDPs
are briefly suspended. With the PR_ALPM_CTL bit set they are not
briefly suspended, they are off for the whole of PR Active.

Commit 186113b419a2 ("drm/i915/dp: Compute and include coasting vtotal
for AS SDP") notes that the hardware reflects the PR_ALPM_CTL bit in
the AS SDP payload. Even so, with 0x107 bit 6 set this sink stutters,
and with it clear it does not (below).

Seen on a Dell XPS 16 DA16260 (Panther Lake, LG eDP panel, sink OUI
00:22:b9, 3200x2000@120 with DSC) with the Panel Replay quirk removed
locally: PR_ALPM_CTL = 0x11, DPCD 0x107 = 0xc0 (bit 7 because this
setup uses an EDID override that adds a 20-120 Hz range with unchanged
timings; the stock EDID has none). The desktop visibly stutters under
Panel Replay while the source flips at a steady 8.33 ms (1434 of 1437
commit intervals over 12 s).

Both ways of making source and sink agree were tested with a local
debug switch selecting each behaviour, PR entered by a full modeset
each time:

  AS SDP kept on in PR Active   PR_ALPM_CTL 0x01, 0x107 0xc0
  (this patch) AS SDP off       PR_ALPM_CTL 0x11, 0x107 0x80

Both are smooth on the desktop right after PR entry. With this patch,
some stutter comes back after several minutes on this panel; that is
left for a separate change. On a static VT (no compositor, one update
per second, 30 s each) the first gets 0 DC5 entries and this patch
gets 550 (DMC DC3->DC5 count; on the KDE desktop neither mode reached
DC5 because the compositor keeps vblank interrupts enabled). So keep
the AS SDP off and stop promising it.

Only set the bit when the source keeps sending the AS SDP in PR
Active: disable_as_sdp_when_pr_active is clear, or AS SDP skip frames
is in use, which clears the PR_ALPM_CTL bit and keeps a periodic AS
SDP going.

Also fix the comment in intel_dp_compute_as_sdp(), added by the
coasting vtotal commit above, which says the PR_ALPM_CTL bit is never
programmed. It was already being programmed when that comment was
added.

Fixes: 38a7e9bf69bd ("drm/i915/dp: Set relevant Downspread Ctrl DPCD bits for PR + Auxless ALPM")
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
---
Notes:

- Based on drm-tip of 2026-09-22, also applies to next-20260922.
  The measurements used an equivalent local debug switch on 7.3-rc4
  (its second setting programs the same PR_ALPM_CTL 0x11 / 0x107 0x80
  as this patch does there). The rc4 version of this change (without
  the skip-frames term, which rc4 lacks) builds but has not been run
  on its own yet. The drm-tip version builds cleanly with W=1 (i915
  and xe) but has not been run.

- Ankit, does this match your reading of the spec for 0x107 bit 6?
  The public material I could find does not settle it; the argument
  here is consistency with PR_ALPM_CTL plus the measurements above.

- With skip frames, a seamless VRR toggle reprograms PR_ALPM_CTL but
  0x107 is only written at link training, so bit 6 can go stale on
  display version 35+ in either direction (also if
  enable_periodic_assdp is toggled without a modeset). Before this
  patch only the bit-set direction could happen. It cannot happen on
  PTL.

- Not fixed here: on this panel, with no AS SDP at all in PR Active,
  a fresh PR enable (e.g. DPMS on after the screen blanked) can leave
  the sink locked to a bad phase, and a 1 s AS SDP burst cleared it. PTL
  appears not to implement the skip-frames field. That and the
  question of how Intel wants it handled are in the bug thread:
  https://lore.kernel.org/intel-gfx/20260902162150.58778-1-j@metarealtyinc.ca/
  The DA16260 Panel Replay quirk stays until that is settled.

 drivers/gpu/drm/i915/display/intel_dp.c               | 11 ++++++-----
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 11 +++++++++++
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index ffddf4b33728..f7d32ed98745 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3156,11 +3156,12 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
 
 	/*
 	 * 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. The HW only samples this on PR_ALPM_CTL[AS SDP Transmission
-	 * in Active Disable], which we never program, so providing the value
-	 * unconditionally when the sink advertises the capability is safe.
+	 * stop sending the AS SDP during PR Active (PR_ALPM_CTL[AS SDP
+	 * Transmission in Active Disable], see intel_alpm_configure_pr_as_sdp())
+	 * and the sink then keeps the refresh rate using the coasting vtotal of
+	 * the last AS SDP it received. The coasting vtotal bytes are fully
+	 * under driver control, so fill them in whenever the sink advertises
+	 * the capability.
 	 *
 	 * #TODO:
 	 * If we ever advertise support for coasting at other refresh targets,
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 b6e8b13ee4db..6fe4c1e47eff 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -29,6 +29,7 @@
 #include <drm/display/drm_dp_helper.h>
 #include <drm/drm_print.h>
 
+#include "intel_alpm.h"
 #include "intel_display.h"
 #include "intel_display_core.h"
 #include "intel_display_jiffies.h"
@@ -1124,7 +1125,17 @@ static bool
 intel_dp_pr_with_as_sdp_enabled(struct intel_dp *intel_dp,
 				const struct intel_crtc_state *crtc_state)
 {
+	/*
+	 * DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE tells the sink that the AS SDP
+	 * keeps coming during PR Active. With disable_as_sdp_when_pr_active,
+	 * intel_alpm_configure_pr_as_sdp() sets PR_ALPM_CTL[AS SDP Transmission
+	 * in Active Disable] and the source stops sending it for as long as PR
+	 * is active, unless AS SDP skip frames is used. The sink then keeps
+	 * the refresh rate using the coasting vtotal of the last AS SDP.
+	 */
 	return intel_psr_needs_alpm_aux_less(intel_dp, crtc_state) &&
+		(!crtc_state->disable_as_sdp_when_pr_active ||
+		 intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp, crtc_state)) &&
 		(crtc_state->infoframes.enable &
 		 intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC));
 }

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

* Re: [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
@ 2026-09-23 14:27 ` sashiko-bot
  2026-09-23 15:25   ` Jake Steinman
  2026-09-23 15:10 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 23+ messages in thread
From: sashiko-bot @ 2026-09-23 14:27 UTC (permalink / raw)
  To: Jake Steinman; +Cc: intel-gfx, intel-xe

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] drm/i915: build failure due to undefined intel_alpm_pr_as_sdp_skip_frames_enabled()
--

commit b6467ba689abbe92a2f289d4eb766436f8714a78
Author: Jake Steinman <j@metarealtyinc.ca>

drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled

This commit conditionally disables DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE
during link training if AS SDP skip frames are not in use. It also attempts
to clarify documentation about when PR_ALPM_CTL[AS SDP Transmission in
Active Disable] is programmed.

Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119

> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0cd5e6b5034cf..217795e155607 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3154,11 +3154,12 @@ static void intel_dp_compute_as_sdp(struct intel_dp *intel_dp,
>  
>  	/*
>  	 * 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. The HW only samples this on PR_ALPM_CTL[AS SDP Transmission
> -	 * in Active Disable], which we never program, so providing the value
> -	 * unconditionally when the sink advertises the capability is safe.
> +	 * stop sending the AS SDP during PR Active (PR_ALPM_CTL[AS SDP
> +	 * Transmission in Active Disable], see intel_alpm_configure_pr_as_sdp())

[Severity: Low]
Does the referenced intel_alpm_configure_pr_as_sdp() function exist in the
codebase? A tree-wide search doesn't show it being defined here or in any
subsequent patches. Was this perhaps renamed to lnl_alpm_configure(), or
is there a missing patch dependency?

> +	 * and the sink then keeps the refresh rate using the coasting vtotal of
> +	 * the last AS SDP it received. The coasting vtotal bytes are fully
> +	 * under driver control, so fill them in whenever the sink advertises
> +	 * the capability.
>  	 *
>  	 * #TODO:
>  	 * If we ever advertise support for coasting at other refresh targets,

[ ... ]

> 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 cb92cff906146..5729ecaba1499 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> @@ -1122,7 +1123,17 @@ static bool
>  intel_dp_pr_with_as_sdp_enabled(struct intel_dp *intel_dp,
>  				const struct intel_crtc_state *crtc_state)
>  {
> +	/*
> +	 * DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE tells the sink that the AS SDP
> +	 * keeps coming during PR Active. With disable_as_sdp_when_pr_active,
> +	 * intel_alpm_configure_pr_as_sdp() sets PR_ALPM_CTL[AS SDP Transmission
> +	 * in Active Disable] and the source stops sending it for as long as PR
> +	 * is active, unless AS SDP skip frames is used. The sink then keeps
> +	 * the refresh rate using the coasting vtotal of the last AS SDP.
> +	 */
>  	return intel_psr_needs_alpm_aux_less(intel_dp, crtc_state) &&
> +		(!crtc_state->disable_as_sdp_when_pr_active ||
> +		 intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp, crtc_state)) &&

[Severity: Low]
Is intel_alpm_pr_as_sdp_skip_frames_enabled() defined anywhere in this tree?
This causes a build failure due to an implicit declaration and undefined
reference.

Additionally, the commit message states that when AS SDP skip frames are in
use, it clears the PR_ALPM_CTL bit and keeps a periodic AS SDP going.
However, looking at lnl_alpm_configure() in intel_alpm.c, the bit seems to
be programmed without a skip frames check:

	if (crtc_state->disable_as_sdp_when_pr_active)
		pr_alpm_ctl |= PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE;

Are we missing the patch that introduces both these missing functions and the
updated PR_ALPM_CTL programming logic?

>  		(crtc_state->infoframes.enable &
>  		 intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC));
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260923041342.2146450-1-j@metarealtyinc.ca?part=1

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

* ✗ LGCI.VerificationFailed: failure for drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
  2026-09-23 14:27 ` sashiko-bot
@ 2026-09-23 15:10 ` Patchwork
  2026-09-28 12:23 ` [PATCH] " Jake Steinman
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Patchwork @ 2026-09-23 15:10 UTC (permalink / raw)
  To: Jake Steinman; +Cc: intel-xe

== Series Details ==

Series: drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
URL   : https://patchwork.freedesktop.org/series/174814/
State : failure

== Summary ==

Series author address 'j@metarealtyinc.ca' is not on the allowlist, which prevents CI from being automatically triggered.
If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork.
Exception occurred during validation, bailing out!
Build URL: http://intel-gfx-ci-public.igk.intel.com:8080/job/xe_pw_trigger/1289883/ (on master)



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

* Re: [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
  2026-09-23 14:27 ` sashiko-bot
@ 2026-09-23 15:25   ` Jake Steinman
  0 siblings, 0 replies; 23+ messages in thread
From: Jake Steinman @ 2026-09-23 15:25 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: jani.nikula, rodrigo.vivi, jouni.hogander, animesh.manna,
	ankit.k.nautiyal, uma.shankar, ville.syrjala

On Wed, 23 Sep 2026 sashiko-bot wrote:
> Is intel_alpm_pr_as_sdp_skip_frames_enabled() defined anywhere in this tree?

The patch is based on drm-intel-next / drm-tip, which have the AS SDP
skip frames series (8dbe5c47ca42, dc0fd724e13a, eddf77ff1a23,
9ed39b7d74b4). intel_alpm_configure_pr_as_sdp() and
intel_alpm_pr_as_sdp_skip_frames_enabled() come from that series, and
the patch builds there with W=1 for both i915 and xe. The tree used for
the review predates it. I'll add a base-commit line next time.

Jake

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

* Re: [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
  2026-09-23 14:27 ` sashiko-bot
  2026-09-23 15:10 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
@ 2026-09-28 12:23 ` Jake Steinman
  2026-10-06 22:05 ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Jake Steinman
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 23+ messages in thread
From: Jake Steinman @ 2026-09-28 12:23 UTC (permalink / raw)
  To: intel-gfx, intel-xe
  Cc: jani.nikula, rodrigo.vivi, jouni.hogander, animesh.manna,
	ankit.k.nautiyal, uma.shankar, ville.syrjala

Hi Jouni, all,

Gentle ping, with an update on the stutter left open in the notes.

AS SDP bursts turned out not to be reliable on this panel, but leaving
the AS SDP on in PR Active is always smooth, also with 0x107 bit 6
clear. What works here now: clear PR_ALPM_CTL[AS SDP Transmission in
Active Disable] while vblank interrupts are enabled and set it again
when they are disabled. PR already holds DC_OFF while vblank is on
(intel_psr_notify_vblank_enable_disable()), so this costs no DC5/DC6
residency. Smooth here so far; I switched to it this morning.

Would that be acceptable upstream for sinks with async video timing in
PR? Happy to send it as an RFC on top of this patch.

Thanks,
Jake

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

* [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
                   ` (2 preceding siblings ...)
  2026-09-28 12:23 ` [PATCH] " Jake Steinman
@ 2026-10-06 22:05 ` Jake Steinman
  2026-10-07 14:20   ` sashiko-bot
  2026-11-20  9:42   ` Hogander, Jouni
  2026-10-07  6:41 ` [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Hogander, Jouni
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 23+ messages in thread
From: Jake Steinman @ 2026-10-06 22:05 UTC (permalink / raw)
  To: jouni.hogander
  Cc: intel-gfx, intel-xe, jani.nikula, rodrigo.vivi, animesh.manna,
	ankit.k.nautiyal, uma.shankar, ville.syrjala

Sinks that support async video timing in PR get the AS SDP suspended in
PR Active (disable_as_sdp_when_pr_active). The LG panel in the Dell XPS
16 DA16260 (sink OUI 00:22:b9, "Balsa2") then judders while frames are
updating, with the source flipping at a steady 8.33 ms. Leaving the AS
SDP on fixes it but blocks DC5/DC6.

Clear PR_ALPM_CTL[AS SDP Transmission in Active Disable] while vblank
interrupts are enabled and set it again when they are disabled. Panel
Replay already holds DC_OFF while vblank is enabled, so no DC5/DC6
residency is lost. Not done when AS SDP skip frames is in use.

Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/8930
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
---
Jouni, this is the fix for the stutter in the thread below. The 0x107
bit 6 patch there is still correct but is not enough on its own.
https://lore.kernel.org/r/20260923041342.2146450-1-j@metarealtyinc.ca

- Run as an equivalent change on 7.3-rc4 and rc5 (PTL, xe) since 28 Sep:
  smooth, DC5 still reached when idle. This drm-tip version is build
  tested only (W=1, i915 and xe).
- A seamless VRR toggle rewrites PR_ALPM_CTL through
  intel_alpm_configure_pr_as_sdp() and sets the bit again until the
  next vblank enable. Not handled here.
- A second machine shows the same thing: XPS 13 (1028:0e53, same sink
  OUI), fixed downstream by exiting PR on every flush (issue 8930).
- Separate from this: the panel judders for a few seconds after panel
  power-on. Locally I hold PR inactive after power-on; 3 s was not
  quite enough, 8 s is clean. Not part of this patch.
- CI has never run on my patches (address not on the allowlist, asked
  twice). Could someone trigger it for this one and for series 174810?
 .../drm/i915/display/intel_display_types.h    |  3 ++
 drivers/gpu/drm/i915/display/intel_psr.c      | 36 ++++++++++++++++++-
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 0e3083e85..75113ed10 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1816,6 +1816,9 @@ struct intel_psr {
 	bool dc3co_allowed;
 	/* DC3CO disable work */
 	struct delayed_work dc3co_work;
+	/* AS SDP in PR Active follows vblank enable */
+	bool pr_as_sdp_follow_vblank;
+	bool vblank_enabled;
 	u16 su_w_granularity;
 	u16 su_y_granularity;
 	bool source_panel_replay_support;
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 00d0146b2..0f0b1fc94 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -2166,6 +2166,29 @@ static bool psr_interrupt_error_check(struct intel_dp *intel_dp)
 	return true;
 }
 
+/*
+ * Sinks that support async video timing in PR get the AS SDP suspended in PR
+ * Active. Some then drift out of phase with the source and judder while
+ * frames are being updated. Send the AS SDP in PR Active while vblank
+ * interrupts are enabled: Panel Replay holds DC_OFF then anyway, so this
+ * costs no DC5/DC6 residency. Suspend it again when vblank interrupts are
+ * disabled, before DC_OFF is dropped.
+ */
+static void intel_psr_pr_as_sdp_update(struct intel_dp *intel_dp)
+{
+	struct intel_display *display = to_intel_display(intel_dp);
+
+	lockdep_assert_held(&intel_dp->psr.lock);
+
+	if (!intel_dp->psr.enabled || !intel_dp->psr.pr_as_sdp_follow_vblank)
+		return;
+
+	intel_de_rmw(display, PR_ALPM_CTL(display, intel_dp->psr.transcoder),
+		     PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE,
+		     intel_dp->psr.vblank_enabled ? 0 :
+		     PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE);
+}
+
 static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 				    const struct intel_crtc_state *crtc_state)
 {
@@ -2225,6 +2248,12 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 	intel_dp->psr.enabled = true;
 	intel_dp->psr.pause_counter = 0;
 
+	intel_dp->psr.pr_as_sdp_follow_vblank = crtc_state->has_panel_replay &&
+		crtc_state->disable_as_sdp_when_pr_active &&
+		intel_dp->as_sdp_supported && intel_dp_is_edp(intel_dp) &&
+		!intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp, crtc_state);
+	intel_psr_pr_as_sdp_update(intel_dp);
+
 	/*
 	 * Link_ok is sticky and set here on PSR enable. We can assume link
 	 * training is complete as we never continue to PSR enable with
@@ -2400,6 +2429,7 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp)
 	intel_dp->psr.pkg_c_latency_used = 0;
 	cancel_delayed_work(&intel_dp->psr.dc3co_work);
 	intel_dp->psr.dc3co_allowed = false;
+	intel_dp->psr.pr_as_sdp_follow_vblank = false;
 }
 
 /**
@@ -4163,7 +4193,11 @@ void intel_psr_notify_vblank_enable_disable(struct intel_display *display,
 				intel_dp->psr.vblank_wakeref =
 					intel_display_power_get(display,
 								POWER_DOMAIN_DC_OFF);
-			else
+
+			intel_dp->psr.vblank_enabled = enable;
+			intel_psr_pr_as_sdp_update(intel_dp);
+
+			if (!enable)
 				intel_display_power_put(display, POWER_DOMAIN_DC_OFF,
 							intel_dp->psr.vblank_wakeref);
 		}

base-commit: daeb062fc40f727fafefed080c6d12a5ad1d0d12
-- 
2.56.0


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

* Re: [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
                   ` (3 preceding siblings ...)
  2026-10-06 22:05 ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Jake Steinman
@ 2026-10-07  6:41 ` Hogander, Jouni
  2026-10-07 11:49 ` Jake Steinman
  2026-10-07 15:21 ` ✗ LGCI.VerificationFailed: failure for drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled (rev2) Patchwork
  6 siblings, 0 replies; 23+ messages in thread
From: Hogander, Jouni @ 2026-10-07  6:41 UTC (permalink / raw)
  To: intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	j@metarealtyinc.ca
  Cc: Shankar, Uma, Vivi, Rodrigo, Nikula, Jani, Manna, Animesh,
	Nautiyal, Ankit K, ville.syrjala@linux.intel.com

On Wed, 2026-09-23 at 00:13 -0400, Jake Steinman wrote:
> Since commit 38a7e9bf69bd ("drm/i915/dp: Set relevant Downspread Ctrl
> DPCD bits for PR + Auxless ALPM") link training sets
> DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE (DPCD 0x107 bit 6) whenever
> eDP
> Panel Replay runs with the Adaptive-Sync SDP enabled. That tells the
> sink that fixed-vtotal AS SDPs keep coming while PR is active.
> 
> When the sink supports asynchronous video timing in PR (DPCD 0xb1
> ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR clear),
> disable_as_sdp_when_pr_active is set and PR_ALPM_CTL[AS SDP
> Transmission in Active Disable] is programmed, so the source stops
> sending the AS SDP for as long as PR is active. The sink is promised
> AS SDPs that never arrive.
> 
> This is not a VRR-only case: intel_vrr_compute_config() always
> computes fixed refresh timings with vrr.flipline set, so the AS SDP
> is
> enabled on every eDP sink that supports it (from code reading; the
> measurements below used an EDID override).
> 
> The commit that added the bit notes that it applies even if AS SDPs
> are briefly suspended. With the PR_ALPM_CTL bit set they are not
> briefly suspended, they are off for the whole of PR Active.
> 
> Commit 186113b419a2 ("drm/i915/dp: Compute and include coasting
> vtotal
> for AS SDP") notes that the hardware reflects the PR_ALPM_CTL bit in
> the AS SDP payload. Even so, with 0x107 bit 6 set this sink stutters,
> and with it clear it does not (below).
> 
> Seen on a Dell XPS 16 DA16260 (Panther Lake, LG eDP panel, sink OUI
> 00:22:b9, 3200x2000@120 with DSC) with the Panel Replay quirk removed
> locally: PR_ALPM_CTL = 0x11, DPCD 0x107 = 0xc0 (bit 7 because this
> setup uses an EDID override that adds a 20-120 Hz range with
> unchanged
> timings; the stock EDID has none). The desktop visibly stutters under
> Panel Replay while the source flips at a steady 8.33 ms (1434 of 1437
> commit intervals over 12 s).
> 
> Both ways of making source and sink agree were tested with a local
> debug switch selecting each behaviour, PR entered by a full modeset
> each time:
> 
>   AS SDP kept on in PR Active   PR_ALPM_CTL 0x01, 0x107 0xc0
>   (this patch) AS SDP off       PR_ALPM_CTL 0x11, 0x107 0x80
> 
> Both are smooth on the desktop right after PR entry. With this patch,
> some stutter comes back after several minutes on this panel; that is
> left for a separate change. On a static VT (no compositor, one update
> per second, 30 s each) the first gets 0 DC5 entries and this patch
> gets 550 (DMC DC3->DC5 count; on the KDE desktop neither mode reached
> DC5 because the compositor keeps vblank interrupts enabled). So keep
> the AS SDP off and stop promising it.
> 
> Only set the bit when the source keeps sending the AS SDP in PR
> Active: disable_as_sdp_when_pr_active is clear, or AS SDP skip frames
> is in use, which clears the PR_ALPM_CTL bit and keeps a periodic AS
> SDP going.
> 
> Also fix the comment in intel_dp_compute_as_sdp(), added by the
> coasting vtotal commit above, which says the PR_ALPM_CTL bit is never
> programmed. It was already being programmed when that comment was
> added.
> 
> Fixes: 38a7e9bf69bd ("drm/i915/dp: Set relevant Downspread Ctrl DPCD
> bits for PR + Auxless ALPM")
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
> ---
> Notes:
> 
> - Based on drm-tip of 2026-09-22, also applies to next-20260922.
>   The measurements used an equivalent local debug switch on 7.3-rc4
>   (its second setting programs the same PR_ALPM_CTL 0x11 / 0x107 0x80
>   as this patch does there). The rc4 version of this change (without
>   the skip-frames term, which rc4 lacks) builds but has not been run
>   on its own yet. The drm-tip version builds cleanly with W=1 (i915
>   and xe) but has not been run.
> 
> - Ankit, does this match your reading of the spec for 0x107 bit 6?
>   The public material I could find does not settle it; the argument
>   here is consistency with PR_ALPM_CTL plus the measurements above.
> 
> - With skip frames, a seamless VRR toggle reprograms PR_ALPM_CTL but
>   0x107 is only written at link training, so bit 6 can go stale on
>   display version 35+ in either direction (also if
>   enable_periodic_assdp is toggled without a modeset). Before this
>   patch only the bit-set direction could happen. It cannot happen on
>   PTL.
> 
> - Not fixed here: on this panel, with no AS SDP at all in PR Active,
>   a fresh PR enable (e.g. DPMS on after the screen blanked) can leave
>   the sink locked to a bad phase, and a 1 s AS SDP burst cleared it.
> PTL
>   appears not to implement the skip-frames field. That and the
>   question of how Intel wants it handled are in the bug thread:
>  
> https://lore.kernel.org/intel-gfx/20260902162150.58778-1-j@metarealtyinc.ca/
>   The DA16260 Panel Replay quirk stays until that is settled.
> 
>  drivers/gpu/drm/i915/display/intel_dp.c               | 11 ++++++---
> --
>  drivers/gpu/drm/i915/display/intel_dp_link_training.c | 11
> +++++++++++
>  2 files changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index ffddf4b33728..f7d32ed98745 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -3156,11 +3156,12 @@ static void intel_dp_compute_as_sdp(struct
> intel_dp *intel_dp,
>  
>  	/*
>  	 * 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. The HW only samples this on PR_ALPM_CTL[AS SDP
> Transmission
> -	 * in Active Disable], which we never program, so providing
> the value
> -	 * unconditionally when the sink advertises the capability
> is safe.
> +	 * stop sending the AS SDP during PR Active (PR_ALPM_CTL[AS
> SDP
> +	 * Transmission in Active Disable], see
> intel_alpm_configure_pr_as_sdp())
> +	 * and the sink then keeps the refresh rate using the
> coasting vtotal of
> +	 * the last AS SDP it received. The coasting vtotal bytes
> are fully
> +	 * under driver control, so fill them in whenever the sink
> advertises
> +	 * the capability.
>  	 *
>  	 * #TODO:
>  	 * If we ever advertise support for coasting at other
> refresh targets,
> 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 b6e8b13ee4db..6fe4c1e47eff 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> @@ -29,6 +29,7 @@
>  #include <drm/display/drm_dp_helper.h>
>  #include <drm/drm_print.h>
>  
> +#include "intel_alpm.h"
>  #include "intel_display.h"
>  #include "intel_display_core.h"
>  #include "intel_display_jiffies.h"
> @@ -1124,7 +1125,17 @@ static bool
>  intel_dp_pr_with_as_sdp_enabled(struct intel_dp *intel_dp,
>  				const struct intel_crtc_state
> *crtc_state)
>  {
> +	/*
> +	 * DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE tells the sink
> that the AS SDP
> +	 * keeps coming during PR Active. With
> disable_as_sdp_when_pr_active,
> +	 * intel_alpm_configure_pr_as_sdp() sets PR_ALPM_CTL[AS SDP
> Transmission
> +	 * in Active Disable] and the source stops sending it for as
> long as PR
> +	 * is active, unless AS SDP skip frames is used. The sink
> then keeps
> +	 * the refresh rate using the coasting vtotal of the last AS
> SDP.
> +	 */
>  	return intel_psr_needs_alpm_aux_less(intel_dp, crtc_state)
> &&
> +		(!crtc_state->disable_as_sdp_when_pr_active ||
> +		 intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp,
> crtc_state)) &&
>  		(crtc_state->infoframes.enable &
>  		 intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC));
>  }

How about if you just keep AS_SDP enabled when PR is active? I.e:

static inline bool compute_disable_as_sdp_when_pr_active(struct
intel_connector *connector)
{
	return false;
}
 
Is that solving all problems with the panel?

BR,
Jouni Högander

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

* Re: [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
                   ` (4 preceding siblings ...)
  2026-10-07  6:41 ` [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Hogander, Jouni
@ 2026-10-07 11:49 ` Jake Steinman
  2026-10-07 15:21 ` ✗ LGCI.VerificationFailed: failure for drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled (rev2) Patchwork
  6 siblings, 0 replies; 23+ messages in thread
From: Jake Steinman @ 2026-10-07 11:49 UTC (permalink / raw)
  To: jouni.hogander
  Cc: intel-gfx, intel-xe, jani.nikula, rodrigo.vivi, animesh.manna,
	ankit.k.nautiyal, uma.shankar, ville.syrjala

Hi Jouni,

Thanks, that makes sense. Glad the AS SDP turned out to be the cause,
and the eDP 1.5 text explains why the driver got there. Your patch is
the right fix for the default.

AS SDP always on in PR Active is smooth here every time (tested as
PR_ALPM_CTL 0x01 with 0x107 0xc0, not with your exact patch). It does
cost DC5 on a static screen: 0 DC5 entries in 30 s on a static VT
against 550 with the AS SDP off in PR Active.

I have not measured the power yet. As an estimate: DC5/DC6 with the
screen on is what lets the package reach its deep idle states, so on
a static screen this could be worth roughly 5-15% of battery life in
mixed use. I can measure it against your patch if that helps.

This panel does run without the AS SDP. The RFC I sent keeps it on
while vblank is enabled and suspends it when idle; that has been
smooth here for over a week with DC5/DC6 intact.
https://lore.kernel.org/r/20261006220500.3417572-1-j@metarealtyinc.ca

Could that stay available on top of your patch for panels that handle
it, off by default? I can't prove it, but I would be surprised if Dell
and LG shipped this panel with that capability and Windows did not use
it for battery life. I can rebase the RFC onto your patch.

Separate issue, not solved by either: a few seconds of judder after
panel power-on. Locally I hold PR inactive for 8 s after power-on.

Thanks,
Jake

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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-10-06 22:05 ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Jake Steinman
@ 2026-10-07 14:20   ` sashiko-bot
  2026-11-20  9:42   ` Hogander, Jouni
  1 sibling, 0 replies; 23+ messages in thread
From: sashiko-bot @ 2026-10-07 14:20 UTC (permalink / raw)
  To: Jake Steinman; +Cc: intel-gfx, intel-xe

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] drm/i915/psr: wakeref leak and double-put in intel_psr_notify_vblank_enable_disable()
- [Low] drm/i915: Use of undeclared function intel_alpm_pr_as_sdp_skip_frames_enabled
--

commit 83416e4f5b6b0591037f900cd3b6bc4bc168af5c
Author: Jake Steinman <j@metarealtyinc.ca>

drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled

Sinks that support async video timing in PR get the AS SDP suspended in
PR Active (disable_as_sdp_when_pr_active). The LG panel in the Dell XPS
16 DA16260 (sink OUI 00:22:b9, "Balsa2") then judders while frames are
updating, with the source flipping at a steady 8.33 ms. Leaving the AS
SDP on fixes it but blocks DC5/DC6.

Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119
Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/8930

> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index f490beb66629e..f69df2147c9d4 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
[ ... ]
> @@ -2221,6 +2244,12 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
>  	intel_dp->psr.enabled = true;
>  	intel_dp->psr.pause_counter = 0;
>  
> +	intel_dp->psr.pr_as_sdp_follow_vblank = crtc_state->has_panel_replay &&
> +		crtc_state->disable_as_sdp_when_pr_active &&
> +		intel_dp->as_sdp_supported && intel_dp_is_edp(intel_dp) &&
> +		!intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp, crtc_state);

[Severity: Low]
Is this function call missing a declaration? The function
intel_alpm_pr_as_sdp_skip_frames_enabled() is neither defined nor declared
in the tree at this commit.

It appears to depend on an out-of-tree series, which causes a compilation
failure due to an implicit declaration.

> +	intel_psr_pr_as_sdp_update(intel_dp);
> +
>  	/*
>  	 * Link_ok is sticky and set here on PSR enable. We can assume link
>  	 * training is complete as we never continue to PSR enable with
[ ... ]
> @@ -4144,7 +4174,11 @@ void intel_psr_notify_vblank_enable_disable(struct intel_display *display,
>  				intel_dp->psr.vblank_wakeref =
>  					intel_display_power_get(display,
>  								POWER_DOMAIN_DC_OFF);
> -			else
> +
> +			intel_dp->psr.vblank_enabled = enable;
> +			intel_psr_pr_as_sdp_update(intel_dp);
> +
> +			if (!enable)
>  				intel_display_power_put(display, POWER_DOMAIN_DC_OFF,
>  							intel_dp->psr.vblank_wakeref);
>  		}

[Severity: High]
Does this loop cause unbalanced power tracking and a wakeref leak?

for_each_intel_encoder_with_psr() iterates over both the primary DP encoder
and its MST stream encoders, executing multiple times for the same
intel_dp pointer.

When enable is true, intel_dp->psr.vblank_wakeref is assigned repeatedly,
leaking all but the last tracker and leaking POWER_DOMAIN_DC_OFF references.

When enable is false, the single saved wakeref is freed multiple times,
causing a double-free or an underflow of the power domain use count.

Additionally, CAN_PANEL_REPLAY() evaluates sink capabilities which can change
dynamically across hotplugs. If the capability changes between the true and
false calls, does this break the symmetry of the wakeref lifecycle?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261006220500.3417572-1-j@metarealtyinc.ca?part=1

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

* ✗ LGCI.VerificationFailed: failure for drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled (rev2)
  2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
                   ` (5 preceding siblings ...)
  2026-10-07 11:49 ` Jake Steinman
@ 2026-10-07 15:21 ` Patchwork
  6 siblings, 0 replies; 23+ messages in thread
From: Patchwork @ 2026-10-07 15:21 UTC (permalink / raw)
  To: Jake Steinman; +Cc: intel-xe

== Series Details ==

Series: drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled (rev2)
URL   : https://patchwork.freedesktop.org/series/174814/
State : failure

== Summary ==

Series author address 'j@metarealtyinc.ca' is not on the allowlist, which prevents CI from being automatically triggered.
If you want CI to run for this series, ask Patchwork project owners to click 'retest' on the series in Patchwork.
Exception occurred during validation, bailing out!
Build URL: http://intel-gfx-ci-public.igk.intel.com:8080/job/xe_pw_trigger/1304751/ (on master)



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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-10-06 22:05 ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Jake Steinman
  2026-10-07 14:20   ` sashiko-bot
@ 2026-11-20  9:42   ` Hogander, Jouni
  2026-11-20 15:03     ` Ville Syrjälä
  1 sibling, 1 reply; 23+ messages in thread
From: Hogander, Jouni @ 2026-11-20  9:42 UTC (permalink / raw)
  To: j@metarealtyinc.ca
  Cc: intel-xe@lists.freedesktop.org, Nautiyal, Ankit K, Vivi, Rodrigo,
	Manna, Animesh, intel-gfx@lists.freedesktop.org, Shankar, Uma,
	ville.syrjala@linux.intel.com, jani.nikula@linux.intel.com

On Tue, 2026-10-06 at 18:05 -0400, Jake Steinman wrote:
> Sinks that support async video timing in PR get the AS SDP suspended
> in
> PR Active (disable_as_sdp_when_pr_active). The LG panel in the Dell
> XPS
> 16 DA16260 (sink OUI 00:22:b9, "Balsa2") then judders while frames
> are
> updating, with the source flipping at a steady 8.33 ms. Leaving the
> AS
> SDP on fixes it but blocks DC5/DC6.
> 
> Clear PR_ALPM_CTL[AS SDP Transmission in Active Disable] while vblank
> interrupts are enabled and set it again when they are disabled. Panel
> Replay already holds DC_OFF while vblank is enabled, so no DC5/DC6
> residency is lost. Not done when AS SDP skip frames is in use.

Finally I was able to get confirmation internally on this. We should
actually use this approach.

Second patch in your set could be removal of the quirk? That one could
have tag "Closes:
https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9119"

Also add these into this patch:

Fixes: d6a8336c5f06 ("drm/i915/alpm: Write PR_ALPM_CTL register")
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.17+

> 
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119
> Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/8930
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Uma Shankar <uma.shankar@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
> ---
> Jouni, this is the fix for the stutter in the thread below. The 0x107
> bit 6 patch there is still correct but is not enough on its own.
> https://lore.kernel.org/r/20260923041342.2146450-1-j@metarealtyinc.ca
> 
> - Run as an equivalent change on 7.3-rc4 and rc5 (PTL, xe) since 28
> Sep:
>   smooth, DC5 still reached when idle. This drm-tip version is build
>   tested only (W=1, i915 and xe).
> - A seamless VRR toggle rewrites PR_ALPM_CTL through
>   intel_alpm_configure_pr_as_sdp() and sets the bit again until the
>   next vblank enable. Not handled here.
> - A second machine shows the same thing: XPS 13 (1028:0e53, same sink
>   OUI), fixed downstream by exiting PR on every flush (issue 8930).
> - Separate from this: the panel judders for a few seconds after panel
>   power-on. Locally I hold PR inactive after power-on; 3 s was not
>   quite enough, 8 s is clean. Not part of this patch.
> - CI has never run on my patches (address not on the allowlist, asked
>   twice). Could someone trigger it for this one and for series
> 174810?
>  .../drm/i915/display/intel_display_types.h    |  3 ++
>  drivers/gpu/drm/i915/display/intel_psr.c      | 36
> ++++++++++++++++++-
>  2 files changed, 38 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 0e3083e85..75113ed10 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1816,6 +1816,9 @@ struct intel_psr {
>  	bool dc3co_allowed;
>  	/* DC3CO disable work */
>  	struct delayed_work dc3co_work;
> +	/* AS SDP in PR Active follows vblank enable */
> +	bool pr_as_sdp_follow_vblank;
> +	bool vblank_enabled;
>  	u16 su_w_granularity;
>  	u16 su_y_granularity;
>  	bool source_panel_replay_support;
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 00d0146b2..0f0b1fc94 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -2166,6 +2166,29 @@ static bool psr_interrupt_error_check(struct
> intel_dp *intel_dp)
>  	return true;
>  }
>  
> +/*
> + * Sinks that support async video timing in PR get the AS SDP
> suspended in PR
> + * Active. Some then drift out of phase with the source and judder
> while
> + * frames are being updated. Send the AS SDP in PR Active while
> vblank
> + * interrupts are enabled: Panel Replay holds DC_OFF then anyway, so
> this
> + * costs no DC5/DC6 residency. Suspend it again when vblank
> interrupts are
> + * disabled, before DC_OFF is dropped.
> + */
> +static void intel_psr_pr_as_sdp_update(struct intel_dp *intel_dp)
> +{
> +	struct intel_display *display = to_intel_display(intel_dp);
> +
> +	lockdep_assert_held(&intel_dp->psr.lock);
> +
> +	if (!intel_dp->psr.enabled || !intel_dp-
> >psr.pr_as_sdp_follow_vblank)
> +		return;

You could drop pr_as_sdp_follow_vblank. Instead check here only
crtc_state->disable_as_sdp_when_pr_active and intel_dp->psr.enabled

Then just use inverted intel_dp->psr.vblank_enabled to set/clear the
bit.

Everything else: 

intel_alpm_pr_as_sdp_skip_frames_enabled
intel_psr_needs_alpm_aux_less
crtc_state->infoframes.enable &
intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC)

could be checked in compute_disable_as_sdp_when_pr_active.

Would this work for you?

> +
> +	intel_de_rmw(display, PR_ALPM_CTL(display, intel_dp-
> >psr.transcoder),
> +		    
> PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE,
> +		     intel_dp->psr.vblank_enabled ? 0 :
> +		    
> PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE);

I propose you add a new helper into intel_alpm.c providing interface
just to set the bit.

Also you need to remove setting the bit in
intel_alpm_configure_pr_as_sdp. That could be separate patch.

BR,
Jouni Högander

> +}
> +
>  static void intel_psr_enable_locked(struct intel_dp *intel_dp,
>  				    const struct intel_crtc_state
> *crtc_state)
>  {
> @@ -2225,6 +2248,12 @@ static void intel_psr_enable_locked(struct
> intel_dp *intel_dp,
>  	intel_dp->psr.enabled = true;
>  	intel_dp->psr.pause_counter = 0;
>  
> +	intel_dp->psr.pr_as_sdp_follow_vblank = crtc_state-
> >has_panel_replay &&
> +		crtc_state->disable_as_sdp_when_pr_active &&
> +		intel_dp->as_sdp_supported &&
> intel_dp_is_edp(intel_dp) &&
> +		!intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp,
> crtc_state);
> +	intel_psr_pr_as_sdp_update(intel_dp);
> +
>  	/*
>  	 * Link_ok is sticky and set here on PSR enable. We can
> assume link
>  	 * training is complete as we never continue to PSR enable
> with
> @@ -2400,6 +2429,7 @@ static void intel_psr_disable_locked(struct
> intel_dp *intel_dp)
>  	intel_dp->psr.pkg_c_latency_used = 0;
>  	cancel_delayed_work(&intel_dp->psr.dc3co_work);
>  	intel_dp->psr.dc3co_allowed = false;
> +	intel_dp->psr.pr_as_sdp_follow_vblank = false;
>  }
>  
>  /**
> @@ -4163,7 +4193,11 @@ void
> intel_psr_notify_vblank_enable_disable(struct intel_display *display,
>  				intel_dp->psr.vblank_wakeref =
>  					intel_display_power_get(disp
> lay,
>  								POWE
> R_DOMAIN_DC_OFF);
> -			else
> +
> +			intel_dp->psr.vblank_enabled = enable;
> +			intel_psr_pr_as_sdp_update(intel_dp);
> +
> +			if (!enable)
>  				intel_display_power_put(display,
> POWER_DOMAIN_DC_OFF,
>  							intel_dp-
> >psr.vblank_wakeref);
>  		}
> 
> base-commit: daeb062fc40f727fafefed080c6d12a5ad1d0d12

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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-11-20  9:42   ` Hogander, Jouni
@ 2026-11-20 15:03     ` Ville Syrjälä
  2026-11-20 16:34       ` Jake Steinman
  0 siblings, 1 reply; 23+ messages in thread
From: Ville Syrjälä @ 2026-11-20 15:03 UTC (permalink / raw)
  To: Hogander, Jouni
  Cc: j@metarealtyinc.ca, intel-xe@lists.freedesktop.org,
	Nautiyal, Ankit K, Vivi, Rodrigo, Manna, Animesh,
	intel-gfx@lists.freedesktop.org, Shankar, Uma,
	jani.nikula@linux.intel.com

On Fri, Nov 20, 2026 at 09:42:40AM +0000, Hogander, Jouni wrote:
> On Tue, 2026-10-06 at 18:05 -0400, Jake Steinman wrote:
> > Sinks that support async video timing in PR get the AS SDP suspended
> > in
> > PR Active (disable_as_sdp_when_pr_active). The LG panel in the Dell
> > XPS
> > 16 DA16260 (sink OUI 00:22:b9, "Balsa2") then judders while frames
> > are
> > updating, with the source flipping at a steady 8.33 ms. Leaving the
> > AS
> > SDP on fixes it but blocks DC5/DC6.
> > 
> > Clear PR_ALPM_CTL[AS SDP Transmission in Active Disable] while vblank
> > interrupts are enabled and set it again when they are disabled. Panel
> > Replay already holds DC_OFF while vblank is enabled, so no DC5/DC6
> > residency is lost. Not done when AS SDP skip frames is in use.
> 
> Finally I was able to get confirmation internally on this. We should
> actually use this approach.

Is this some weird hardware quirk of ours? I don't see what vblank
interrupts (purely an internal thing to the display engine) have to
do with the external panel receiving SDPs.

> 
> Second patch in your set could be removal of the quirk? That one could
> have tag "Closes:
> https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9119"
> 
> Also add these into this patch:
> 
> Fixes: d6a8336c5f06 ("drm/i915/alpm: Write PR_ALPM_CTL register")
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: intel-xe@lists.freedesktop.org
> Cc: <stable@vger.kernel.org> # v6.17+
> 
> > 
> > Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9119
> > Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/8930
> > Cc: Jouni Högander <jouni.hogander@intel.com>
> > Cc: Animesh Manna <animesh.manna@intel.com>
> > Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > Cc: Uma Shankar <uma.shankar@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
> > ---
> > Jouni, this is the fix for the stutter in the thread below. The 0x107
> > bit 6 patch there is still correct but is not enough on its own.
> > https://lore.kernel.org/r/20260923041342.2146450-1-j@metarealtyinc.ca
> > 
> > - Run as an equivalent change on 7.3-rc4 and rc5 (PTL, xe) since 28
> > Sep:
> >   smooth, DC5 still reached when idle. This drm-tip version is build
> >   tested only (W=1, i915 and xe).
> > - A seamless VRR toggle rewrites PR_ALPM_CTL through
> >   intel_alpm_configure_pr_as_sdp() and sets the bit again until the
> >   next vblank enable. Not handled here.
> > - A second machine shows the same thing: XPS 13 (1028:0e53, same sink
> >   OUI), fixed downstream by exiting PR on every flush (issue 8930).
> > - Separate from this: the panel judders for a few seconds after panel
> >   power-on. Locally I hold PR inactive after power-on; 3 s was not
> >   quite enough, 8 s is clean. Not part of this patch.
> > - CI has never run on my patches (address not on the allowlist, asked
> >   twice). Could someone trigger it for this one and for series
> > 174810?
> >  .../drm/i915/display/intel_display_types.h    |  3 ++
> >  drivers/gpu/drm/i915/display/intel_psr.c      | 36
> > ++++++++++++++++++-
> >  2 files changed, 38 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> > b/drivers/gpu/drm/i915/display/intel_display_types.h
> > index 0e3083e85..75113ed10 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> > +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> > @@ -1816,6 +1816,9 @@ struct intel_psr {
> >  	bool dc3co_allowed;
> >  	/* DC3CO disable work */
> >  	struct delayed_work dc3co_work;
> > +	/* AS SDP in PR Active follows vblank enable */
> > +	bool pr_as_sdp_follow_vblank;
> > +	bool vblank_enabled;
> >  	u16 su_w_granularity;
> >  	u16 su_y_granularity;
> >  	bool source_panel_replay_support;
> > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> > b/drivers/gpu/drm/i915/display/intel_psr.c
> > index 00d0146b2..0f0b1fc94 100644
> > --- a/drivers/gpu/drm/i915/display/intel_psr.c
> > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> > @@ -2166,6 +2166,29 @@ static bool psr_interrupt_error_check(struct
> > intel_dp *intel_dp)
> >  	return true;
> >  }
> >  
> > +/*
> > + * Sinks that support async video timing in PR get the AS SDP
> > suspended in PR
> > + * Active. Some then drift out of phase with the source and judder
> > while
> > + * frames are being updated. Send the AS SDP in PR Active while
> > vblank
> > + * interrupts are enabled: Panel Replay holds DC_OFF then anyway, so
> > this
> > + * costs no DC5/DC6 residency. Suspend it again when vblank
> > interrupts are
> > + * disabled, before DC_OFF is dropped.
> > + */
> > +static void intel_psr_pr_as_sdp_update(struct intel_dp *intel_dp)
> > +{
> > +	struct intel_display *display = to_intel_display(intel_dp);
> > +
> > +	lockdep_assert_held(&intel_dp->psr.lock);
> > +
> > +	if (!intel_dp->psr.enabled || !intel_dp-
> > >psr.pr_as_sdp_follow_vblank)
> > +		return;
> 
> You could drop pr_as_sdp_follow_vblank. Instead check here only
> crtc_state->disable_as_sdp_when_pr_active and intel_dp->psr.enabled
> 
> Then just use inverted intel_dp->psr.vblank_enabled to set/clear the
> bit.
> 
> Everything else: 
> 
> intel_alpm_pr_as_sdp_skip_frames_enabled
> intel_psr_needs_alpm_aux_less
> crtc_state->infoframes.enable &
> intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC)
> 
> could be checked in compute_disable_as_sdp_when_pr_active.
> 
> Would this work for you?
> 
> > +
> > +	intel_de_rmw(display, PR_ALPM_CTL(display, intel_dp-
> > >psr.transcoder),
> > +		    
> > PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE,
> > +		     intel_dp->psr.vblank_enabled ? 0 :
> > +		    
> > PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE);
> 
> I propose you add a new helper into intel_alpm.c providing interface
> just to set the bit.
> 
> Also you need to remove setting the bit in
> intel_alpm_configure_pr_as_sdp. That could be separate patch.
> 
> BR,
> Jouni Högander
> 
> > +}
> > +
> >  static void intel_psr_enable_locked(struct intel_dp *intel_dp,
> >  				    const struct intel_crtc_state
> > *crtc_state)
> >  {
> > @@ -2225,6 +2248,12 @@ static void intel_psr_enable_locked(struct
> > intel_dp *intel_dp,
> >  	intel_dp->psr.enabled = true;
> >  	intel_dp->psr.pause_counter = 0;
> >  
> > +	intel_dp->psr.pr_as_sdp_follow_vblank = crtc_state-
> > >has_panel_replay &&
> > +		crtc_state->disable_as_sdp_when_pr_active &&
> > +		intel_dp->as_sdp_supported &&
> > intel_dp_is_edp(intel_dp) &&
> > +		!intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp,
> > crtc_state);
> > +	intel_psr_pr_as_sdp_update(intel_dp);
> > +
> >  	/*
> >  	 * Link_ok is sticky and set here on PSR enable. We can
> > assume link
> >  	 * training is complete as we never continue to PSR enable
> > with
> > @@ -2400,6 +2429,7 @@ static void intel_psr_disable_locked(struct
> > intel_dp *intel_dp)
> >  	intel_dp->psr.pkg_c_latency_used = 0;
> >  	cancel_delayed_work(&intel_dp->psr.dc3co_work);
> >  	intel_dp->psr.dc3co_allowed = false;
> > +	intel_dp->psr.pr_as_sdp_follow_vblank = false;
> >  }
> >  
> >  /**
> > @@ -4163,7 +4193,11 @@ void
> > intel_psr_notify_vblank_enable_disable(struct intel_display *display,
> >  				intel_dp->psr.vblank_wakeref =
> >  					intel_display_power_get(disp
> > lay,
> >  								POWE
> > R_DOMAIN_DC_OFF);
> > -			else
> > +
> > +			intel_dp->psr.vblank_enabled = enable;
> > +			intel_psr_pr_as_sdp_update(intel_dp);
> > +
> > +			if (!enable)
> >  				intel_display_power_put(display,
> > POWER_DOMAIN_DC_OFF,
> >  							intel_dp-
> > >psr.vblank_wakeref);
> >  		}
> > 
> > base-commit: daeb062fc40f727fafefed080c6d12a5ad1d0d12

-- 
Ville Syrjälä
Intel

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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-11-20 15:03     ` Ville Syrjälä
@ 2026-11-20 16:34       ` Jake Steinman
  2026-11-20 17:23         ` Ville Syrjälä
  0 siblings, 1 reply; 23+ messages in thread
From: Jake Steinman @ 2026-11-20 16:34 UTC (permalink / raw)
  To: ville.syrjala, jouni.hogander
  Cc: intel-xe, intel-gfx, ankit.k.nautiyal, rodrigo.vivi,
	animesh.manna, uma.shankar, jani.nikula

Hi Ville,

On Fri, Nov 20, 2026 at 05:03:08PM +0200, Ville Syrjälä wrote:
> Is this some weird hardware quirk of ours? I don't see what vblank
> interrupts (purely an internal thing to the display engine) have to
> do with the external panel receiving SDPs.

The panel doesn't care about vblank interrupts. What it needs is the AS
SDP while frames are being updated. With the AS SDP suspended in PR
Active it judders, and with it sent all the time it's smooth but
DC5/DC6 is blocked.

Vblank enable is only used as the "frames are being updated" signal.
Userspace holds a vblank reference while it flips, and Panel Replay
already holds DC_OFF for that window, so sending the AS SDP then costs
no DC residency. It is suspended again before DC_OFF is dropped.

Jouni can say whether the internal confirmation explains why the panel
needs it. From my side I only know it's this sink (LG, OUI 00:22:b9)
on two Dell models.

Thanks,
Jake

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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-11-20 16:34       ` Jake Steinman
@ 2026-11-20 17:23         ` Ville Syrjälä
  2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
  2026-11-23  9:29           ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Hogander, Jouni
  0 siblings, 2 replies; 23+ messages in thread
From: Ville Syrjälä @ 2026-11-20 17:23 UTC (permalink / raw)
  To: Jake Steinman
  Cc: jouni.hogander, intel-xe, intel-gfx, ankit.k.nautiyal,
	rodrigo.vivi, animesh.manna, uma.shankar, jani.nikula

On Fri, Nov 20, 2026 at 11:34:16AM -0500, Jake Steinman wrote:
> Hi Ville,
> 
> On Fri, Nov 20, 2026 at 05:03:08PM +0200, Ville Syrjälä wrote:
> > Is this some weird hardware quirk of ours? I don't see what vblank
> > interrupts (purely an internal thing to the display engine) have to
> > do with the external panel receiving SDPs.
> 
> The panel doesn't care about vblank interrupts. What it needs is the AS
> SDP while frames are being updated. With the AS SDP suspended in PR
> Active it judders, and with it sent all the time it's smooth but
> DC5/DC6 is blocked.
> 
> Vblank enable is only used as the "frames are being updated" signal.
> Userspace holds a vblank reference while it flips, and Panel Replay
> already holds DC_OFF for that window, so sending the AS SDP then costs
> no DC residency. It is suspended again before DC_OFF is dropped.

Vblanks being on during flips all completely accidental. Userspace
asking for the vblank counter ahead of a flip is not mandatory.
The temporary vblank reference that query grabs also gets dropped
immediately, and if the flip isn't actually committed during the
same frame as the query the vblank interrupt will also have been
turned off by the time the flip hits the hardware.

With the DSB/flipq paths we don't hold any in-driver reference
to the vblank, and the only reason the mmio path does so is
because we're using the vblank interrupt for the completion. If
we had a better interrupt for the mmio path we wouldn't need the
vblank reference there either.

We should also be looking for a way to have userspace not do the
vblank query, or make the vblank query correct without actually
enabling vblank interrupts. Turning on vblank interrupts requires
us to turn the hardware on possibly earlier than necessary, which
will waste power. Without the vblank interrupt getting enabled
we could let the hw sleep until it actually needs to wake up for
the actual flip. Though I don't really have an answer how to get
an accurate vblank count for the query without turning some
hardware on at least.

> 
> Jouni can say whether the internal confirmation explains why the panel
> needs it. From my side I only know it's this sink (LG, OUI 00:22:b9)
> on two Dell models.
> 
> Thanks,
> Jake

-- 
Ville Syrjälä
Intel

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

* [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating
  2026-11-20 17:23         ` Ville Syrjälä
@ 2026-11-21 12:25           ` Jake Steinman
  2026-11-21 12:25             ` [PATCH v2 1/4] drm/i915/alpm: Add a helper to suspend the AS SDP in PR Active Jake Steinman
                               ` (3 more replies)
  2026-11-23  9:29           ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Hogander, Jouni
  1 sibling, 4 replies; 23+ messages in thread
From: Jake Steinman @ 2026-11-21 12:25 UTC (permalink / raw)
  To: jouni.hogander, ville.syrjala
  Cc: intel-gfx, intel-xe, animesh.manna, ankit.k.nautiyal, uma.shankar,
	rodrigo.vivi, jani.nikula

Jouni, Ville,

v2 of the RFC, split the way Jouni asked. Following Ville's comment it no
longer depends on vblank interrupts. A frontbuffer flush (flips, cursor
updates, frontbuffer rendering) clears AS SDP Transmission in Active
Disable, and a delayed work sets it again after 6 idle frames, the same
idle time DC3CO and DC5/DC6 use.

Tested on 7.4-rc3 on the Dell XPS 16 DA16260 (PTL, xe): Panel Replay SU
with Early Transport stays enabled, scrolling is smooth, including after
a lid close/open, which judders without this. DC5/DC6 is still entered
when idle. Rebased on drm-tip and build tested there (W=1, i915 and xe).

Changes since the RFC:
- Trigger on frame updates instead of vblank enable/disable (Ville)
- New intel_alpm_pr_as_sdp_in_active_disable() helper (Jouni)
- Drop pr_as_sdp_follow_vblank, do the checks in
  compute_disable_as_sdp_when_pr_active() (Jouni)
- Stop setting the bit in intel_alpm_configure_pr_as_sdp(), which also
  covers the seamless VRR toggle case from the RFC (Jouni)
- Remove the DA16260 quirk, add Fixes and stable tags (Jouni)

Jake Steinman (4):
  drm/i915/alpm: Add a helper to suspend the AS SDP in PR Active
  drm/i915/psr: Send the AS SDP in PR Active while frames are updating
  drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code
  drm/i915/display: Remove the Panel Replay quirk for Dell XPS 16
    DA16260

 drivers/gpu/drm/i915/display/intel_alpm.c     | 30 ++++++-
 drivers/gpu/drm/i915/display/intel_alpm.h     |  4 +
 .../drm/i915/display/intel_display_types.h    |  5 ++
 drivers/gpu/drm/i915/display/intel_dp.c       |  1 +
 drivers/gpu/drm/i915/display/intel_psr.c      | 90 ++++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_psr.h      |  2 +
 drivers/gpu/drm/i915/display/intel_quirks.c   |  8 --
 7 files changed, 126 insertions(+), 14 deletions(-)

-- 
2.56.1


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

* [PATCH v2 1/4] drm/i915/alpm: Add a helper to suspend the AS SDP in PR Active
  2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
@ 2026-11-21 12:25             ` Jake Steinman
  2026-11-21 12:25             ` [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
                               ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: Jake Steinman @ 2026-11-21 12:25 UTC (permalink / raw)
  To: jouni.hogander, ville.syrjala
  Cc: intel-gfx, intel-xe, animesh.manna, ankit.k.nautiyal, uma.shankar,
	rodrigo.vivi, jani.nikula

Add intel_alpm_pr_as_sdp_in_active_disable() to set or clear
PR_ALPM_CTL[AS SDP Transmission in Active Disable] without touching the
other PR_ALPM_CTL fields. PSR code uses it in the next patch to send the
AS SDP in PR Active while frames are being updated.

Cc: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
---
 drivers/gpu/drm/i915/display/intel_alpm.c | 22 ++++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_alpm.h |  4 ++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
index f54b29e19..910067d27 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -511,6 +511,28 @@ void intel_alpm_pr_as_sdp_update(const struct intel_crtc_state *crtc_state)
 	}
 }
 
+/**
+ * intel_alpm_pr_as_sdp_in_active_disable - suspend or send the AS SDP in PR Active
+ * @intel_dp: Intel DP struct
+ * @cpu_transcoder: transcoder Panel Replay is enabled on
+ * @disable: true to suspend the AS SDP in PR Active, false to keep sending it
+ *
+ * Set or clear PR_ALPM_CTL[AS SDP Transmission in Active Disable] and leave
+ * the other PR_ALPM_CTL fields as they are.
+ */
+void intel_alpm_pr_as_sdp_in_active_disable(struct intel_dp *intel_dp,
+					    enum transcoder cpu_transcoder,
+					    bool disable)
+{
+	struct intel_display *display = to_intel_display(intel_dp);
+
+	mutex_lock(&intel_dp->alpm.lock);
+	intel_de_rmw(display, PR_ALPM_CTL(display, cpu_transcoder),
+		     PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE,
+		     disable ? PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE : 0);
+	mutex_unlock(&intel_dp->alpm.lock);
+}
+
 static void lnl_alpm_configure(struct intel_dp *intel_dp,
 			       const struct intel_crtc_state *crtc_state)
 {
diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h b/drivers/gpu/drm/i915/display/intel_alpm.h
index f8f605d94..a45ddd04f 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.h
+++ b/drivers/gpu/drm/i915/display/intel_alpm.h
@@ -14,6 +14,7 @@ struct drm_connector_state;
 struct intel_connector;
 struct intel_atomic_state;
 struct intel_crtc;
+enum transcoder;
 
 void intel_alpm_init(struct intel_dp *intel_dp);
 bool intel_alpm_compute_params(struct intel_dp *intel_dp,
@@ -37,6 +38,9 @@ bool intel_alpm_is_alpm_aux_less(struct intel_dp *intel_dp,
 bool intel_alpm_pr_as_sdp_skip_frames_enabled(struct intel_dp *intel_dp,
 					      const struct intel_crtc_state *crtc_state);
 void intel_alpm_pr_as_sdp_update(const struct intel_crtc_state *crtc_state);
+void intel_alpm_pr_as_sdp_in_active_disable(struct intel_dp *intel_dp,
+					    enum transcoder cpu_transcoder,
+					    bool disable);
 void intel_alpm_disable(struct intel_dp *intel_dp);
 bool intel_alpm_get_error(struct intel_dp *intel_dp);
 void intel_alpm_lobf_compute_config_late(struct intel_dp *intel_dp,
-- 
2.56.1


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

* [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating
  2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
  2026-11-21 12:25             ` [PATCH v2 1/4] drm/i915/alpm: Add a helper to suspend the AS SDP in PR Active Jake Steinman
@ 2026-11-21 12:25             ` Jake Steinman
  2026-11-23 15:45               ` sashiko-bot
  2026-11-21 12:25             ` [PATCH v2 3/4] drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code Jake Steinman
  2026-11-21 12:25             ` [PATCH v2 4/4] drm/i915/display: Remove the Panel Replay quirk for Dell XPS 16 DA16260 Jake Steinman
  3 siblings, 1 reply; 23+ messages in thread
From: Jake Steinman @ 2026-11-21 12:25 UTC (permalink / raw)
  To: jouni.hogander, ville.syrjala
  Cc: intel-gfx, intel-xe, animesh.manna, ankit.k.nautiyal, uma.shankar,
	rodrigo.vivi, jani.nikula

Sinks that support async video timing in PR get the AS SDP suspended in
PR Active (disable_as_sdp_when_pr_active). The LG panel in the Dell XPS
16 DA16260 (sink OUI 00:22:b9) then judders while frames are updating,
with the source flipping at a steady 8.33 ms. Leaving the AS SDP on
fixes it but blocks DC5/DC6.

Clear PR_ALPM_CTL[AS SDP Transmission in Active Disable] on a frontbuffer
flush (flips, cursor updates and frontbuffer rendering) and set it again
from a delayed work once there has been no flush for 6 frames, the same
idle time DC3CO and DC5/DC6 use.

disable_as_sdp_when_pr_active is now computed after the AS SDP config
and is only set when the AS SDP is actually sent, ALPM AUX-less is used
and AS SDP skip frames is not.

Fixes: d6a8336c5f06 ("drm/i915/alpm: Write PR_ALPM_CTL register")
Cc: Jouni Högander <jouni.hogander@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.17+
Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
---
 .../drm/i915/display/intel_display_types.h    |  5 ++
 drivers/gpu/drm/i915/display/intel_dp.c       |  1 +
 drivers/gpu/drm/i915/display/intel_psr.c      | 90 ++++++++++++++++++-
 drivers/gpu/drm/i915/display/intel_psr.h      |  2 +
 4 files changed, 94 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
index 90a5d2916..991d3a2fe 100644
--- a/drivers/gpu/drm/i915/display/intel_display_types.h
+++ b/drivers/gpu/drm/i915/display/intel_display_types.h
@@ -1823,6 +1823,11 @@ struct intel_psr {
 	bool dc3co_allowed;
 	/* DC3CO disable work */
 	struct delayed_work dc3co_work;
+	/* AS SDP in PR Active is sent while frames are being updated */
+	bool disable_as_sdp_when_pr_active;
+	bool as_sdp_in_active;
+	unsigned long as_sdp_idle_delay;
+	struct delayed_work as_sdp_work;
 	u16 su_w_granularity;
 	u16 su_y_granularity;
 	bool source_panel_replay_support;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index ef164a797..7b8a8c3a4 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3830,6 +3830,7 @@ intel_dp_compute_config(struct intel_atomic_state *state,
 	intel_vrr_compute_config(pipe_config, conn_state);
 	intel_psr_compute_config(intel_dp, pipe_config, conn_state);
 	intel_dp_compute_as_sdp(intel_dp, pipe_config);
+	intel_psr_compute_as_sdp_config(intel_dp, pipe_config);
 	intel_alpm_lobf_compute_config(intel_dp, pipe_config, conn_state);
 	intel_dp_drrs_compute_config(connector, pipe_config, link_bpp_x16);
 	intel_dp_compute_vsc_sdp(intel_dp, pipe_config, conn_state);
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index bd1656360..8407b34f2 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1704,10 +1704,38 @@ static inline bool compute_link_off_after_as_sdp_when_pr_active(struct intel_con
 		DP_PANEL_REPLAY_LINK_OFF_SUPPORTED_IN_PR_AFTER_ADAPTIVE_SYNC_SDP);
 }
 
-static inline bool compute_disable_as_sdp_when_pr_active(struct intel_connector *connector)
+static bool compute_disable_as_sdp_when_pr_active(struct intel_dp *intel_dp,
+						  const struct intel_crtc_state *crtc_state)
 {
-	return !(connector->dp.panel_replay_caps.dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_CAPABILITY)] &
-		 DP_PANEL_REPLAY_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR);
+	struct intel_connector *connector = intel_dp->attached_connector;
+	const u8 *pr_dpcd = connector->dp.panel_replay_caps.dpcd;
+
+	if (pr_dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_CAPABILITY)] &
+	    DP_PANEL_REPLAY_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR)
+		return false;
+
+	/* AS SDP skip frames needs the AS SDP to keep flowing in PR Active */
+	if (intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp, crtc_state))
+		return false;
+
+	return intel_psr_needs_alpm_aux_less(intel_dp, crtc_state) &&
+		(crtc_state->infoframes.enable &
+		 intel_hdmi_infoframe_enable(DP_SDP_ADAPTIVE_SYNC));
+}
+
+/**
+ * intel_psr_compute_as_sdp_config - compute whether the AS SDP is suspended in PR Active
+ * @intel_dp: Intel DP struct
+ * @crtc_state: crtc state
+ *
+ * Must be called after the AS SDP infoframe has been computed.
+ */
+void intel_psr_compute_as_sdp_config(struct intel_dp *intel_dp,
+				     struct intel_crtc_state *crtc_state)
+{
+	crtc_state->disable_as_sdp_when_pr_active =
+		crtc_state->has_panel_replay &&
+		compute_disable_as_sdp_when_pr_active(intel_dp, crtc_state);
 }
 
 static bool _panel_replay_compute_config(struct intel_crtc_state *crtc_state,
@@ -1745,7 +1773,6 @@ static bool _panel_replay_compute_config(struct intel_crtc_state *crtc_state,
 	}
 
 	crtc_state->link_off_after_as_sdp_when_pr_active = compute_link_off_after_as_sdp_when_pr_active(connector);
-	crtc_state->disable_as_sdp_when_pr_active = compute_disable_as_sdp_when_pr_active(connector);
 
 	if (!intel_dp_is_edp(intel_dp))
 		return true;
@@ -2183,6 +2210,47 @@ static bool psr_interrupt_error_check(struct intel_dp *intel_dp)
 	return true;
 }
 
+/*
+ * Sinks that support async video timing in PR get the AS SDP suspended in PR
+ * Active. Some of them then drift out of phase with the source and judder
+ * while frames are being updated. Send the AS SDP in PR Active from the first
+ * frame update and suspend it again once the display has been idle for
+ * as_sdp_idle_delay. DC5/DC6 needs the same number of idle frames, so little
+ * DC5/DC6 residency is lost.
+ */
+static void intel_psr_pr_as_sdp_suspend_work(struct work_struct *work)
+{
+	struct intel_dp *intel_dp =
+		container_of(work, typeof(*intel_dp), psr.as_sdp_work.work);
+
+	mutex_lock(&intel_dp->psr.lock);
+	if (intel_dp->psr.enabled && intel_dp->psr.as_sdp_in_active) {
+		intel_alpm_pr_as_sdp_in_active_disable(intel_dp, intel_dp->psr.transcoder,
+						       true);
+		intel_dp->psr.as_sdp_in_active = false;
+	}
+	mutex_unlock(&intel_dp->psr.lock);
+}
+
+static void intel_psr_pr_as_sdp_flush_locked(struct intel_dp *intel_dp)
+{
+	struct intel_display *display = to_intel_display(intel_dp);
+
+	lockdep_assert_held(&intel_dp->psr.lock);
+
+	if (!intel_dp->psr.disable_as_sdp_when_pr_active)
+		return;
+
+	if (!intel_dp->psr.as_sdp_in_active) {
+		intel_alpm_pr_as_sdp_in_active_disable(intel_dp, intel_dp->psr.transcoder,
+						       false);
+		intel_dp->psr.as_sdp_in_active = true;
+	}
+
+	mod_delayed_work(display->wq.unordered, &intel_dp->psr.as_sdp_work,
+			 intel_dp->psr.as_sdp_idle_delay);
+}
+
 static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 				    const struct intel_crtc_state *crtc_state)
 {
@@ -2201,6 +2269,7 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 	/* DC5/DC6 requires at least 6 idle frames */
 	val = usecs_to_jiffies(intel_get_frame_time_us(crtc_state) * 6);
 	intel_dp->psr.dc3co_exit_delay = val;
+	intel_dp->psr.as_sdp_idle_delay = val;
 	intel_dp->psr.psr2_sel_fetch_enabled = crtc_state->enable_psr2_sel_fetch;
 	intel_dp->psr.su_region_et_enabled = crtc_state->enable_psr2_su_region_et;
 	intel_dp->psr.psr2_sel_fetch_cff_enabled = false;
@@ -2211,6 +2280,9 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 	intel_dp->psr.io_wake_lines = crtc_state->alpm_state.io_wake_lines;
 	intel_dp->psr.fast_wake_lines = crtc_state->alpm_state.fast_wake_lines;
 	intel_dp->psr.entry_setup_frames = crtc_state->entry_setup_frames;
+	intel_dp->psr.disable_as_sdp_when_pr_active =
+		crtc_state->disable_as_sdp_when_pr_active;
+	intel_dp->psr.as_sdp_in_active = false;
 
 	if (!psr_interrupt_error_check(intel_dp))
 		return;
@@ -2243,6 +2315,10 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
 	intel_dp->psr.enabled = true;
 	intel_dp->psr.pause_counter = 0;
 
+	if (intel_dp->psr.disable_as_sdp_when_pr_active)
+		intel_alpm_pr_as_sdp_in_active_disable(intel_dp, intel_dp->psr.transcoder,
+						       true);
+
 	/*
 	 * Link_ok is sticky and set here on PSR enable. We can assume link
 	 * training is complete as we never continue to PSR enable with
@@ -2419,6 +2495,8 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp)
 	intel_dp->psr.pipe_mask = 0;
 	cancel_delayed_work(&intel_dp->psr.dc3co_work);
 	intel_dp->psr.dc3co_allowed = false;
+	cancel_delayed_work(&intel_dp->psr.as_sdp_work);
+	intel_dp->psr.as_sdp_in_active = false;
 }
 
 /**
@@ -2449,6 +2527,7 @@ void intel_psr_disable(struct intel_dp *intel_dp,
 	mutex_unlock(&intel_dp->psr.lock);
 	cancel_work_sync(&intel_dp->psr.work);
 	cancel_delayed_work_sync(&intel_dp->psr.dc3co_work);
+	cancel_delayed_work_sync(&intel_dp->psr.as_sdp_work);
 }
 
 /**
@@ -3853,6 +3932,8 @@ void intel_psr_flush(struct intel_display *display,
 
 		intel_dp->psr.busy_frontbuffer_bits &= ~pipe_frontbuffer_bits;
 
+		intel_psr_pr_as_sdp_flush_locked(intel_dp);
+
 		if (intel_dp->psr.pause_counter)
 			goto rearm;
 
@@ -3931,6 +4012,7 @@ void intel_psr_init(struct intel_dp *intel_dp)
 
 	INIT_WORK(&intel_dp->psr.work, intel_psr_work);
 	INIT_DELAYED_WORK(&intel_dp->psr.dc3co_work, psr2_dc3co_disable_work);
+	INIT_DELAYED_WORK(&intel_dp->psr.as_sdp_work, intel_psr_pr_as_sdp_suspend_work);
 	mutex_init(&intel_dp->psr.lock);
 }
 
diff --git a/drivers/gpu/drm/i915/display/intel_psr.h b/drivers/gpu/drm/i915/display/intel_psr.h
index d545fdaa0..ddeccb3a9 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.h
+++ b/drivers/gpu/drm/i915/display/intel_psr.h
@@ -80,6 +80,8 @@ int intel_psr_min_set_context_latency(const struct intel_crtc_state *crtc_state)
 void intel_psr_connector_debugfs_add(struct intel_connector *connector);
 void intel_psr_debugfs_register(struct intel_display *display);
 bool intel_psr_needs_alpm(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state);
+void intel_psr_compute_as_sdp_config(struct intel_dp *intel_dp,
+				     struct intel_crtc_state *crtc_state);
 bool intel_psr_needs_alpm_aux_less(struct intel_dp *intel_dp,
 				   const struct intel_crtc_state *crtc_state);
 void intel_psr_compute_config_late(struct intel_dp *intel_dp,
-- 
2.56.1


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

* [PATCH v2 3/4] drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code
  2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
  2026-11-21 12:25             ` [PATCH v2 1/4] drm/i915/alpm: Add a helper to suspend the AS SDP in PR Active Jake Steinman
  2026-11-21 12:25             ` [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
@ 2026-11-21 12:25             ` Jake Steinman
  2026-11-23 15:32               ` sashiko-bot
  2026-11-21 12:25             ` [PATCH v2 4/4] drm/i915/display: Remove the Panel Replay quirk for Dell XPS 16 DA16260 Jake Steinman
  3 siblings, 1 reply; 23+ messages in thread
From: Jake Steinman @ 2026-11-21 12:25 UTC (permalink / raw)
  To: jouni.hogander, ville.syrjala
  Cc: intel-gfx, intel-xe, animesh.manna, ankit.k.nautiyal, uma.shankar,
	rodrigo.vivi, jani.nikula

PSR code now sets and clears PR_ALPM_CTL[AS SDP Transmission in Active
Disable] around frame updates. Stop setting it in
intel_alpm_configure_pr_as_sdp() and keep its current value instead, so
that a seamless VRR toggle no longer suspends the AS SDP while frames are
being updated.

Cc: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
---
 drivers/gpu/drm/i915/display/intel_alpm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
index 910067d27..6f2beb4a4 100644
--- a/drivers/gpu/drm/i915/display/intel_alpm.c
+++ b/drivers/gpu/drm/i915/display/intel_alpm.c
@@ -467,8 +467,12 @@ static void intel_alpm_configure_pr_as_sdp(struct intel_dp *intel_dp,
 	} else {
 		pr_alpm_ctl &= ~PR_ALPM_CTL_AS_SDP_SKIP_FRAMES_MASK;
 
-		if (crtc_state->disable_as_sdp_when_pr_active)
-			pr_alpm_ctl |= PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE;
+		/*
+		 * AS SDP Transmission in Active Disable follows frame updates
+		 * and is owned by PSR code, keep its current value.
+		 */
+		pr_alpm_ctl |= intel_de_read(display, PR_ALPM_CTL(display, cpu_transcoder)) &
+			PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE;
 
 		if (intel_display_power_dc3co_allowed(display))
 			pr_alpm_ctl |= PR_ALPM_CTL_USE_DC3CO_IDLE_PROTOCOL;
-- 
2.56.1


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

* [PATCH v2 4/4] drm/i915/display: Remove the Panel Replay quirk for Dell XPS 16 DA16260
  2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
                               ` (2 preceding siblings ...)
  2026-11-21 12:25             ` [PATCH v2 3/4] drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code Jake Steinman
@ 2026-11-21 12:25             ` Jake Steinman
  3 siblings, 0 replies; 23+ messages in thread
From: Jake Steinman @ 2026-11-21 12:25 UTC (permalink / raw)
  To: jouni.hogander, ville.syrjala
  Cc: intel-gfx, intel-xe, animesh.manna, ankit.k.nautiyal, uma.shankar,
	rodrigo.vivi, jani.nikula

Panel Replay was disabled on the Dell XPS 16 DA16260 because the panel
judders with it. The judder comes from the AS SDP being suspended in PR
Active, which the previous patches fix by sending it while frames are
being updated. Panel Replay Selective Update works on this
laptop now, so remove the quirk.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/work_items/9119
Cc: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Jake Steinman <j@metarealtyinc.ca>
---
 drivers/gpu/drm/i915/display/intel_quirks.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index 96eb9a40d..6070440f8 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -289,14 +289,6 @@ static const struct intel_dpcd_quirk intel_dpcd_quirks[] = {
 		.sink_oui = SINK_OUI(0x00, 0x22, 0xb9),
 		.hook = quirk_disable_edp_panel_replay,
 	},
-	/* Dell XPS 16 DA16260 */
-	{
-		.device = DEVICE_ID_ANY,
-		.subsystem_vendor = 0x1028,
-		.subsystem_device = 0x0dba,
-		.sink_oui = SINK_OUI(0x00, 0x22, 0xb9),
-		.hook = quirk_disable_edp_panel_replay,
-	},
 	/* TUXEDO InsanityBook 15 v1 */
 	{
 		.device = 0x591b,
-- 
2.56.1


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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-11-20 17:23         ` Ville Syrjälä
  2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
@ 2026-11-23  9:29           ` Hogander, Jouni
  2026-11-23 13:32             ` Jake Steinman
  1 sibling, 1 reply; 23+ messages in thread
From: Hogander, Jouni @ 2026-11-23  9:29 UTC (permalink / raw)
  To: ville.syrjala@linux.intel.com, j@metarealtyinc.ca
  Cc: intel-xe@lists.freedesktop.org, Vivi,  Rodrigo, Shankar, Uma,
	Nautiyal, Ankit K, intel-gfx@lists.freedesktop.org,
	jani.nikula@linux.intel.com, Manna, Animesh

On Fri, 2026-11-20 at 19:23 +0200, Ville Syrjälä wrote:
> On Fri, Nov 20, 2026 at 11:34:16AM -0500, Jake Steinman wrote:
> > Hi Ville,
> > 
> > On Fri, Nov 20, 2026 at 05:03:08PM +0200, Ville Syrjälä wrote:
> > > Is this some weird hardware quirk of ours? I don't see what
> > > vblank
> > > interrupts (purely an internal thing to the display engine) have
> > > to
> > > do with the external panel receiving SDPs.
> > 
> > The panel doesn't care about vblank interrupts. What it needs is
> > the AS
> > SDP while frames are being updated. With the AS SDP suspended in PR
> > Active it judders, and with it sent all the time it's smooth but
> > DC5/DC6 is blocked.
> > 
> > Vblank enable is only used as the "frames are being updated"
> > signal.
> > Userspace holds a vblank reference while it flips, and Panel Replay
> > already holds DC_OFF for that window, so sending the AS SDP then
> > costs
> > no DC residency. It is suspended again before DC_OFF is dropped.
> 
> Vblanks being on during flips all completely accidental. Userspace
> asking for the vblank counter ahead of a flip is not mandatory.
> The temporary vblank reference that query grabs also gets dropped
> immediately, and if the flip isn't actually committed during the
> same frame as the query the vblank interrupt will also have been
> turned off by the time the flip hits the hardware.
> 
> With the DSB/flipq paths we don't hold any in-driver reference
> to the vblank, and the only reason the mmio path does so is
> because we're using the vblank interrupt for the completion. If
> we had a better interrupt for the mmio path we wouldn't need the
> vblank reference there either.
> 
> We should also be looking for a way to have userspace not do the
> vblank query, or make the vblank query correct without actually
> enabling vblank interrupts. Turning on vblank interrupts requires
> us to turn the hardware on possibly earlier than necessary, which
> will waste power. Without the vblank interrupt getting enabled
> we could let the hw sleep until it actually needs to wake up for
> the actual flip. Though I don't really have an answer how to get
> an accurate vblank count for the query without turning some
> hardware on at least.

Current implementation is based on my wrong interpretation of
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE. I understood active
in this context means panel is self refreshing and source side is in
sleep. This is not the case. It means Panel Replay is just enabled. It
may be also in live frame mode.

Now when vblank interrupt is enabled it is triggering Panel Replay exit
and entry to live frame mode. If
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE is set AS SDP sending
is not continued.

Probably re-enabling AS SDP is not needed on single selective update or
maybe HW is sending one AS SDP and communicating SU using that instead
of VSC SDP? Anyways we need to clear
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE for that live frame
mode triggered by vblank enable.

BR,
Jouni Högander
> 
> > 
> > Jouni can say whether the internal confirmation explains why the
> > panel
> > needs it. From my side I only know it's this sink (LG, OUI
> > 00:22:b9)
> > on two Dell models.

> > 
> > Thanks,
> > Jake

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

* Re: [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled
  2026-11-23  9:29           ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Hogander, Jouni
@ 2026-11-23 13:32             ` Jake Steinman
  0 siblings, 0 replies; 23+ messages in thread
From: Jake Steinman @ 2026-11-23 13:32 UTC (permalink / raw)
  To: jouni.hogander, ville.syrjala
  Cc: intel-xe, intel-gfx, ankit.k.nautiyal, rodrigo.vivi,
	animesh.manna, uma.shankar, jani.nikula

Hi Jouni,

On Mon, 2026-11-23 at 09:29 +0000, Hogander, Jouni wrote:
> Now when vblank interrupt is enabled it is triggering Panel Replay exit
> and entry to live frame mode. If
> PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE is set AS SDP sending
> is not continued.

Thanks, that explains it. The bit suppresses the AS SDP in live frame
mode, and live frame mode is entered when frames are updated. v2 [1]
clears the bit on every PSR flush (flip, cursor, frontbuffer) and sets
it again after 6 idle frames, so it follows the updates directly rather
than vblank, which was only a proxy. Vblank enable with no update
leaves it set, since nothing on screen changes there.

Two days on v2 here: one brief possible judder that did not recur and
may have been load, otherwise smooth.

[1] https://lore.kernel.org/all/cover.1795263689.git.j@metarealtyinc.ca/

Thanks,
Jake

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

* Re: [PATCH v2 3/4] drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code
  2026-11-21 12:25             ` [PATCH v2 3/4] drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code Jake Steinman
@ 2026-11-23 15:32               ` sashiko-bot
  0 siblings, 0 replies; 23+ messages in thread
From: sashiko-bot @ 2026-11-23 15:32 UTC (permalink / raw)
  To: Jake Steinman; +Cc: intel-gfx, intel-xe

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/i915/alpm: stale AS SDP disable bit in
  intel_alpm_configure_pr_as_sdp()
- [Medium] drm/i915/alpm: broken AS SDP state on VRR toggle with
  periodic AS SDP
--

commit 37f90c53a8bab894fcb3ca18180ab5863311f8e3
Author: Jake Steinman <j@metarealtyinc.ca>

drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code

This commit changes intel_alpm_configure_pr_as_sdp() to preserve the current
hardware value of PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE instead
of setting it from crtc_state->disable_as_sdp_when_pr_active.

> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 910067d271c3c..6f2beb4a4c7c0 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -467,8 +467,12 @@ static void intel_alpm_configure_pr_as_sdp(struct intel_dp *intel_dp,
>  	} else {
>  		pr_alpm_ctl &= ~PR_ALPM_CTL_AS_SDP_SKIP_FRAMES_MASK;
>  
> -		if (crtc_state->disable_as_sdp_when_pr_active)
> -			pr_alpm_ctl |= PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE;
> +		/*
> +		 * AS SDP Transmission in Active Disable follows frame updates
> +		 * and is owned by PSR code, keep its current value.
> +		 */
> +		pr_alpm_ctl |= intel_de_read(display, PR_ALPM_CTL(display, cpu_transcoder)) &
> +			PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE;
>  
>  		if (intel_display_power_dc3co_allowed(display))
>  			pr_alpm_ctl |= PR_ALPM_CTL_USE_DC3CO_IDLE_PROTOCOL;

[Severity: Medium]
Can PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE remain stuck set when
a transcoder is later configured with skip_frames == 0 and
!crtc_state->disable_as_sdp_when_pr_active?

Neither intel_psr_disable_locked() nor intel_alpm_disable() clears this bit
in PR_ALPM_CTL, and intel_psr_enable_locked() only writes it when
intel_dp->psr.disable_as_sdp_when_pr_active is true:

drivers/gpu/drm/i915/display/intel_psr.c:intel_psr_enable_locked() {
	...
	if (intel_dp->psr.disable_as_sdp_when_pr_active)
		intel_alpm_pr_as_sdp_in_active_disable(intel_dp, intel_dp->psr.transcoder,
						       true);
	...
}

Once a Panel Replay session sets the bit, switching to a configuration where
disable_as_sdp_when_pr_active is false (such as disabling Panel Replay and
enabling AUX-less LOBF via intel_alpm_lobf_enable(), or modesetting to a
mode where compute_disable_as_sdp_when_pr_active() is false) will preserve
the stale bit in PR_ALPM_CTL and keep Adaptive-Sync SDP transmission
disabled in active states with no path clearing it.

[Severity: Medium]
What happens on a seamless VRR toggle via intel_alpm_pr_as_sdp_update() when
periodic AS SDP (skip_frames > 0) is used?

When VRR is off and skip_frames > 0, the if (skip_frames) branch clears
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE in PR_ALPM_CTL, and
compute_disable_as_sdp_when_pr_active() returns false.  If Panel Replay was
enabled while VRR was off, intel_dp->psr.disable_as_sdp_when_pr_active (only
latched in intel_psr_enable_locked()) is also false.  When VRR is later
enabled seamlessly (skip_frames == 0), reading PR_ALPM_CTL here reads back 0
and PSR frontbuffer flush/idle tracking ignores AS SDP because
intel_dp->psr.disable_as_sdp_when_pr_active is still false, leaving AS SDP
transmission in PR Active permanently enabled while idle and blocking
DC5/DC6.

Conversely, if Panel Replay is enabled with VRR on
(intel_dp->psr.disable_as_sdp_when_pr_active == true) and VRR is seamlessly
disabled (skip_frames > 0), intel_dp->psr.disable_as_sdp_when_pr_active
remains true and intel_psr_pr_as_sdp_suspend_work() can subsequently set
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE while non-zero skip_frames
is programmed, violating their mutual exclusion.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795263689.git.j@metarealtyinc.ca?part=3

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

* Re: [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating
  2026-11-21 12:25             ` [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
@ 2026-11-23 15:45               ` sashiko-bot
  0 siblings, 0 replies; 23+ messages in thread
From: sashiko-bot @ 2026-11-23 15:45 UTC (permalink / raw)
  To: Jake Steinman; +Cc: intel-gfx, intel-xe

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/i915/psr: stale psr.disable_as_sdp_when_pr_active on
  seamless VRR toggle
--

commit 80915725d9b9cf87d3b5497256fb042ac9a0cf2a
Author: Jake Steinman <j@metarealtyinc.ca>

drm/i915/psr: Send the AS SDP in PR Active while frames are updating

This commit enables Adaptive Sync SDP transmission in Panel Replay Active on
frontbuffer flushes and suspends it again via delayed work after 6 idle
frames.  It also refines disable_as_sdp_when_pr_active so that it is disabled
when periodic AS SDP skip frames is enabled.

> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index bd16563603249..8407b34f23934 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -1704,10 +1704,38 @@ static inline bool compute_link_off_after_as_sdp_when_pr_active(struct intel_con
>  		DP_PANEL_REPLAY_LINK_OFF_SUPPORTED_IN_PR_AFTER_ADAPTIVE_SYNC_SDP);
>  }
>  
> -static inline bool compute_disable_as_sdp_when_pr_active(struct intel_connector *connector)
> +static bool compute_disable_as_sdp_when_pr_active(struct intel_dp *intel_dp,
> +						  const struct intel_crtc_state *crtc_state)
>  {
> -	return !(connector->dp.panel_replay_caps.dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_CAPABILITY)] &
> -		 DP_PANEL_REPLAY_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR);
> +	struct intel_connector *connector = intel_dp->attached_connector;
> +	const u8 *pr_dpcd = connector->dp.panel_replay_caps.dpcd;
> +
> +	if (pr_dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_CAPABILITY)] &
> +	    DP_PANEL_REPLAY_ASYNC_VIDEO_TIMING_NOT_SUPPORTED_IN_PR)
> +		return false;
> +
> +	/* AS SDP skip frames needs the AS SDP to keep flowing in PR Active */
> +	if (intel_alpm_pr_as_sdp_skip_frames_enabled(intel_dp, crtc_state))
> +		return false;

[ ... ]

> @@ -2211,6 +2280,9 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
>  	intel_dp->psr.io_wake_lines = crtc_state->alpm_state.io_wake_lines;
>  	intel_dp->psr.fast_wake_lines = crtc_state->alpm_state.fast_wake_lines;
>  	intel_dp->psr.entry_setup_frames = crtc_state->entry_setup_frames;
> +	intel_dp->psr.disable_as_sdp_when_pr_active =
> +		crtc_state->disable_as_sdp_when_pr_active;
> +	intel_dp->psr.as_sdp_in_active = false;

[Severity: Medium]
Can intel_dp->psr.disable_as_sdp_when_pr_active become stale across a
seamless VRR fastset?

Because intel_alpm_pr_as_sdp_skip_frames_enabled() is gated on
!crtc_state->vrr.enable, toggling VRR when periodic AS SDP skip frames is
configured flips crtc_state->disable_as_sdp_when_pr_active between true (VRR
on) and false (VRR off).  During a seamless VRR transition, Panel Replay
stays enabled and intel_psr_post_plane_update() does not call
intel_psr_enable_locked(), so intel_dp->psr.disable_as_sdp_when_pr_active,
intel_dp->psr.as_sdp_in_active, and intel_dp->psr.as_sdp_work are not
updated to match the new crtc_state.

Even with the follow-up commit "drm/i915/alpm: Leave AS SDP Transmission in
Active Disable to PSR code" preserving
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE in
intel_alpm_configure_pr_as_sdp() when skip_frames is 0, toggling VRR off
leaves intel_dp->psr.disable_as_sdp_when_pr_active set to true, so
intel_psr_pr_as_sdp_suspend_work() will set
PR_ALPM_CTL_AS_SDP_TRANSMISSION_IN_ACTIVE_DISABLE after 6 idle frames while
mutually exclusive PR_ALPM_CTL_AS_SDP_SKIP_FRAMES is enabled.  Conversely,
toggling VRR on leaves intel_dp->psr.disable_as_sdp_when_pr_active set to
false, so intel_psr_pr_as_sdp_flush_locked() never schedules as_sdp_work and
AS SDP transmission in PR Active remains permanently enabled when idle,
blocking DC5/DC6.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1795263689.git.j@metarealtyinc.ca?part=2

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

end of thread, other threads:[~2026-11-23 15:45 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-23  4:13 [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Jake Steinman
2026-09-23 14:27 ` sashiko-bot
2026-09-23 15:25   ` Jake Steinman
2026-09-23 15:10 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-09-28 12:23 ` [PATCH] " Jake Steinman
2026-10-06 22:05 ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Jake Steinman
2026-10-07 14:20   ` sashiko-bot
2026-11-20  9:42   ` Hogander, Jouni
2026-11-20 15:03     ` Ville Syrjälä
2026-11-20 16:34       ` Jake Steinman
2026-11-20 17:23         ` Ville Syrjälä
2026-11-21 12:25           ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
2026-11-21 12:25             ` [PATCH v2 1/4] drm/i915/alpm: Add a helper to suspend the AS SDP in PR Active Jake Steinman
2026-11-21 12:25             ` [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Jake Steinman
2026-11-23 15:45               ` sashiko-bot
2026-11-21 12:25             ` [PATCH v2 3/4] drm/i915/alpm: Leave AS SDP Transmission in Active Disable to PSR code Jake Steinman
2026-11-23 15:32               ` sashiko-bot
2026-11-21 12:25             ` [PATCH v2 4/4] drm/i915/display: Remove the Panel Replay quirk for Dell XPS 16 DA16260 Jake Steinman
2026-11-23  9:29           ` [RFC PATCH] drm/i915/psr: Send the AS SDP in PR Active while vblank is enabled Hogander, Jouni
2026-11-23 13:32             ` Jake Steinman
2026-10-07  6:41 ` [PATCH] drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled Hogander, Jouni
2026-10-07 11:49 ` Jake Steinman
2026-10-07 15:21 ` ✗ LGCI.VerificationFailed: failure for drm/i915/dp: Don't promise AS SDPs in PR Active when they are disabled (rev2) Patchwork

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