RE: [PATCH v2 3/8] drm/i915/dp: Add a wrapper to check frl/tmds downstream constraints

"Kandpal, Suraj" <[email protected]>
Newsgroups org.freedesktop.lists.intel-gfx,org.freedesktop.lists.intel-xe
Message-ID <DS4PPFE901A304F940BFC2E6E8370C1C76FE3DD2@DS4PPFE901A304F.namprd11.prod.outlook.com>
> Subject: [PATCH v2 3/8] drm/i915/dp: Add a wrapper to check frl/tmds
> downstream constraints
> 

Nit: *FRL/TMDS

Otherwise LGTM,
Reviewed-by: Suraj Kandpal <[email protected]>

> Add a wrapper function to check dp_downstream clock/bandwidth constraints.
> Based on whether the sink supports FRL/TMDS the wrapper calls the
> appropriate FRL/TMDS functions.
> 
> v2: Don't modify the dfp.maxdotclock check which deals with VGA.
> 
> Signed-off-by: Ankit Nautiyal <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 34 +++++++++++++++++--------
>  1 file changed, 24 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index dd706f7de62d..6296c3d32970 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1206,6 +1206,28 @@ intel_dp_frl_bw_valid(struct intel_dp *intel_dp, int
> target_clock,
>  	return MODE_OK;
>  }
> 
> +static bool
> +intel_dp_pcon_sink_support_frl(struct intel_dp *intel_dp) {
> +	return intel_dp->dfp.pcon_max_frl_bw &&
> +		intel_dp_hdmi_sink_max_frl(intel_dp);
> +}
> +
> +static enum drm_mode_status
> +intel_dp_hdmi_bw_valid(struct intel_dp *intel_dp,
> +		       int target_clock, int bpc,
> +		       enum intel_output_format sink_format,
> +		       bool respect_downstream_limits) {
> +	if (intel_dp_pcon_sink_support_frl(intel_dp))
> +		return intel_dp_frl_bw_valid(intel_dp, target_clock, bpc,
> +					     sink_format,
> +					     respect_downstream_limits);
> +
> +	return intel_dp_tmds_clock_valid(intel_dp, target_clock, bpc,
> sink_format,
> +					 respect_downstream_limits);
> +}
> +
>  static enum drm_mode_status
>  intel_dp_mode_valid_downstream(struct intel_connector *connector,
>  			       const struct drm_display_mode *mode, @@ -
> 1213,21 +1235,13 @@ intel_dp_mode_valid_downstream(struct
> intel_connector *connector,
>  			       enum intel_output_format sink_format)  {
>  	struct intel_dp *intel_dp = intel_attached_dp(connector);
> -
> -	/*
> -	 * If PCON supports FRL MODE, check FRL bandwidth constraints.
> -	 * Assume 8bpc for the HDMI2.1 FRL BW check
> -	 */
> -	if (intel_dp->dfp.pcon_max_frl_bw &&
> intel_dp_hdmi_sink_max_frl(intel_dp))
> -		return intel_dp_frl_bw_valid(intel_dp, target_clock, 8,
> sink_format, true);
> +	int bpc = 8; /* Assume 8bpc for the DP++/HDMI/DVI TMDS/FRL bw
> check */
> 
>  	if (intel_dp->dfp.max_dotclock &&
>  	    target_clock > intel_dp->dfp.max_dotclock)
>  		return MODE_CLOCK_HIGH;
> 
> -	/* Assume 8bpc for the DP++/HDMI/DVI TMDS clock check */
> -	return intel_dp_tmds_clock_valid(intel_dp, target_clock,
> -					 8, sink_format, true);
> +	return intel_dp_hdmi_bw_valid(intel_dp, target_clock, bpc,
> +sink_format, true);
>  }
> 
>  static enum drm_mode_status
> --
> 2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.