All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Souza, Jose" <jose.souza@intel.com>
Cc: "Chiou, Cooper" <cooper.chiou@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"kai.heng.feng@canonical.com" <kai.heng.feng@canonical.com>
Subject: Re: [Intel-gfx] [PATCH v3 6/6] drm/i915/dp: Get TC link reference during DP detection
Date: Tue, 31 Mar 2020 19:01:04 +0300	[thread overview]
Message-ID: <20200331160104.GC721@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <c2156b0cbebf8dbcd904ae5d6539d765d078f982.camel@intel.com>

On Mon, Mar 30, 2020 at 11:27:06PM +0300, Souza, Jose wrote:
> On Sat, 2020-03-28 at 12:26 +0200, Imre Deak wrote:
> > On Tue, Mar 24, 2020 at 01:14:29PM -0700, José Roberto de Souza
> > wrote:
> > > As now the cost to lock and use a TC port is higher due the
> > > implementation of the TCCOLD sequences it is worty to hold a
> > > reference of the TC port to avoid all this locking at every
> > > aux transaction part of the DisplayPort detection.
> > 
> > The problem with locking the port for detection is that it would
> > block modesets on the port, which we should avoid. By blocking
> > tc-cold
> 
> It will not block modesets on the port, intel_tc_port_get_link and
> intel_tc_port_put_link gets locks tc_lock, increment or decrement
> tc_link_refcount and then unlock,

The effect of holding a link_refcount is that it's not possible to
update the TC port mode and select the correct TBT/MG PLL for the mode.
This will only be possible in the middle of the modeset sequence where
an active mode is first disabled on the port and that's the place we
don't want to wait for the detect sequence to finish.

So only an active mode should hold a link_refcount, so that it's
guaranteed that a modeset can update the TC port mode to its current
state.

> it would only avoid the TC cold sequences over and over.

Yes, but that would be also avoided by disabling the AUX power well only
with a delay.

>
> > whenever enabling an AUX power well you would avoid the overhead of
> > the
> > PCODE requests for each AUX transfer, since the AUX power refs are
> > dropped asynchronously with a delay.
> 
> Left comments on your proposal in patch 1.
> 
> > 
> > > Cc: Imre Deak <imre.deak@intel.com>
> > > Cc: Cooper Chiou <cooper.chiou@intel.com>
> > > Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_dp.c | 19 ++++++++++++++-----
> > >  1 file changed, 14 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > > b/drivers/gpu/drm/i915/display/intel_dp.c
> > > index 7f1a4e55cda1..6fbf3beee544 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > > @@ -6041,6 +6041,7 @@ intel_dp_detect(struct drm_connector
> > > *connector,
> > >  	struct intel_dp *intel_dp =
> > > intel_attached_dp(to_intel_connector(connector));
> > >  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> > >  	struct intel_encoder *encoder = &dig_port->base;
> > > +	enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
> > >  	enum drm_connector_status status;
> > >  
> > >  	drm_dbg_kms(&dev_priv->drm, "[CONNECTOR:%d:%s]\n",
> > > @@ -6049,12 +6050,17 @@ intel_dp_detect(struct drm_connector
> > > *connector,
> > >  		    !drm_modeset_is_locked(&dev_priv-
> > > >drm.mode_config.connection_mutex));
> > >  
> > >  	/* Can't disconnect eDP */
> > > -	if (intel_dp_is_edp(intel_dp))
> > > +	if (intel_dp_is_edp(intel_dp)) {
> > >  		status = edp_detect(intel_dp);
> > > -	else if (intel_digital_port_connected(encoder))
> > > -		status = intel_dp_detect_dpcd(intel_dp);
> > > -	else
> > > -		status = connector_status_disconnected;
> > > +	} else {
> > > +		if (intel_phy_is_tc(dev_priv, phy))
> > > +			intel_tc_port_get_link(dig_port, 1);
> > > +
> > > +		if (intel_digital_port_connected(encoder))
> > > +			status = intel_dp_detect_dpcd(intel_dp);
> > > +		else
> > > +			status = connector_status_disconnected;
> > > +	}
> > >  
> > >  	if (status == connector_status_disconnected) {
> > >  		memset(&intel_dp->compliance, 0, sizeof(intel_dp-
> > > >compliance));
> > > @@ -6132,6 +6138,9 @@ intel_dp_detect(struct drm_connector
> > > *connector,
> > >  	if (status != connector_status_connected && !intel_dp->is_mst)
> > >  		intel_dp_unset_edid(intel_dp);
> > >  
> > > +	if (intel_phy_is_tc(dev_priv, phy))
> > > +		intel_tc_port_put_link(dig_port);
> > > +
> > >  	/*
> > >  	 * Make sure the refs for power wells enabled during detect are
> > >  	 * dropped to avoid a new detect cycle triggered by HPD
> > > polling.
> > > -- 
> > > 2.26.0
> > > 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-31 16:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-24 20:14 [Intel-gfx] [PATCH v3 1/6] drm/i915/tc/tgl: Implement TCCOLD sequences José Roberto de Souza
2020-03-24 20:14 ` [Intel-gfx] [PATCH v3 2/6] drm/i915/display: Add intel_display_power_get_without_ack() José Roberto de Souza
2020-03-28 10:01   ` Imre Deak
2020-03-24 20:14 ` [Intel-gfx] [PATCH v3 3/6] drm/i915/display: Implement intel_display_power_wait_enable_ack() José Roberto de Souza
2020-03-24 20:14 ` [Intel-gfx] [PATCH v3 4/6] drm/i915/display: Add intel_aux_ch_to_power_domain() José Roberto de Souza
2020-03-24 20:14 ` [Intel-gfx] [PATCH v3 5/6] drm/i915/tc/icl: Implement the TC cold exit sequence José Roberto de Souza
2020-03-28 10:20   ` Imre Deak
2020-03-24 20:14 ` [Intel-gfx] [PATCH v3 6/6] drm/i915/dp: Get TC link reference during DP detection José Roberto de Souza
2020-03-28 10:26   ` Imre Deak
2020-03-30 20:27     ` Souza, Jose
2020-03-31 16:01       ` Imre Deak [this message]
2020-03-24 20:28 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v3,1/6] drm/i915/tc/tgl: Implement TCCOLD sequences Patchwork
2020-03-24 20:43   ` Souza, Jose
2020-03-24 20:51 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-24 22:04 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-03-25  5:59 ` [Intel-gfx] [PATCH v3 1/6] " You-Sheng Yang
2020-03-28  9:57 ` Imre Deak
2020-03-30 20:23   ` Souza, Jose
2020-03-31 15:47     ` Imre Deak

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=20200331160104.GC721@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=cooper.chiou@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    --cc=kai.heng.feng@canonical.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.