All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Borah, Chaitanya Kumar" <chaitanya.kumar.borah@intel.com>
To: "Kandpal, Suraj" <suraj.kandpal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: RE: [PATCH 2/2] drm/i915/lnl: Program PKGC_LATENCY register
Date: Mon, 5 Feb 2024 07:55:27 +0000	[thread overview]
Message-ID: <SJ1PR11MB6129F34B321815E5BEA5FBDCB9472@SJ1PR11MB6129.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20240201085158.1000285-3-suraj.kandpal@intel.com>



> -----Original Message-----
> From: Kandpal, Suraj <suraj.kandpal@intel.com>
> Sent: Thursday, February 1, 2024 2:22 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Borah, Chaitanya Kumar <chaitanya.kumar.borah@intel.com>; Kandpal,
> Suraj <suraj.kandpal@intel.com>
> Subject: [PATCH 2/2] drm/i915/lnl: Program PKGC_LATENCY register
> 
> Program the PKGC_LATENCY register with the highest latency from level 1 and
> above LP registers else program with all 1's.
> This is used to improve package C residency by sending the highest latency
> tolerance requirement (LTR) when the planes are done with the frame until
> the next frame programming window (set context latency, window 2) starts.
> Bspec: 68986
> 
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/skl_watermark.c | 31 ++++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c
> b/drivers/gpu/drm/i915/display/skl_watermark.c
> index 051a02ac01a4..c07376f37baa 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -3394,6 +3394,34 @@ static void skl_read_wm_latency(struct
> drm_i915_private *i915, u16 wm[])
>  	adjust_wm_latency(i915, wm, num_levels, read_latency);  }
> 
> +/*
> + * Program PKG_C_LATENCY Pkg C with highest valid latency from
> + * watermark level1 and up and above. If watermark level 1 is
> + * invalid program it with all 1's.
> + * Program PKG_C_LATENCY Added Wake Time = 0.
> + */
> +static void intel_program_pkgc_latency(struct drm_i915_private *i915,
> +				       u16 wm_latency[])
> +{
> +	u16 max_value = 0;
> +	u32 clear = 0, val = 0;
> +	int max_level = i915->display.wm.num_levels, i;
> +
> +	for (i = 1; i <= max_level; i++) {
> +		if (wm_latency[i] == 0)
> +			break;
> +	else if (wm_latency[i] > max_value)

Fix the indentation here.

With the understanding that this is a bare bones implementation and pending work will be floated in a different series.

LGTM

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

> +		max_value = wm_latency[i];
> +	}
> +
> +	if (max_value == 0)
> +		max_value = ~0 & LNL_PKG_C_LATENCY_MASK;
> +
> +	clear |= LNL_ADDED_WAKE_TIME_MASK |
> LNL_PKG_C_LATENCY_MASK;
> +	val |= max_value;
> +	intel_uncore_rmw(&i915->uncore, LNL_PKG_C_LATENCY, clear, val); }
> +
>  static void skl_setup_wm_latency(struct drm_i915_private *i915)  {
>  	if (HAS_HW_SAGV_WM(i915))
> @@ -3407,6 +3435,9 @@ static void skl_setup_wm_latency(struct
> drm_i915_private *i915)
>  		skl_read_wm_latency(i915, i915->display.wm.skl_latency);
> 
>  	intel_print_wm_latency(i915, "Gen9 Plane", i915-
> >display.wm.skl_latency);
> +
> +	if (DISPLAY_VER(i915) >= 20)
> +		intel_program_pkgc_latency(i915, i915-
> >display.wm.skl_latency);
>  }
> 
>  static const struct intel_wm_funcs skl_wm_funcs = {
> --
> 2.25.1


  reply	other threads:[~2024-02-05  7:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01  8:51 [PATCH 0/2] Program Deep PKG_C_LATENCY register Suraj Kandpal
2024-02-01  8:51 ` [PATCH 1/2] drm/i915/lnl: Add pkgc related register Suraj Kandpal
2024-02-02  7:37   ` Borah, Chaitanya Kumar
2024-02-07 10:46   ` Govindapillai, Vinod
2024-02-01  8:51 ` [PATCH 2/2] drm/i915/lnl: Program PKGC_LATENCY register Suraj Kandpal
2024-02-05  7:55   ` Borah, Chaitanya Kumar [this message]
2024-02-05  8:01   ` Suraj Kandpal
2024-02-05 10:19     ` Jani Nikula
2024-02-05 17:22       ` Kandpal, Suraj
2024-02-08  8:59         ` Jani Nikula
2024-02-07 11:21     ` Govindapillai, Vinod
2024-02-13  6:28     ` Suraj Kandpal
2024-02-14 10:43       ` Govindapillai, Vinod
2024-02-19  6:36       ` Suraj Kandpal
2024-02-19  9:23         ` Govindapillai, Vinod
2024-02-01 16:36 ` ✗ Fi.CI.SPARSE: warning for Program Deep PKG_C_LATENCY register Patchwork
2024-02-01 19:55 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-01 21:56 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-05  9:47 ` ✗ Fi.CI.SPARSE: warning for Program Deep PKG_C_LATENCY register (rev2) Patchwork
2024-02-05 10:01 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-05 12:37 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-13  7:34 ` ✗ Fi.CI.SPARSE: warning for Program Deep PKG_C_LATENCY register (rev3) Patchwork
2024-02-13  7:48 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-13  9:25 ` ✓ Fi.CI.IGT: " Patchwork
2024-02-19  7:21 ` ✗ Fi.CI.SPARSE: warning for Program Deep PKG_C_LATENCY register (rev4) Patchwork
2024-02-19  7:34 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-19  9:19 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-02-20 11:22 ` ✓ Fi.CI.IGT: success " 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=SJ1PR11MB6129F34B321815E5BEA5FBDCB9472@SJ1PR11MB6129.namprd11.prod.outlook.com \
    --to=chaitanya.kumar.borah@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.