Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Kulkarni, Vandita" <vandita.kulkarni@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915: Use the correct bpp when validating "4:2:0 only" modes
Date: Fri, 18 Sep 2020 05:02:43 +0000	[thread overview]
Message-ID: <a9ddfa68ec7846889322b924f51d8c12@intel.com> (raw)
In-Reply-To: <20200917214335.3569-3-ville.syrjala@linux.intel.com>

> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Friday, September 18, 2020 3:14 AM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Use the correct bpp when
> validating "4:2:0 only" modes
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> When validating a "YCbCr 4:2:0 only" mode we must take into account the
> fact that we're going to be outputting YCbCr
> 4:2:0 or 4:4:4 (when a DP->HDMI protocol converter is doing the 4:2:0
> downsampling). For YCbCr 4:4:4 the minimum output bpc is 8, for YCbCr 4:2:0
> it'll be half that. The currently hardcoded 6bpc is only correct for RGB 4:4:4,
> which we will never use with these kinds of modes. Figure out what we're
> going to output and use the correct min bpp value to validate whether the
> link has sufficient bandwidth.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Looks good to me.
Reviewed-by: Vandita Kulkarni <vandita.kulkarni@intel.com>

Thanks,
Vandita
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 55 +++++++++++++++----------
>  1 file changed, 33 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index aa4801a8123d..54a4b81ea3ff 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -608,6 +608,37 @@ intel_dp_output_format(struct drm_connector
> *connector,
>  		return INTEL_OUTPUT_FORMAT_YCBCR420;
>  }
> 
> +int intel_dp_min_bpp(enum intel_output_format output_format) {
> +	if (output_format == INTEL_OUTPUT_FORMAT_RGB)
> +		return 6 * 3;
> +	else
> +		return 8 * 3;
> +}
> +
> +static int intel_dp_output_bpp(enum intel_output_format output_format,
> +int bpp) {
> +	/*
> +	 * bpp value was assumed to RGB format. And YCbCr 4:2:0 output
> +	 * format of the number of bytes per pixel will be half the number
> +	 * of bytes of RGB pixel.
> +	 */
> +	if (output_format == INTEL_OUTPUT_FORMAT_YCBCR420)
> +		bpp /= 2;
> +
> +	return bpp;
> +}
> +
> +static int
> +intel_dp_mode_min_output_bpp(struct drm_connector *connector,
> +			     const struct drm_display_mode *mode) {
> +	enum intel_output_format output_format =
> +		intel_dp_output_format(connector, mode);
> +
> +	return intel_dp_output_bpp(output_format,
> +intel_dp_min_bpp(output_format)); }
> +
>  static bool intel_dp_hdisplay_bad(struct drm_i915_private *dev_priv,
>  				  int hdisplay)
>  {
> @@ -687,7 +718,8 @@ intel_dp_mode_valid(struct drm_connector
> *connector,
>  	max_lanes = intel_dp_max_lane_count(intel_dp);
> 
>  	max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
> -	mode_rate = intel_dp_link_required(target_clock, 18);
> +	mode_rate = intel_dp_link_required(target_clock,
> +
> intel_dp_mode_min_output_bpp(connector, mode));
> 
>  	if (intel_dp_hdisplay_bad(dev_priv, mode->hdisplay))
>  		return MODE_H_ILLEGAL;
> @@ -2111,19 +2143,6 @@ intel_dp_adjust_compliance_config(struct
> intel_dp *intel_dp,
>  	}
>  }
> 
> -static int intel_dp_output_bpp(enum intel_output_format output_format,
> int bpp) -{
> -	/*
> -	 * bpp value was assumed to RGB format. And YCbCr 4:2:0 output
> -	 * format of the number of bytes per pixel will be half the number
> -	 * of bytes of RGB pixel.
> -	 */
> -	if (output_format == INTEL_OUTPUT_FORMAT_YCBCR420)
> -		bpp /= 2;
> -
> -	return bpp;
> -}
> -
>  /* Optimize link config in order: max bpp, min clock, min lanes */  static int
> intel_dp_compute_link_config_wide(struct intel_dp *intel_dp, @@ -2346,14
> +2365,6 @@ static int intel_dp_dsc_compute_config(struct intel_dp
> *intel_dp,
>  	return 0;
>  }
> 
> -int intel_dp_min_bpp(enum intel_output_format output_format) -{
> -	if (output_format == INTEL_OUTPUT_FORMAT_RGB)
> -		return 6 * 3;
> -	else
> -		return 8 * 3;
> -}
> -
>  static int
>  intel_dp_compute_link_config(struct intel_encoder *encoder,
>  			     struct intel_crtc_state *pipe_config,
> --
> 2.26.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2020-09-18  5:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 21:43 [Intel-gfx] [PATCH 1/3] drm/i915: Extract intel_dp_output_format() Ville Syrjala
2020-09-17 21:43 ` [Intel-gfx] [PATCH 2/3] drm/i915: Decouple intel_dp_{min, output}_bpp() from crtc_state Ville Syrjala
2020-09-17 23:59   ` Navare, Manasi
2020-09-18  5:01   ` Kulkarni, Vandita
2020-09-17 21:43 ` [Intel-gfx] [PATCH 3/3] drm/i915: Use the correct bpp when validating "4:2:0 only" modes Ville Syrjala
2020-09-18  0:01   ` Navare, Manasi
2020-09-18  5:02   ` Kulkarni, Vandita [this message]
2020-09-17 21:53 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/3] drm/i915: Extract intel_dp_output_format() Patchwork
2020-09-17 23:57 ` [Intel-gfx] [PATCH 1/3] " Navare, Manasi
2020-09-18 10:39   ` Ville Syrjälä
2020-09-18 18:49     ` Navare, Manasi
2020-09-18  5:00 ` Kulkarni, Vandita
2020-09-18 14:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915: Extract intel_dp_output_format() (rev2) Patchwork
2020-09-18 17:15 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=a9ddfa68ec7846889322b924f51d8c12@intel.com \
    --to=vandita.kulkarni@intel.com \
    --cc=intel-gfx@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