Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 03/11] drm/i915/bw: Initialize num_planes sensibly for the first plane group in TGL+
Date: Thu, 4 Jun 2026 14:46:23 +0000	[thread overview]
Message-ID: <415e473ab03f9f754cc746c26e236e406b90ecf4.camel@intel.com> (raw)
In-Reply-To: <20260528103458.18069-4-ville.syrjala@linux.intel.com>

On Thu, 2026-05-28 at 13:34 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The way the TGL+ bw algorithm works is that 'num_planes'
> is really a maximum number of allowed planes (whereas in
> the ICL version it was more of a minimum), and the
> assumption is that the first plane group (max[0]) can be
> used with any number of planes (tgl_max_bw_index() always
> returns 0 at the end).
> 
> To make things a bit less weird let's just set the first
> plane group's num_planes to some big number to indicate it
> has no real limit on the number of planes.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c
> b/drivers/gpu/drm/i915/display/intel_bw.c
> index 887628144864..4b5db4ca7773 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -629,6 +629,8 @@ static int tgl_get_bw_info(struct intel_display
> *display,
>  	 */
>  	clperchgroup = 4 * (8 / num_channels) * qi.deinterleave;
>  
> +	display->bw.max[0].num_planes = U8_MAX;
> +
>  	for (i = 0; i < num_groups; i++) {
>  		struct intel_bw_info *bi = &display->bw.max[i];
>  		struct intel_bw_info *bi_next;
> @@ -701,10 +703,10 @@ static void dg2_get_bw_info(struct
> intel_display *display)
>  {
>  	int i;
>  
> +	display->bw.max[0].num_planes = U8_MAX;
>  	display->bw.max[0].deratedbw[0] = display->platform.dg2_g11
> ? 38000 : 50000;
>  
>  	/* Bandwidth does not depend on # of planes; set all groups
> the same */
> -	display->bw.max[0].num_planes = 1;
>  	display->bw.max[0].num_qgv_points = 1;
>  	for (i = 1; i < ARRAY_SIZE(display->bw.max); i++)
>  		display->bw.max[i] = display->bw.max[0];
> @@ -731,6 +733,8 @@ static int xe2_hpd_get_bw_info(struct
> intel_display *display,
>  	peakbw = tgl_peakbw(num_channels, qi.channel_width,
> icl_sagv_max_dclk(&qi));
>  	maxdebw = min(soc_bw_params->deprogbwlimit * 1000, peakbw *
> DEPROGBWPCLIMIT / 100);
>  
> +	display->bw.max[0].num_planes = U8_MAX;
> +
>  	for (i = 0; i < qi.num_points; i++) {
>  		const struct intel_qgv_point *sp = &qi.points[i];
>  		int bw = tgl_peakbw(num_channels, qi.channel_width,
> sp->dclk);
> @@ -745,7 +749,6 @@ static int xe2_hpd_get_bw_info(struct
> intel_display *display,
>  	}
>  
>  	/* Bandwidth does not depend on # of planes; set all groups
> the same */
> -	display->bw.max[0].num_planes = 1;
>  	display->bw.max[0].num_qgv_points = qi.num_points;
>  	for (i = 1; i < ARRAY_SIZE(display->bw.max); i++)
>  		display->bw.max[i] = display->bw.max[0];
> @@ -808,7 +811,7 @@ static unsigned int tgl_max_bw_index(struct
> intel_display *display,
>  			return i;
>  	}
>  
> -	return 0;
> +	return UINT_MAX;
>  }

Thanks for the details. I had a wrong understanding about this bw
groups. Well it kind of worked when I added the pmdemand stuff related
find qgv points for mtl as it was returning 0 here!

But I see that you had updated the mtl_find_qgv_points() part of this
as a separate patch. Should that be squashed into this as well? 

Other than that, things look much logical now.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>

>  
>  static unsigned int adl_psf_bw(struct intel_display *display,


  reply	other threads:[~2026-06-04 14:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 10:34 [PATCH 00/11] drm/i915/bw: Cleanups Ville Syrjala
2026-05-28 10:34 ` [PATCH 01/11] drm/i915/bw: Don't memcpy() pointlessly Ville Syrjala
2026-06-01 20:54   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 02/11] drm/i915/bw: Streamline dg2_get_bw_info() Ville Syrjala
2026-06-01 21:02   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 03/11] drm/i915/bw: Initialize num_planes sensibly for the first plane group in TGL+ Ville Syrjala
2026-06-04 14:46   ` Govindapillai, Vinod [this message]
2026-05-28 10:34 ` [PATCH 04/11] drm/i915/bw: Move 'bi_next' to tighter scope Ville Syrjala
2026-06-04 14:48   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 05/11] drn/i915/bw: s/num_points/num_qgv_points/ Ville Syrjala
2026-06-04 14:49   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 06/11] drm/i915/bw: Move num_{qgv, psf}_points out from the plane group Ville Syrjala
2026-06-04 14:53   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 07/11] drm/i915/bw: Move psf_bw[] " Ville Syrjala
2026-06-04 14:55   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 08/11] drm/i915/bw: Move peakbw[] " Ville Syrjala
2026-06-04 14:57   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 09/11] drm/i915/bw: Print derated bandwidth numbers for DG2 Ville Syrjala
2026-06-04 14:58   ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 10/11] drm/i915/bw: Use icl_qgv_bw() Ville Syrjala
2026-06-04 14:59   ` Govindapillai, Vinod
2026-06-04 15:12     ` Ville Syrjälä
2026-06-04 15:22       ` Govindapillai, Vinod
2026-06-04 15:31         ` Ville Syrjälä
2026-06-04 15:40           ` Govindapillai, Vinod
2026-05-28 10:34 ` [PATCH 11/11] drm/i915/bw: Simplify the best max_data_rate search Ville Syrjala
2026-06-04 16:14   ` Govindapillai, Vinod
2026-05-28 11:58 ` ✓ i915.CI.BAT: success for drm/i915/bw: Cleanups Patchwork
2026-05-28 18:10 ` ✗ i915.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=415e473ab03f9f754cc746c26e236e406b90ecf4.camel@intel.com \
    --to=vinod.govindapillai@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --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