public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
To: intel-gfx@lists.freedesktop.org,
	Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: Re: [PATCH] drm/i915/dp: Don't use DP link min bpp for the FRL link bandwidth check
Date: Wed, 08 Apr 2026 10:47:06 +0200	[thread overview]
Message-ID: <14398087.O9o76ZdvQC@workhorse> (raw)
In-Reply-To: <20260407183015.16256-1-ville.syrjala@linux.intel.com>

On Tuesday, 7 April 2026 20:30:15 Central European Summer Time Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> intel_dp_mode_min_link_bpp_x16() gives us the min bpp for the
> DP link before the PCON, however intel_dp_mode_valid_downstream()
> is trying to check for sufficient bandwidth on the HDMI FRL link
> after the PCON. So the use of intel_dp_mode_min_link_bpp_x16() here
> is incorrect.
> 
> Presumably even with FRL HDMI still can't go below 8bpc, so we should
> just use that to give us the minimum required FRL bandwidth. And this
> needs to account for the sink format (for 4:2:0 sub-sampling) since
> that is what will be flowing over the HDMI link.
> 
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Cc: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 20 ++++++++++++++------
>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 4955bd8b11d7..31e9b2758499 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1317,6 +1317,15 @@ intel_dp_tmds_clock_valid(struct intel_dp *intel_dp,
>  	return MODE_OK;
>  }
>  
> +static int frl_required_bw(int clock, int bpc,
> +			   enum intel_output_format sink_format)
> +{
> +	if (sink_format == INTEL_OUTPUT_FORMAT_YCBCR420)
> +		clock /= 2;
> +
> +	return clock * bpc * 3;
> +}
> +
>  static enum drm_mode_status
>  intel_dp_mode_valid_downstream(struct intel_connector *connector,
>  			       const struct drm_display_mode *mode,
> @@ -1327,13 +1336,14 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
>  	enum drm_mode_status status;
>  	enum intel_output_format sink_format;
>  
> +	sink_format = intel_dp_sink_format(connector, mode);
> +
>  	/* If PCON supports FRL MODE, check FRL bandwidth constraints */
>  	if (intel_dp->dfp.pcon_max_frl_bw) {
> -		int link_bpp_x16 = intel_dp_mode_min_link_bpp_x16(connector, mode);
> -		int target_bw;
> -		int max_frl_bw;
> +		int target_bw, max_frl_bw;
>  
> -		target_bw = fxp_q4_to_int_roundup(link_bpp_x16) * target_clock;
> +		/* Assume 8bpc for the FRL bandwidth check */
> +		target_bw = frl_required_bw(target_clock, 8, sink_format);
>  
>  		max_frl_bw = intel_dp->dfp.pcon_max_frl_bw;
>  
> @@ -1350,8 +1360,6 @@ intel_dp_mode_valid_downstream(struct intel_connector *connector,
>  	    target_clock > intel_dp->dfp.max_dotclock)
>  		return MODE_CLOCK_HIGH;
>  
> -	sink_format = intel_dp_sink_format(connector, mode);
> -
>  	/* Assume 8bpc for the DP++/HDMI/DVI TMDS clock check */
>  	status = intel_dp_tmds_clock_valid(intel_dp, target_clock,
>  					   8, sink_format, true);
> 

Reviewed-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>

At first I was worried we'd run into integer size issues, but as it
turns out the clock here is in kHz, so there's no physical way to
produce an overflow.

Thanks for the quick turnaround on the patch!

Kind regards,
Nicolas Frattaroli



      parent reply	other threads:[~2026-04-08  8:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 18:30 [PATCH] drm/i915/dp: Don't use DP link min bpp for the FRL link bandwidth check Ville Syrjala
2026-04-07 19:28 ` ✓ CI.KUnit: success for " Patchwork
2026-04-07 20:10 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-07 22:55 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-08  7:44 ` [PATCH] " Nautiyal, Ankit K
2026-04-08  8:47 ` Nicolas Frattaroli [this message]

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=14398087.O9o76ZdvQC@workhorse \
    --to=nicolas.frattaroli@collabora.com \
    --cc=ankit.k.nautiyal@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