Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Animesh Manna <animesh.manna@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org
Cc: jouni.hogander@intel.com, suraj.kandpal@intel.com,
	Animesh Manna <animesh.manna@intel.com>
Subject: Re: [PATCH v7 01/20] drm/i915/alpm: Program zero-based LFPS half cycle duration
Date: Tue, 27 Oct 2026 17:33:51 +0200	[thread overview]
Message-ID: <899b4a9b4406fe7bf1287ea8e6adba7ef60d31af@intel.com> (raw)
In-Reply-To: <20261026054001.799894-2-animesh.manna@intel.com>

On Mon, 26 Oct 2026, Animesh Manna <animesh.manna@intel.com> wrote:
> The LFPS Half Cycle Duration field, as well as the First and Last LFPS
> Half Cycle Duration fields, in PORT_ALPM_LFPS_CTL are zero-based: per
> Bspec the value programmed must be N_Symbol - 1. The number of symbols
> was programmed directly, making each half cycle one symbol clock too
> long.
>
> Subtract one in the PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION,
> PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION and
> PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION field macros so the
> programmed value matches the zero-based field encoding.
>
> Since the fields now encode 1 to 32 symbols, update the bounds check
> in _lnl_compute_aux_less_alpm_params() to accept a half cycle of 32
> symbols and reject 0, which cannot be encoded.
>
> v2: Adjust half cycle bounds check for zero-based encoding. [sashiko]
>
> Bspec: 71632
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c     |  3 ++-
>  drivers/gpu/drm/i915/display/intel_psr_regs.h | 12 +++++++++---
>  2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c b/drivers/gpu/drm/i915/display/intel_alpm.c
> index f54b29e193ee..8542bd9c9666 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -134,7 +134,8 @@ _lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp,
>  
>  	if (aux_less_wake_lines > ALPM_CTL_AUX_LESS_WAKE_TIME_MASK ||
>  	    silence_period > PORT_ALPM_CTL_SILENCE_PERIOD_MASK ||
> -	    lfps_half_cycle > PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK)
> +	    lfps_half_cycle < 1 ||
> +	    lfps_half_cycle > PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK + 1)
>  		return false;
>  
>  	if (display->params.psr_safest_params)
> diff --git a/drivers/gpu/drm/i915/display/intel_psr_regs.h b/drivers/gpu/drm/i915/display/intel_psr_regs.h
> index a57bc111290d..78a05387eab5 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr_regs.h
> +++ b/drivers/gpu/drm/i915/display/intel_psr_regs.h
> @@ -335,11 +335,17 @@
>  #define  PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MASK		REG_GENMASK(27, 24)
>  #define  PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MIN		7
>  #define  PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT(val)		REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MASK, (val) - PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT_MIN)
> +/*
> + * The LFPS half cycle duration fields (including the first and last half
> + * cycle) are zero-based, i.e. the value programmed is N_Symbol - 1.
> + *
> + * Bspec: 71632
> + */

Please let's not normalize adding bspec references to code comments.

>  #define  PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK	REG_GENMASK(20, 16)
> -#define  PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION(val)	REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK, val)
> +#define  PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION(val)	REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION_MASK, (val) - 1)
>  #define  PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION_MASK	REG_GENMASK(12, 8)
> -#define  PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION(val)	REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION_MASK, val)
> +#define  PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION(val)	REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_FIRST_LFPS_HALF_CYCLE_DURATION_MASK, (val) - 1)
>  #define  PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK	REG_GENMASK(4, 0)
> -#define  PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION(val)	REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK, val)
> +#define  PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION(val)	REG_FIELD_PREP(PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK, (val) - 1)
>  
>  #endif /* __INTEL_PSR_REGS_H__ */

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-10-27 15:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  5:39 [PATCH v7 00/20] Enable DP2.1 alpm Animesh Manna
2026-10-26  5:39 ` [PATCH v7 01/20] drm/i915/alpm: Program zero-based LFPS half cycle duration Animesh Manna
2026-10-27 15:33   ` Jani Nikula [this message]
2026-10-28  5:42     ` Manna, Animesh
2026-10-26  5:39 ` [PATCH v7 02/20] drm/dp: Add DPCD definitions for DP2.1 ALPM capability Animesh Manna
2026-10-26  5:39 ` [PATCH v7 03/20] drm/i915/alpm: Move alpm sink capability readout into a separate function Animesh Manna
2026-10-26  5:39 ` [PATCH v7 04/20] drm/i915/alpm: alpm_init() for DP2.1 Animesh Manna
2026-10-26  7:11   ` sashiko-bot
2026-10-26  5:39 ` [PATCH v7 05/20] drm/i915/alpm: Enable debugfs " Animesh Manna
2026-10-26  5:39 ` [PATCH v7 06/20] drm/i915/alpm: Refactor Auxless wake time calculation Animesh Manna
2026-10-26  5:39 ` [PATCH v7 07/20] drm/i915/alpm: Auxless wake time calculation for Xe3p Animesh Manna
2026-10-26  5:39 ` [PATCH v7 08/20] drm/i915/alpm: Modify AUX_LESS_WAKE_TIME bitfield for xe3lpd Animesh Manna
2026-10-26  5:39 ` [PATCH v7 09/20] drm/i915/alpm: table based establishment period Animesh Manna
2026-10-26  5:39 ` [PATCH v7 10/20] drm/i915/alpm: Half LFPS cycle calculation Animesh Manna
2026-10-26  7:06   ` sashiko-bot
2026-10-26  5:39 ` [PATCH v7 11/20] drm/i915/alpm: Modify LFPS cycle count for DP ALPM Animesh Manna
2026-10-26  5:39 ` [PATCH v7 12/20] drm/i915/alpm: Modify LFPS_CYCLE_COUNT bitfield for xe3lpd Animesh Manna
2026-10-26  5:39 ` [PATCH v7 13/20] drm/i915/alpm: Program LTTPR count for DP 2.1 ALPM Animesh Manna
2026-10-26  5:39 ` [PATCH v7 14/20] drm/i915/alpm: Enable MAC Transmitting LFPS for LT PHY Animesh Manna
2026-10-26  5:39 ` [PATCH v7 15/20] drm/i915/alpm: Compute and program switch to active latency Animesh Manna
2026-10-26  5:39 ` [PATCH v7 16/20] drm/i915/alpm: Replace is_edp() with alpm_is_possible() Animesh Manna
2026-10-26  7:16   ` sashiko-bot
2026-10-26  5:39 ` [PATCH v7 17/20] drm/i915/alpm: Disallow ALPM for UHBR link rate Animesh Manna
2026-10-26  5:39 ` [PATCH v7 18/20] drm/i915/alpm: Compute ALPM config before PSR config Animesh Manna
2026-10-26  5:39 ` [PATCH v7 19/20] drm/i915/alpm: Introduce has_alpm to decouple from pr/psr2/lobf Animesh Manna
2026-10-26  7:23   ` sashiko-bot
2026-10-26  5:39 ` [PATCH v7 20/20] drm/i915/dp: Enable AS SDP for DP Panel Replay with AUX-less ALPM Animesh Manna
2026-10-26  5:50 ` ✗ CI.checkpatch: warning for Enable DP2.1 alpm (rev7) Patchwork
2026-10-26  5:52 ` ✓ CI.KUnit: success " Patchwork
2026-10-26  6:28 ` ✓ Xe.CI.BAT: " Patchwork
2026-10-26  8:06 ` ✗ Xe.CI.FULL: failure " Patchwork

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=899b4a9b4406fe7bf1287ea8e6adba7ef60d31af@intel.com \
    --to=jani.nikula@intel.com \
    --cc=animesh.manna@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jouni.hogander@intel.com \
    --cc=suraj.kandpal@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