Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Shankar, Uma" <uma.shankar@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: Inline intel_dp_ycbcr420_config()
Date: Thu, 15 Oct 2020 23:35:18 +0000	[thread overview]
Message-ID: <ae0e2e6814d7432087ca1c82032d2cf8@intel.com> (raw)
In-Reply-To: <20200924184156.24491-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 25, 2020 12:12 AM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Inline intel_dp_ycbcr420_config()
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> intel_dp_ycbcr420_config() is rather pointless. Just inline it directly into
> intel_dp_compute_config(). This gets rid of the ugly double assignment of
> output_format.
> 
> Not really sure what the best policy would be when the user supplies a mode
> classiefied by the display as "YCbCr 4:2:0 only", but we know that we can't do

Nit: Typo in "classified"

Rest all looks good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> YCbCr 4:2:0 output. For now keep the current behaviour of just silently upgrade
> it to RGB 4:4:4.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 33 +++++++------------------
>  1 file changed, 9 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index f58df4994d92..a50e502dedf8 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -599,7 +599,8 @@ intel_dp_output_format(struct drm_connector
> *connector,
>  	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))
> +	if (!connector->ycbcr_420_allowed ||
> +	    !drm_mode_is_420_only(info, mode))
>  		return INTEL_OUTPUT_FORMAT_RGB;
> 
>  	if (intel_dp->dfp.ycbcr_444_to_420)
> @@ -2456,25 +2457,6 @@ intel_dp_compute_link_config(struct intel_encoder
> *encoder,
>  	return 0;
>  }
> 
> -static int
> -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_mode *adjusted_mode =
> -		&crtc_state->hw.adjusted_mode;
> -
> -	if (!connector->ycbcr_420_allowed)
> -		return 0;
> -
> -	crtc_state->output_format = intel_dp_output_format(connector,
> adjusted_mode);
> -
> -	if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420)
> -		return 0;
> -
> -	return intel_pch_panel_fitting(crtc_state, conn_state);
> -}
> -
>  bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state,
>  				  const struct drm_connector_state *conn_state)
> { @@ -2724,11 +2706,14 @@ intel_dp_compute_config(struct intel_encoder
> *encoder,
>  	if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv) && port != PORT_A)
>  		pipe_config->has_pch_encoder = true;
> 
> -	pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB;
> +	pipe_config->output_format =
> intel_dp_output_format(&intel_connector->base,
> +							    adjusted_mode);
> 
> -	ret = intel_dp_ycbcr420_config(pipe_config, conn_state);
> -	if (ret)
> -		return ret;
> +	if (pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
> +		ret = intel_pch_panel_fitting(pipe_config, conn_state);
> +		if (ret)
> +			return ret;
> +	}
> 
>  	if (!intel_dp_port_has_audio(dev_priv, port))
>  		pipe_config->has_audio = false;
> --
> 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

  reply	other threads:[~2020-10-15 23:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24 18:41 [Intel-gfx] [PATCH 1/3] drm/i915: Nuke lspcon_downsampling Ville Syrjala
2020-09-24 18:41 ` [Intel-gfx] [PATCH 2/3] drm/i915: Nuke lspcon_ycbcr420_config() Ville Syrjala
2020-10-15 23:28   ` Shankar, Uma
2020-09-24 18:41 ` [Intel-gfx] [PATCH 3/3] drm/i915: Inline intel_dp_ycbcr420_config() Ville Syrjala
2020-10-15 23:35   ` Shankar, Uma [this message]
2020-09-24 19:07 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/3] drm/i915: Nuke lspcon_downsampling Patchwork
2020-09-24 19:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-24 22:14 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-10-15 23:21 ` [Intel-gfx] [PATCH 1/3] " Shankar, Uma

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=ae0e2e6814d7432087ca1c82032d2cf8@intel.com \
    --to=uma.shankar@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