Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Nikula, Jani" <jani.nikula@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [RESEND 1/6] drm/i915/bw: pass struct dram_info pointer around
Date: Wed, 4 Jun 2025 12:45:17 +0000	[thread overview]
Message-ID: <38816ee29422d032499465ec7cb6d4ec2a8d40ca.camel@intel.com> (raw)
In-Reply-To: <1752b4987ff39a685c28cebae1be4ce326b67c7b.1748337870.git.jani.nikula@intel.com>

On Tue, 2025-05-27 at 12:25 +0300, Jani Nikula wrote:
> Have just one place to figure out the pointer to struct dram_info, and
> pass that around. This simplifies future changes.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c | 44 ++++++++++++-------------
>  1 file changed, 22 insertions(+), 22 deletions(-)
> 

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


> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
> index a5dd2932b852..6c537635b120 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -218,11 +218,10 @@ intel_read_qgv_point_info(struct intel_display *display,
>  }
>  
>  static int icl_get_qgv_points(struct intel_display *display,
> +			      const struct dram_info *dram_info,
>  			      struct intel_qgv_info *qi,
>  			      bool is_y_tile)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
> -	const struct dram_info *dram_info = &i915->dram_info;
>  	int i, ret;
>  
>  	qi->num_points = dram_info->num_qgv_points;
> @@ -418,19 +417,20 @@ static const struct intel_sa_info xe3lpd_sa_info = {
>  	.derating = 10,
>  };
>  
> -static int icl_get_bw_info(struct intel_display *display, const struct intel_sa_info *sa)
> +static int icl_get_bw_info(struct intel_display *display,
> +			   const struct dram_info *dram_info,
> +			   const struct intel_sa_info *sa)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_qgv_info qi = {};
>  	bool is_y_tile = true; /* assume y tile may be used */
> -	int num_channels = max_t(u8, 1, i915->dram_info.num_channels);
> +	int num_channels = max_t(u8, 1, dram_info->num_channels);
>  	int ipqdepth, ipqdepthpch = 16;
>  	int dclk_max;
>  	int maxdebw;
>  	int num_groups = ARRAY_SIZE(display->bw.max);
>  	int i, ret;
>  
> -	ret = icl_get_qgv_points(display, &qi, is_y_tile);
> +	ret = icl_get_qgv_points(display, dram_info, &qi, is_y_tile);
>  	if (ret) {
>  		drm_dbg_kms(display->drm,
>  			    "Failed to get memory subsystem information, ignoring bandwidth
> limits");
> @@ -488,11 +488,11 @@ static int icl_get_bw_info(struct intel_display *display, const struct
> intel_sa_
>  	return 0;
>  }
>  
> -static int tgl_get_bw_info(struct intel_display *display, const struct intel_sa_info *sa)
> +static int tgl_get_bw_info(struct intel_display *display,
> +			   const struct dram_info *dram_info,
> +			   const struct intel_sa_info *sa)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_qgv_info qi = {};
> -	const struct dram_info *dram_info = &i915->dram_info;
>  	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;
> @@ -502,7 +502,7 @@ static int tgl_get_bw_info(struct intel_display *display, const struct
> intel_sa_
>  	int num_groups = ARRAY_SIZE(display->bw.max);
>  	int i, ret;
>  
> -	ret = icl_get_qgv_points(display, &qi, is_y_tile);
> +	ret = icl_get_qgv_points(display, dram_info, &qi, is_y_tile);
>  	if (ret) {
>  		drm_dbg_kms(display->drm,
>  			    "Failed to get memory subsystem information, ignoring bandwidth
> limits");
> @@ -632,15 +632,15 @@ static void dg2_get_bw_info(struct intel_display *display)
>  }
>  
>  static int xe2_hpd_get_bw_info(struct intel_display *display,
> +			       const struct dram_info *dram_info,
>  			       const struct intel_sa_info *sa)
>  {
> -	struct drm_i915_private *i915 = to_i915(display->drm);
>  	struct intel_qgv_info qi = {};
> -	int num_channels = i915->dram_info.num_channels;
> +	int num_channels = dram_info->num_channels;
>  	int peakbw, maxdebw;
>  	int ret, i;
>  
> -	ret = icl_get_qgv_points(display, &qi, true);
> +	ret = icl_get_qgv_points(display, dram_info, &qi, true);
>  	if (ret) {
>  		drm_dbg_kms(display->drm,
>  			    "Failed to get memory subsystem information, ignoring bandwidth
> limits");
> @@ -769,26 +769,26 @@ void intel_bw_init_hw(struct intel_display *display)
>  		return;
>  
>  	if (DISPLAY_VER(display) >= 30)
> -		tgl_get_bw_info(display, &xe3lpd_sa_info);
> +		tgl_get_bw_info(display, dram_info, &xe3lpd_sa_info);
>  	else if (DISPLAY_VERx100(display) >= 1401 && display->platform.dgfx &&
>  		 dram_info->type == INTEL_DRAM_GDDR_ECC)
> -		xe2_hpd_get_bw_info(display, &xe2_hpd_ecc_sa_info);
> +		xe2_hpd_get_bw_info(display, dram_info, &xe2_hpd_ecc_sa_info);
>  	else if (DISPLAY_VERx100(display) >= 1401 && display->platform.dgfx)
> -		xe2_hpd_get_bw_info(display, &xe2_hpd_sa_info);
> +		xe2_hpd_get_bw_info(display, dram_info, &xe2_hpd_sa_info);
>  	else if (DISPLAY_VER(display) >= 14)
> -		tgl_get_bw_info(display, &mtl_sa_info);
> +		tgl_get_bw_info(display, dram_info, &mtl_sa_info);
>  	else if (display->platform.dg2)
>  		dg2_get_bw_info(display);
>  	else if (display->platform.alderlake_p)
> -		tgl_get_bw_info(display, &adlp_sa_info);
> +		tgl_get_bw_info(display, dram_info, &adlp_sa_info);
>  	else if (display->platform.alderlake_s)
> -		tgl_get_bw_info(display, &adls_sa_info);
> +		tgl_get_bw_info(display, dram_info, &adls_sa_info);
>  	else if (display->platform.rocketlake)
> -		tgl_get_bw_info(display, &rkl_sa_info);
> +		tgl_get_bw_info(display, dram_info, &rkl_sa_info);
>  	else if (DISPLAY_VER(display) == 12)
> -		tgl_get_bw_info(display, &tgl_sa_info);
> +		tgl_get_bw_info(display, dram_info, &tgl_sa_info);
>  	else if (DISPLAY_VER(display) == 11)
> -		icl_get_bw_info(display, &icl_sa_info);
> +		icl_get_bw_info(display, dram_info, &icl_sa_info);
>  }
>  
>  static unsigned int intel_bw_crtc_num_active_planes(const struct intel_crtc_state *crtc_state)


  reply	other threads:[~2025-06-04 12:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-27  9:25 [RESEND 0/6] drm/i915/dram: dram_info refactoring Jani Nikula
2025-05-27  9:25 ` [RESEND 1/6] drm/i915/bw: pass struct dram_info pointer around Jani Nikula
2025-06-04 12:45   ` Govindapillai, Vinod [this message]
2025-06-04 16:14     ` Jani Nikula
2025-05-27  9:25 ` [RESEND 2/6] drm/i915/dram: add accessor for struct dram_info and use it Jani Nikula
2025-06-04 12:54   ` Govindapillai, Vinod
2025-05-27  9:25 ` [RESEND 3/6] drm/i915/wm: DG2 doesn't have dram info to look up wm_lv_0_adjust_needed Jani Nikula
2025-06-04 13:33   ` Govindapillai, Vinod
2025-06-04 13:41     ` Govindapillai, Vinod
2025-06-04 13:45     ` Jani Nikula
2025-05-27  9:25 ` [RESEND 4/6] drm/i915/dram: pass struct dram_info pointer around Jani Nikula
2025-06-04 13:37   ` Govindapillai, Vinod
2025-05-27  9:25 ` [RESEND 5/6] drm/i915/dram: add return value and handling to intel_dram_detect() Jani Nikula
2025-06-04 13:53   ` Govindapillai, Vinod
2025-05-27  9:25 ` [RESEND 6/6] drm/i915/dram: allocate struct dram_info dynamically Jani Nikula
2025-06-04 14:24   ` Govindapillai, Vinod
2025-05-27 16:08 ` ✓ CI.Patch_applied: success for drm/i915/dram: dram_info refactoring (rev2) Patchwork
2025-05-27 16:08 ` ✓ CI.checkpatch: " Patchwork
2025-05-27 16:09 ` ✓ CI.KUnit: " Patchwork
2025-05-27 16:23 ` ✓ CI.Build: " Patchwork
2025-05-27 16:24 ` ✓ CI.Hooks: " Patchwork
2025-05-27 16:26 ` ✓ CI.checksparse: " Patchwork
2025-05-27 16:57 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-27 19:06 ` ✓ Xe.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=38816ee29422d032499465ec7cb6d4ec2a8d40ca.camel@intel.com \
    --to=vinod.govindapillai@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@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