All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: Ander Conselvan de Oliveira
	<ander.conselvan.de.oliveira@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: Remove duplicate DDI enabling logic from MST path
Date: Tue, 28 Feb 2017 17:03:26 +0200	[thread overview]
Message-ID: <20170228150326.GN31595@intel.com> (raw)
In-Reply-To: <20170228144751.GL31595@intel.com>

On Tue, Feb 28, 2017 at 04:47:51PM +0200, Ville Syrjälä wrote:
> On Tue, Feb 28, 2017 at 04:33:46PM +0200, Imre Deak wrote:
> > On Tue, Feb 28, 2017 at 04:09:31PM +0200, Ville Syrjälä wrote:
> > > On Tue, Feb 28, 2017 at 03:59:52PM +0200, Imre Deak wrote:
> > > > On Tue, Feb 28, 2017 at 09:21:13AM +0200, Ander Conselvan de Oliveira wrote:
> > > > > The logic to enable a DDI in intel_mst_pre_enable_dp() is essentially
> > > > > the same as in intel_ddi_pre_enable_dp(). So reuse the latter function
> > > > > by calling the post_disable hook on the intel_dig_port instead of
> > > >                  ^pre_enable
> > > > > duplicating that code.
> > > > > 
> > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > > > > ---
> > > > >  drivers/gpu/drm/i915/intel_ddi.c    |  2 ++
> > > > >  drivers/gpu/drm/i915/intel_dp_mst.c | 23 +++--------------------
> > > > >  2 files changed, 5 insertions(+), 20 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > > > > index e9013f1..71aaddf 100644
> > > > > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > > > > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > > > > @@ -1695,6 +1695,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
> > > > >  	enum port port = intel_ddi_get_encoder_port(encoder);
> > > > >  	struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
> > > > >  
> > > > > +	WARN_ON(link_mst && port == PORT_A);
> > > > > +
> > > > 
> > > > So IIUC, this wasn't used before for MST and so link_mst was always
> > > > false.
> > > 
> > > The MST code explicitly passes 'true' here.
> > 
> > Yes, after the change.
> 
> It was 'true' before. After the change it'll be 'intel_crtc_has_type(MST)'

Ahem. So I thought we were talking about intel_dp_set_link_params(), but
really this was about intel_ddi_pre_enable_dp(). So yes, you're correct
that intel_ddi_pre_enable_dp() was not actually used for MST.

> 
> > I was just wondering why this wasn't used for MST
> > before.
> > 
> > > 
> > > > Also link_mst=true implies type == INTEL_OUTPUT_DP, as this will
> > > > be called for the primary encoder. After the change crtc->config will be
> > > > used instead of the (new) pipe_config, but this is fine since the two
> > > > are the same in the enable hooks.
> > > 
> > > Nope. AFAICS this should explode totally since encoder->crtc for the
> > > primary will be NULL. I guess Maarten didn't yet nuke all crtc->config
> > > usage from the ddi code (or he did but the patches didn't get reviewed).
> > 
> > Err, right. So this would need first changing to use crtc->config to
> > pipe_config in intel_ddi_pre_enable.
> 
> + review all the code that gets called from there to make sure no more
> users are lurking somewhere deeper.
> 
> > 
> > --Imre
> > 
> > > 
> > > > Looks ok to me:
> > > > 
> > > > Reviewed-by: Imre Deak <imre.deak@intel.com>
> > > > 
> > > > >  	intel_dp_set_link_params(intel_dp, link_rate, lane_count,
> > > > >  				 link_mst);
> > > > >  	if (encoder->type == INTEL_OUTPUT_EDP)
> > > > > diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> > > > > index a8334e1..094cbdc 100644
> > > > > --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> > > > > +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> > > > > @@ -159,26 +159,9 @@ static void intel_mst_pre_enable_dp(struct intel_encoder *encoder,
> > > > >  
> > > > >  	DRM_DEBUG_KMS("%d\n", intel_dp->active_mst_links);
> > > > >  
> > > > > -	if (intel_dp->active_mst_links == 0) {
> > > > > -		intel_ddi_clk_select(&intel_dig_port->base,
> > > > > -				     pipe_config->shared_dpll);
> > > > > -
> > > > > -		intel_display_power_get(dev_priv,
> > > > > -					intel_dig_port->ddi_io_power_domain);
> > > > > -
> > > > > -		intel_prepare_dp_ddi_buffers(&intel_dig_port->base);
> > > > > -		intel_dp_set_link_params(intel_dp,
> > > > > -					 pipe_config->port_clock,
> > > > > -					 pipe_config->lane_count,
> > > > > -					 true);
> > > > > -
> > > > > -		intel_ddi_init_dp_buf_reg(&intel_dig_port->base);
> > > > > -
> > > > > -		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> > > > > -
> > > > > -		intel_dp_start_link_train(intel_dp);
> > > > > -		intel_dp_stop_link_train(intel_dp);
> > > > > -	}
> > > > > +	if (intel_dp->active_mst_links == 0)
> > > > > +		intel_dig_port->base.pre_enable(&intel_dig_port->base,
> > > > > +						pipe_config, NULL);
> > > > >  
> > > > >  	ret = drm_dp_mst_allocate_vcpi(&intel_dp->mst_mgr,
> > > > >  				       connector->port,
> > > > > -- 
> > > > > 2.9.3
> > > > > 
> > > > > _______________________________________________
> > > > > 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
> > > 
> > > -- 
> > > Ville Syrjälä
> > > Intel OTC
> 
> -- 
> Ville Syrjälä
> Intel OTC
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-02-28 15:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28  7:14 [PATCH 0/2] Try to fix MST regression with DDI IO power domains Ander Conselvan de Oliveira
2017-02-28  7:21 ` [PATCH 1/2] drm/i915: Enable DDI IO power domains in the DP MST path Ander Conselvan de Oliveira
2017-02-28 13:32   ` Imre Deak
2017-02-28  7:21 ` [PATCH 2/2] drm/i915: Remove duplicate DDI enabling logic from " Ander Conselvan de Oliveira
2017-02-28 13:59   ` Imre Deak
2017-02-28 14:09     ` Ville Syrjälä
2017-02-28 14:33       ` Imre Deak
2017-02-28 14:47         ` Ville Syrjälä
2017-02-28 15:03           ` Ville Syrjälä [this message]
2017-02-28  7:53 ` ✗ Fi.CI.BAT: failure for Try to fix MST regression with DDI IO power domains Patchwork
2017-02-28 14:01   ` Ander Conselvan De Oliveira

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=20170228150326.GN31595@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ander.conselvan.de.oliveira@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.