Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Cc: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 4/4] drm/i915/bw: Extract get_display_bw_params()
Date: Tue, 12 May 2026 10:33:17 -0300	[thread overview]
Message-ID: <878q9o3g82.fsf@intel.com> (raw)
In-Reply-To: <0a68170c66f746503b0ed5f285b165ac5ddc9657@intel.com>

Jani Nikula <jani.nikula@intel.com> writes:

> On Mon, 11 May 2026, Matt Roper <matthew.d.roper@intel.com> wrote:
>> On Mon, May 11, 2026 at 01:30:59PM -0300, Gustavo Sousa 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 the *_get_bw_info() functions.
>>> 
>>> v2:
>>>   - Prefer to call get_display_bw_params() only once in
>>>     intel_bw_init_hw() instead of having multiple calls in each of the
>>>     affected *_get_bw_info() functions. (Jani)
>>> 
>>> Cc: Jani Nikula <jani.nikula@intel.com>
>>> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
>>> ---
>>>  drivers/gpu/drm/i915/display/intel_bw.c | 36 +++++++++++++++++++++------------
>>>  1 file changed, 23 insertions(+), 13 deletions(-)
>>> 
>>> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
>>> index c01356d38e64..acd1b6901b46 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_bw.c
>>> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
>>> @@ -493,6 +493,26 @@ static const struct intel_display_bw_params xelpdp_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_bw_params;
>>> +	} else if (DISPLAY_VER(display) >= 12) {
>>> +		/*
>>> +		 * RKL's SoC was based on ICL and the display, even though being
>>> +		 * gen12, had changes to the memory interface to match gen11's,
>>> +		 * consequently inheriting gen11's display-specific bandwidth
>>> +		 * parameters.
>>> +		 */
>>> +		if (display->platform.rocketlake)
>>> +			return &gen11_bw_params;
>>> +		else
>>> +			return &gen12_bw_params;
>>> +	} else {
>>> +		return &gen11_bw_params;
>>
>> It doesn't really matter, but this is technically going to assign gen11
>> parameters for all the pre-gen11 platforms that call through here on
>> i915.  If we never use the values it probably doesn't hurt anything, but
>> it might be best to make this a condition on gen11 rather than an 'else'
>> just to avoid any confusion.
>>
>>
>> Matt
>>
>>> +	}
>>> +}
>>> +
>>>  static int icl_get_bw_info(struct intel_display *display,
>>>  			   const struct dram_info *dram_info,
>>>  			   const struct intel_soc_bw_params *soc_bw_params,
>>> @@ -843,6 +863,7 @@ void intel_bw_init_hw(struct intel_display *display)
>>>  {
>>>  	const struct dram_info *dram_info = intel_dram_info(display);
>>>  	const struct intel_soc_bw_params *soc_bw_params = get_soc_bw_params(display);
>>> +	const struct intel_display_bw_params *display_bw_params = get_display_bw_params(display);
>
> Feels like it gets increasingly weird to call all these functions
> unconditionally when we bail out for !display right below.

Yeah.  Let's fix that. I'll have a separate patch for moving
intel_dram_info() down and then fix the two patches that add the other
calls.

--
Gustavo Sousa

>
> BR,
> Jani.
>
>>>  
>>>  	if (!HAS_DISPLAY(display))
>>>  		return;
>>> @@ -858,23 +879,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, soc_bw_params);
>>> -	} else if (DISPLAY_VER(display) >= 14) {
>>> -		tgl_get_bw_info(display, dram_info, soc_bw_params, &xelpdp_bw_params);
>>>  	} else if (display->platform.dg2) {
>>>  		dg2_get_bw_info(display);
>>>  	} else if (DISPLAY_VER(display) >= 12) {
>>> -		/*
>>> -		 * RKL's SoC was based on ICL and the display, even though being
>>> -		 * gen12, had changes to the memory interface to match gen11's,
>>> -		 * consequently inheriting gen11's display-specific bandwidth
>>> -		 * parameters.
>>> -		 */
>>> -		if (display->platform.rocketlake)
>>> -			tgl_get_bw_info(display, dram_info, soc_bw_params, &gen11_bw_params);
>>> -		else
>>> -			tgl_get_bw_info(display, dram_info, soc_bw_params, &gen12_bw_params);
>>> +		tgl_get_bw_info(display, dram_info, soc_bw_params, display_bw_params);
>>>  	} else if (DISPLAY_VER(display) == 11) {
>>> -		icl_get_bw_info(display, dram_info, soc_bw_params, &gen11_bw_params);
>>> +		icl_get_bw_info(display, dram_info, soc_bw_params, display_bw_params);
>>>  	}
>>>  }
>>>  
>>> 
>>> -- 
>>> 2.53.0
>>> 
>
> -- 
> Jani Nikula, Intel

  reply	other threads:[~2026-05-12 13:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11 16:30 [PATCH v2 0/4] drm/i915/bw: Split bandwidth params into platform- and display-IP-specific structs Gustavo Sousa
2026-05-11 16:30 ` [PATCH v2 1/4] drm/i915/bw: Extract platform-specific parameters Gustavo Sousa
2026-05-11 22:38   ` Matt Roper
2026-05-12  8:18     ` Jani Nikula
2026-05-12 13:14       ` Gustavo Sousa
2026-05-12 13:05     ` Gustavo Sousa
2026-05-11 16:30 ` [PATCH v2 2/4] drm/i915/bw: Deduplicate intel_sa_info instances Gustavo Sousa
2026-05-11 22:43   ` Matt Roper
2026-05-11 16:30 ` [PATCH v2 3/4] drm/i915/bw: Rename struct intel_sa_info to intel_display_bw_params Gustavo Sousa
2026-05-11 22:44   ` Matt Roper
2026-05-11 16:30 ` [PATCH v2 4/4] drm/i915/bw: Extract get_display_bw_params() Gustavo Sousa
2026-05-11 22:49   ` Matt Roper
2026-05-12  8:22     ` Jani Nikula
2026-05-12 13:33       ` Gustavo Sousa [this message]
2026-05-12 13:30     ` Gustavo Sousa
2026-05-11 20:35 ` ✗ i915.CI.BAT: failure for drm/i915/bw: Split bandwidth params into platform- and display-IP-specific structs (rev2) 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=878q9o3g82.fsf@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox