All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>,
	Gustavo Sousa <gustavo.sousa@intel.com>
Subject: Re: [PATCH 4/4] drm/i915/bw: Extract get_display_bw_params()
Date: Wed, 08 Apr 2026 22:21:27 +0300	[thread overview]
Message-ID: <3532245b5fb2827db469939ff10be987b50a14a2@intel.com> (raw)
In-Reply-To: <20260408-separate-platform-from-diplay-ip-specific-bw-params-v1-4-23c53afa7db0@intel.com>

On Wed, 08 Apr 2026, Gustavo Sousa <gustavo.sousa@intel.com> wrote:
> Just like it is done for the platform-specific bandwidth parameters, use
> a separate function named get_display_bw_params() to return the display
> IP-specific parameters.  This simplifies intel_bw_init_hw() by having
> just one call for each of *_get_info() function.
>
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c | 31 ++++++++++++++++++++-----------
>  1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
> index 64c6f18346bb..1f08fb893ee7 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -529,12 +529,26 @@ static const struct intel_display_bw_params xelpdp_disp_bw_params = {
>  	.displayrtids = 256,
>  };
>  
> +static const struct intel_display_bw_params *get_display_bw_params(struct intel_display *display)
> +{
> +	if (DISPLAY_VER(display) >= 14) {
> +		return &xelpdp_disp_bw_params;
> +	} else if (DISPLAY_VER(display) >= 12) {
> +		if (display->platform.rocketlake)
> +			return &rkl_disp_bw_params;
> +		else
> +			return &tgl_disp_bw_params;
> +	} else {
> +		return &icl_disp_bw_params;
> +	}
> +}
> +
>  static int icl_get_bw_info(struct intel_display *display,
> -			   const struct dram_info *dram_info,
> -			   const struct intel_display_bw_params *disp_bw_params)
> +			   const struct dram_info *dram_info)
>  {
>  	struct intel_qgv_info qi = {};
>  	const struct intel_platform_bw_params *plat_bw_params = get_platform_bw_params(display);
> +	const struct intel_display_bw_params *disp_bw_params = get_display_bw_params(display);

I would pass both of these in as parameters, with centralized
assignment, and not have every single function call the getters.

>  	bool is_y_tile = true; /* assume y tile may be used */
>  	int num_channels = max_t(u8, 1, dram_info->num_channels);
>  	int ipqdepth, ipqdepthpch = 16;
> @@ -602,11 +616,11 @@ static int icl_get_bw_info(struct intel_display *display,
>  }
>  
>  static int tgl_get_bw_info(struct intel_display *display,
> -			   const struct dram_info *dram_info,
> -			   const struct intel_display_bw_params *disp_bw_params)
> +			   const struct dram_info *dram_info)
>  {
>  	struct intel_qgv_info qi = {};
>  	const struct intel_platform_bw_params *plat_bw_params = get_platform_bw_params(display);
> +	const struct intel_display_bw_params *disp_bw_params = get_display_bw_params(display);
>  	bool is_y_tile = true; /* assume y tile may be used */
>  	int num_channels = max_t(u8, 1, dram_info->num_channels);
>  	int ipqdepth, ipqdepthpch = 16;
> @@ -893,17 +907,12 @@ void intel_bw_init_hw(struct intel_display *display)
>  
>  	if (DISPLAY_VERx100(display) >= 1401 && display->platform.dgfx) {
>  		xe2_hpd_get_bw_info(display, dram_info);
> -	} else if (DISPLAY_VER(display) >= 14) {
> -		tgl_get_bw_info(display, dram_info, &xelpdp_disp_bw_params);
>  	} else if (display->platform.dg2) {
>  		dg2_get_bw_info(display);
>  	} else if (DISPLAY_VER(display) >= 12) {
> -		if (display->platform.rocketlake)
> -			tgl_get_bw_info(display, dram_info, &rkl_disp_bw_params);
> -		else
> -			tgl_get_bw_info(display, dram_info, &tgl_disp_bw_params);
> +		tgl_get_bw_info(display, dram_info);
>  	} else if (DISPLAY_VER(display) == 11) {
> -		icl_get_bw_info(display, dram_info, &icl_disp_bw_params);
> +		icl_get_bw_info(display, dram_info);
>  	}
>  }

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-04-08 19:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 18:52 [PATCH 0/4] drm/i915/bw: Split bandwidth params into platform- and display-IP-specific structs Gustavo Sousa
2026-04-08 18:52 ` [PATCH 1/4] drm/i915/bw: Extract platform-specific parameters Gustavo Sousa
2026-04-08 19:16   ` Jani Nikula
2026-04-08 19:41     ` Gustavo Sousa
2026-04-09 23:12     ` Matt Roper
2026-04-10 14:39       ` Gustavo Sousa
2026-04-10 17:33         ` Matt Roper
2026-04-10 21:15           ` Gustavo Sousa
2026-04-14 16:10             ` Gustavo Sousa
2026-05-04  9:02               ` Jani Nikula
2026-04-14 16:04           ` Gustavo Sousa
2026-04-29 18:47           ` Rodrigo Vivi
2026-04-08 18:53 ` [PATCH 2/4] drm/i915/bw: Deduplicate intel_sa_info instances Gustavo Sousa
2026-04-09 23:26   ` Matt Roper
2026-04-10 14:49     ` Gustavo Sousa
2026-04-10 17:36       ` Matt Roper
2026-04-08 18:53 ` [PATCH 3/4] drm/i915/bw: Rename struct intel_sa_info to intel_display_bw_params Gustavo Sousa
2026-04-08 19:20   ` Jani Nikula
2026-04-08 19:51     ` Gustavo Sousa
2026-04-09 23:32     ` Matt Roper
2026-04-08 18:53 ` [PATCH 4/4] drm/i915/bw: Extract get_display_bw_params() Gustavo Sousa
2026-04-08 19:21   ` Jani Nikula [this message]
2026-04-09  1:23 ` ✓ i915.CI.BAT: success for drm/i915/bw: Split bandwidth params into platform- and display-IP-specific structs Patchwork
2026-04-09  8:33 ` ✓ i915.CI.Full: " 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=3532245b5fb2827db469939ff10be987b50a14a2@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@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.