dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Kulkarni, Vandita" <vandita.kulkarni@intel.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"Sharma,  Swati2" <swati2.sharma@intel.com>
Subject: RE: [PATCH v2 07/13] drm/i915: Capture max frl rate for PCON in dfp cap structure
Date: Thu, 19 Nov 2020 10:07:18 +0000	[thread overview]
Message-ID: <8953a551c02d4353ae143f4c152245ec@intel.com> (raw)
In-Reply-To: <20201101100657.12087-8-ankit.k.nautiyal@intel.com>



> -----Original Message-----
> From: Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
> Sent: Sunday, November 1, 2020 3:37 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org; Shankar, Uma <uma.shankar@intel.com>;
> Kulkarni, Vandita <vandita.kulkarni@intel.com>; ville.syrjala@linux.intel.com;
> Sharma, Swati2 <swati2.sharma@intel.com>
> Subject: [PATCH v2 07/13] drm/i915: Capture max frl rate for PCON in dfp cap
> structure
> 
> HDMI2.1 PCON advertises Max FRL bandwidth supported by the PCON and by the
> sink.
> 
> This patch captures these in dfp cap structure in intel_dp and uses these to
> prune connector modes that cannot be supported by the PCON and sink FRL
> bandwidth.
> 
> v2: Addressed review comments from Uma Shankar:
> -tweaked the comparison of target bw and pcon frl bw to avoid roundup errors.
> -minor modification of field names and comments.

Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  .../drm/i915/display/intel_display_types.h    |  1 +
>  drivers/gpu/drm/i915/display/intel_dp.c       | 38 ++++++++++++++++++-
>  2 files changed, 37 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> b/drivers/gpu/drm/i915/display/intel_display_types.h
> index f6f0626649e0..282c6ee76384 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1397,6 +1397,7 @@ struct intel_dp {
>  	struct {
>  		int min_tmds_clock, max_tmds_clock;
>  		int max_dotclock;
> +		int pcon_max_frl_bw, sink_max_frl_bw;
>  		u8 max_bpc;
>  		bool ycbcr_444_to_420;
>  	} dfp;
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 818daab252f3..caf7666f1892 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -684,6 +684,29 @@ intel_dp_mode_valid_downstream(struct
> intel_connector *connector,
>  	const struct drm_display_info *info = &connector->base.display_info;
>  	int tmds_clock;
> 
> +	/*
> +	 * If PCON and HDMI2.1 sink both support FRL MODE, check FRL
> +	 * bandwidth constraints.
> +	 */
> +	if (intel_dp->dfp.pcon_max_frl_bw) {
> +		int target_bw;
> +		int max_frl_bw;
> +		int bpp = intel_dp_mode_min_output_bpp(&connector->base,
> mode);
> +
> +		target_bw = bpp * target_clock;
> +
> +		max_frl_bw = min(intel_dp->dfp.pcon_max_frl_bw,
> +				 intel_dp->dfp.sink_max_frl_bw);
> +
> +		/* converting bw from Gbps to Kbps*/
> +		max_frl_bw = max_frl_bw * 1000000;
> +
> +		if (target_bw > max_frl_bw)
> +			return MODE_CLOCK_HIGH;
> +
> +		return MODE_OK;
> +	}
> +
>  	if (intel_dp->dfp.max_dotclock &&
>  	    target_clock > intel_dp->dfp.max_dotclock)
>  		return MODE_CLOCK_HIGH;
> @@ -6366,13 +6389,21 @@ intel_dp_update_dfp(struct intel_dp *intel_dp,
>  						 intel_dp->downstream_ports,
>  						 edid);
> 
> +	intel_dp->dfp.pcon_max_frl_bw =
> +		drm_dp_get_pcon_max_frl_bw(intel_dp->dpcd,
> +					   intel_dp->downstream_ports);
> +
> +	intel_dp->dfp.sink_max_frl_bw =
> +drm_dp_get_hdmi_sink_max_frl_bw(&intel_dp->aux);
> +
>  	drm_dbg_kms(&i915->drm,
> -		    "[CONNECTOR:%d:%s] DFP max bpc %d, max dotclock %d,
> TMDS clock %d-%d\n",
> +		    "[CONNECTOR:%d:%s] DFP max bpc %d, max dotclock %d,
> TMDS clock
> +%d-%d, PCON Max FRL BW %dGbps, Sink Max FRL BW %dGbps\n",
>  		    connector->base.base.id, connector->base.name,
>  		    intel_dp->dfp.max_bpc,
>  		    intel_dp->dfp.max_dotclock,
>  		    intel_dp->dfp.min_tmds_clock,
> -		    intel_dp->dfp.max_tmds_clock);
> +		    intel_dp->dfp.max_tmds_clock,
> +		    intel_dp->dfp.pcon_max_frl_bw,
> +		    intel_dp->dfp.sink_max_frl_bw);
>  }
> 
>  static void
> @@ -6464,6 +6495,9 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
>  	intel_dp->dfp.min_tmds_clock = 0;
>  	intel_dp->dfp.max_tmds_clock = 0;
> 
> +	intel_dp->dfp.pcon_max_frl_bw = 0;
> +	intel_dp->dfp.sink_max_frl_bw = 0;
> +
>  	intel_dp->dfp.ycbcr_444_to_420 = false;
>  	connector->base.ycbcr_420_allowed = false;  }
> --
> 2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-11-19 10:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 10:06 [PATCH v2 00/13] Add support for DP-HDMI2.1 PCON Ankit Nautiyal
2020-11-01 10:06 ` [PATCH v2 01/13] drm/edid: Add additional HFVSDB fields for HDMI2.1 Ankit Nautiyal
2020-11-19  6:12   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 02/13] drm/edid: Parse MAX_FRL field from HFVSDB block Ankit Nautiyal
2020-11-19  6:13   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 03/13] drm/edid: Parse DSC1.2 cap fields " Ankit Nautiyal
2020-11-19  6:27   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 04/13] drm/dp_helper: Add Helpers for FRL Link Training support for DP-HDMI2.1 PCON Ankit Nautiyal
2020-11-19  7:47   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 05/13] drm/dp_helper: Add support for link failure detection Ankit Nautiyal
2020-11-19  7:52   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 06/13] drm/dp_helper: Add support for Configuring DSC for HDMI2.1 Pcon Ankit Nautiyal
2020-11-19  8:00   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 07/13] drm/i915: Capture max frl rate for PCON in dfp cap structure Ankit Nautiyal
2020-11-19 10:07   ` Shankar, Uma [this message]
2020-11-01 10:06 ` [PATCH v2 08/13] drm/i915: Add support for starting FRL training for HDMI2.1 via PCON Ankit Nautiyal
2020-11-19 10:23   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 09/13] drm/i915: Check for FRL training before DP Link training Ankit Nautiyal
2020-11-19 11:19   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 10/13] drm/i915: Add support for enabling link status and recovery Ankit Nautiyal
2020-11-19 11:22   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 11/13] drm/i915: Read DSC capabilities of the HDMI2.1 PCON encoder Ankit Nautiyal
2020-11-19 11:29   ` Shankar, Uma
2020-11-01 10:06 ` [PATCH v2 12/13] drm/i915: Add helper functions for calculating DSC parameters for HDMI2.1 Ankit Nautiyal
2020-11-25 20:28   ` Shankar, Uma
2020-12-02 14:13     ` Nautiyal, Ankit K
2020-11-01 10:06 ` [PATCH v2 13/13] drm/i915: Configure PCON for DSC1.1 to DSC1.2 encoding Ankit Nautiyal
2020-11-25 20:45   ` Shankar, Uma
2020-12-02 14:19     ` Nautiyal, Ankit K

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=8953a551c02d4353ae143f4c152245ec@intel.com \
    --to=uma.shankar@intel.com \
    --cc=ankit.k.nautiyal@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=swati2.sharma@intel.com \
    --cc=vandita.kulkarni@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;
as well as URLs for NNTP newsgroup(s).