All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915: Do not get aux power for disconnected DP ports
Date: Wed, 26 Sep 2018 22:42:25 +0000	[thread overview]
Message-ID: <f98b320edff2e0dd9b503410d211a33c0c70a399.camel@intel.com> (raw)
In-Reply-To: <20180925121731.GD9144@intel.com>

On Tue, 2018-09-25 at 15:17 +0300, Ville Syrjälä wrote:
> On Mon, Sep 24, 2018 at 06:16:49PM -0700, José Roberto de Souza
> wrote:
> > For ICL type-c ports there is a aux power restriction, it can only
> > be
> > enabled while there is sink connected.
> 
> That can't be entirely true because it's super racy. I was talking
> with Imre about this mess at some point, and IIRC we came up with
> some half decent theories on how we might handle this mess in a
> sane manner. IIRC it was something along the lines of: the tbt vs.
> other mode knob defines which power well we can enable, and so
> while we're doing something with the port in one mode or the other
> we must not try to use the port in the other mode. Ie. we need to
> properly track which mode the port is in and if there's an event
> that requires switching modes we have to wait until the previous
> use of the other mode has stopped.

I can't think how would we use the same TBT3 port in TBT3 and USB-C
mode without going to the disconnection and connection flow.

This statment about aux power restriction is on BSec also in the past
we were having some timeouts warnings while waiting for USB-C/TBT aux
power wells to be turn or off, Imre fixed that by not adding
POWER_DOMAIN_INIT to those power well domains.

> 
> > 
> > BSpec: 21750
> > 
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dp.c | 19 ++++++++++++++-----
> >  1 file changed, 14 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > b/drivers/gpu/drm/i915/intel_dp.c
> > index 6b4c19123f2a..48fd38cd4ba4 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -5019,19 +5019,27 @@ intel_dp_long_pulse(struct intel_connector
> > *connector,
> >  	struct intel_dp *intel_dp = intel_attached_dp(&connector-
> > >base);
> >  	enum drm_connector_status status;
> >  	u8 sink_irq_vector = 0;
> > +	bool got_aux_power;
> >  
> >  	WARN_ON(!drm_modeset_is_locked(&dev_priv-
> > >drm.mode_config.connection_mutex));
> >  
> > +	/* Can't disconnect eDP */
> > +	if (!intel_dp_is_edp(intel_dp) &&
> > +	    !intel_digital_port_connected(&dp_to_dig_port(intel_dp)-
> > >base)) {
> > +		status = connector_status_disconnected;
> > +		got_aux_power = false;
> > +		goto port_disconnected;
> > +	}
> > +
> >  	intel_display_power_get(dev_priv, intel_dp->aux_power_domain);
> > +	got_aux_power = true;
> >  
> > -	/* Can't disconnect eDP */
> >  	if (intel_dp_is_edp(intel_dp))
> >  		status = edp_detect(intel_dp);
> > -	else if
> > (intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base))
> > -		status = intel_dp_detect_dpcd(intel_dp);
> >  	else
> > -		status = connector_status_disconnected;
> > +		status = intel_dp_detect_dpcd(intel_dp);
> >  
> > +port_disconnected:
> >  	if (status == connector_status_disconnected) {
> >  		memset(&intel_dp->compliance, 0, sizeof(intel_dp-
> > >compliance));
> >  
> > @@ -5122,7 +5130,8 @@ intel_dp_long_pulse(struct intel_connector
> > *connector,
> >  	if (status != connector_status_connected && !intel_dp->is_mst)
> >  		intel_dp_unset_edid(intel_dp);
> >  
> > -	intel_display_power_put(dev_priv, intel_dp->aux_power_domain);
> > +	if (got_aux_power)
> > +		intel_display_power_put(dev_priv, intel_dp-
> > >aux_power_domain);
> >  	return status;
> >  }
> >  
> > -- 
> > 2.19.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-09-26 22:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  1:16 [PATCH 1/2] drm: Do not call drm_dp_cec_set_edid() while registering DP connectors José Roberto de Souza
2018-09-25  1:16 ` [PATCH 2/2] drm/i915: Do not get aux power for disconnected DP ports José Roberto de Souza
2018-09-25  8:16   ` Jani Nikula
2018-09-26 22:44     ` Souza, Jose
2018-09-25 12:17   ` Ville Syrjälä
2018-09-26 22:42     ` Souza, Jose [this message]
2018-10-02  9:52       ` Imre Deak
2018-10-17  1:38   ` [LKP] [drm/i915] e44058ef12: WARNING:at_drivers/gpu/drm/i915/intel_drv.h:#gen6_read32[i915] kernel test robot
2018-10-17  1:38     ` kernel test robot
2018-09-25  2:04 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm: Do not call drm_dp_cec_set_edid() while registering DP connectors Patchwork
2018-09-25  7:51 ` [PATCH 1/2] " Hans Verkuil

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=f98b320edff2e0dd9b503410d211a33c0c70a399.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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.