Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"j@metarealtyinc.ca" <j@metarealtyinc.ca>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Shankar, Uma" <uma.shankar@intel.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	"Manna, Animesh" <animesh.manna@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"jani.nikula@linux.intel.com" <jani.nikula@linux.intel.com>,
	"Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH v2 2/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating
Date: Tue, 24 Nov 2026 11:02:10 +0000	[thread overview]
Message-ID: <d87777cc8530d642bf0ee0ac9a3ca35e206cefac.camel@intel.com> (raw)
In-Reply-To: <ada2073fc66fa74685b73ac085513c5299b1526f.1795263689.git.j@metarealtyinc.ca>

On Sat, 2026-11-21 at 07:25 -0500, 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) 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.

You don't need this patch. Flush is disabling Panel Replay and then
this disable_as_sdp_when_pr_active doesn't matter.

BR,
Jouni Högander

> 
> 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_ADAPT
> IVE_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_CA
> PABILITY)] &
> -		
> 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,

  parent reply	other threads:[~2026-11-24 11:02 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-24 11:00               ` Hogander, Jouni
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-24 11:02               ` Hogander, Jouni [this message]
2026-11-24 11:16                 ` Hogander, Jouni
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-24 11:19               ` Hogander, Jouni
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-24 11:20             ` [PATCH v2 0/4] drm/i915/psr: Send the AS SDP in PR Active while frames are updating Hogander, Jouni
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d87777cc8530d642bf0ee0ac9a3ca35e206cefac.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=animesh.manna@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=j@metarealtyinc.ca \
    --cc=jani.nikula@linux.intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox