All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Mun, Gwan-gyeong" <gwan-gyeong.mun@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [RFC v2 1/6] drm/i915/dp: Add a config function for YCBCR420 outputs
Date: Tue, 5 Mar 2019 15:54:42 +0000	[thread overview]
Message-ID: <e7775b51f795d447f5decb77939f6462459e1c96.camel@intel.com> (raw)
In-Reply-To: <20190221193707.GN20097@intel.com>

On Thu, 2019-02-21 at 21:37 +0200, Ville Syrjälä wrote:
> On Thu, Feb 21, 2019 at 09:27:26PM +0200, Gwan-gyeong Mun wrote:
> > This patch checks a support of YCBCR420 outputs on an encoder
> > level.
> > If the input mode is YCBCR420-only mode then it prepares DP as an
> > YCBCR420
> > output, else it continues with RGB output mode.
> > It set output_format to INTEL_OUTPUT_FORMAT_YCBCR420 in order to
> > using
> > a pipe scaler as RGB to YCbCr 4:4:4.
> > 
> > Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
> > Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dp.c | 33
> > +++++++++++++++++++++++++++++++++
> >  1 file changed, 33 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > b/drivers/gpu/drm/i915/intel_dp.c
> > index e1a051c0fbfe..d0bf2102dfc2 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -2104,6 +2104,31 @@ intel_dp_compute_link_config(struct
> > intel_encoder *encoder,
> >  	return 0;
> >  }
> >  
> > +static bool
> > +intel_dp_ycbcr420_config(struct drm_connector *connector,
> > +			 struct intel_crtc_state *config)
> 
> s/config/crtc_state/
> 
> Let's try to avoid spreading the naming mess any further.
> 
I'll fix the naming mess.
> > +{
> > +	struct intel_crtc *intel_crtc = to_intel_crtc(config-
> > >base.crtc);
> 
> s/intel_crtc/crtc/ for the same reason.
> 
I'll fix the naming.
> > +
> > +	if (!connector->ycbcr_420_allowed) {
> > +		DRM_ERROR("Platform doesn't support YCBCR420
> > output\n");
> > +		return false;
> > +	}
> > +
> > +	config->output_format = INTEL_OUTPUT_FORMAT_YCBCR420;
> > +
> > +	/* YCBCR 420 output conversion needs a scaler */
> > +	if (skl_update_scaler_crtc(config)) {
> > +		DRM_DEBUG_KMS("Scaler allocation for output failed\n");
> > +		return false;
> > +	}
> > +
> > +	intel_pch_panel_fitting(intel_crtc, config,
> > +				DRM_MODE_SCALE_FULLSCREEN);
> > +
> > +	return true;
> > +}
> > +
> >  int
> >  intel_dp_compute_config(struct intel_encoder *encoder,
> >  			struct intel_crtc_state *pipe_config,
> > @@ -2121,6 +2146,7 @@ intel_dp_compute_config(struct intel_encoder
> > *encoder,
> >  	bool constant_n = drm_dp_has_quirk(&intel_dp->desc,
> >  					   DP_DPCD_QUIRK_CONSTANT_N);
> >  	int ret;
> > +	struct drm_connector *connector = conn_state->connector;
> >  
> >  	if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv) && port !=
> > PORT_A)
> >  		pipe_config->has_pch_encoder = true;
> > @@ -2129,6 +2155,13 @@ intel_dp_compute_config(struct intel_encoder
> > *encoder,
> >  	if (lspcon->active)
> >  		lspcon_ycbcr420_config(&intel_connector->base,
> > pipe_config);
> >  
> > +	if (drm_mode_is_420_only(&connector->display_info,
> > adjusted_mode)) {
> > +		if (!intel_dp_ycbcr420_config(connector, pipe_config))
> > {
> > +			DRM_ERROR("Can't support YCBCR420 output\n");
> > +			return false;
> > +		}
> > +	}
> 
> This will clobber what lspcon_ycbcr420_config() did. So I suggest 
> 
> if (lspcon)
> 	lspcon_ycbcr420_config()
> else
> 	intel_dp_ycbcr420_config()
> 
> ie. also move the 420_only check into the function itself.
> 
I'll fix them as you guide.
> > +
> >  	pipe_config->has_drrs = false;
> >  	if (IS_G4X(dev_priv) || port == PORT_A)
> >  		pipe_config->has_audio = false;
> > -- 
> > 2.20.1
> > 
> > _______________________________________________
> > 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:[~2019-03-05 15:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 19:27 [RFC v2 0/6] drm/i915/dp: Preliminary support for DP YCbCr4:2:0 outputs Gwan-gyeong Mun
2019-02-21 19:27 ` [RFC v2 1/6] drm/i915/dp: Add a config function for YCBCR420 outputs Gwan-gyeong Mun
2019-02-21 19:37   ` Ville Syrjälä
2019-03-05 15:54     ` Mun, Gwan-gyeong [this message]
2019-02-21 19:27 ` [RFC v2 2/6] drm: Add a VSC structure for handling Pixel Encoding/Colorimetry Formats Gwan-gyeong Mun
2019-02-21 19:27 ` [RFC v2 3/6] drm/i915/dp: Program VSC Header and DB for Pixel Encoding/Colorimetry Format Gwan-gyeong Mun
2019-02-21 19:27 ` [RFC v2 4/6] drm/i915/dp: Add a support of YCBCR 4:2:0 to DP MSA Gwan-gyeong Mun
2019-02-21 19:27 ` [RFC v2 5/6] drm/i915/dp: Update pipe_bpp for DP YCbCr4:2:0 outputs Gwan-gyeong Mun
2019-02-21 19:54   ` Ville Syrjälä
2019-02-21 19:27 ` [RFC v2 6/6] drm/i915/dp: Support DP ports YUV 4:2:0 output to GEN11 Gwan-gyeong Mun
2019-02-21 20:13 ` ✗ Fi.CI.SPARSE: warning for drm/i915/dp: Preliminary support for DP YCbCr4:2:0 outputs (rev2) Patchwork
2019-02-21 20:30 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-22  8:14 ` ✓ Fi.CI.IGT: " 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=e7775b51f795d447f5decb77939f6462459e1c96.camel@intel.com \
    --to=gwan-gyeong.mun@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.