All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Navare, Manasi" <manasi.d.navare@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/3] drm/i915: Extract intel_dp_output_format()
Date: Thu, 17 Sep 2020 16:57:09 -0700	[thread overview]
Message-ID: <20200917235709.GA27525@labuser-Z97X-UD5H> (raw)
In-Reply-To: <20200917214335.3569-1-ville.syrjala@linux.intel.com>

On Fri, Sep 18, 2020 at 12:43:33AM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Refactor the output_format calculation into a helper so that
> we can reuse it for mode validation as well.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 32 +++++++++++++++----------
>  1 file changed, 20 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index bf1e9cf1c0f3..ad9b8b16fadb 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -592,6 +592,22 @@ static u8 intel_dp_dsc_get_slice_count(struct intel_dp *intel_dp,
>  	return 0;
>  }
>  
> +static enum intel_output_format
> +intel_dp_output_format(struct drm_connector *connector,
> +		       const struct drm_display_mode *mode)
> +{
> +	struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector));
> +	const struct drm_display_info *info = &connector->display_info;
> +
> +	if (!drm_mode_is_420_only(info, mode))
> +		return INTEL_OUTPUT_FORMAT_RGB;
> +
> +	if (intel_dp->dfp.ycbcr_444_to_420)
> +		return INTEL_OUTPUT_FORMAT_YCBCR444;
> +	else
> +		return INTEL_OUTPUT_FORMAT_YCBCR420;
> +}
> +
>  static bool intel_dp_hdisplay_bad(struct drm_i915_private *dev_priv,
>  				  int hdisplay)
>  {
> @@ -2430,27 +2446,20 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
>  }
>  
>  static int
> -intel_dp_ycbcr420_config(struct intel_dp *intel_dp,
> -			 struct intel_crtc_state *crtc_state,
> +intel_dp_ycbcr420_config(struct intel_crtc_state *crtc_state,
>  			 const struct drm_connector_state *conn_state)
>  {
>  	struct drm_connector *connector = conn_state->connector;
> -	const struct drm_display_info *info = &connector->display_info;
>  	const struct drm_display_mode *adjusted_mode =
>  		&crtc_state->hw.adjusted_mode;
>  
>  	if (!connector->ycbcr_420_allowed)
>  		return 0;
>  
> -	if (!drm_mode_is_420_only(info, adjusted_mode))
> -		return 0;
> +	crtc_state->output_format = intel_dp_output_format(connector, adjusted_mode);

So by default if its not 420_only then we set it to RGB?

Manasi

>  
> -	if (intel_dp->dfp.ycbcr_444_to_420) {
> -		crtc_state->output_format = INTEL_OUTPUT_FORMAT_YCBCR444;
> +	if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420)
>  		return 0;
> -	}
> -
> -	crtc_state->output_format = INTEL_OUTPUT_FORMAT_YCBCR420;
>  
>  	return intel_pch_panel_fitting(crtc_state, conn_state);
>  }
> @@ -2710,8 +2719,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
>  	if (lspcon->active)
>  		lspcon_ycbcr420_config(&intel_connector->base, pipe_config);
>  	else
> -		ret = intel_dp_ycbcr420_config(intel_dp, pipe_config,
> -					       conn_state);
> +		ret = intel_dp_ycbcr420_config(pipe_config, conn_state);
>  	if (ret)
>  		return ret;
>  
> -- 
> 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-17 23:56 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
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 ` Navare, Manasi [this message]
2020-09-18 10:39   ` [Intel-gfx] [PATCH 1/3] " 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=20200917235709.GA27525@labuser-Z97X-UD5H \
    --to=manasi.d.navare@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.