All of lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/ilk: Don't attempt to register eDP if LVDS was detected
Date: Mon, 20 Jun 2016 16:56:10 +0300	[thread overview]
Message-ID: <1466430970.4889.35.camel@intel.com> (raw)
In-Reply-To: <20160620103934.GP4329@intel.com>

On ma, 2016-06-20 at 13:39 +0300, Ville Syrjälä wrote:
> On Fri, Jun 17, 2016 at 06:48:45PM +0300, Imre Deak wrote:
> > Atm on ILK we attempt to detect if eDP is present even if LVDS was
> > already detected and an encoder for it was registered. This involves
> > trying to read out the eDP EDID, which in turn needs the same power
> > sequencer that LVDS uses. Poking at the VDD line at an unexpected time
> > may or may not interfere with the LVDS panel, but it's probably safer to
> > prevent this.  Registering both an LVDS and an eDP connector would also
> > present a similar problem accessing the shared PPS at any point later in
> > an unexpected way.
> > 
> > This was caught by CI with the PPS sanity checks in place and the
> > initial eDP EDID readout waiting for the panel power cycle timeout
> > without the PPS registers being initialized. To solve this latter
> > problem move PPS register init earlier before the first use of the
> > PPS.
> > 
> > CC: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Imre Deak <imre.deak@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 be08351..fe543d7 100644
> > --- a/drivers/gpu/drm/i915/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > @@ -5316,8 +5316,22 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
> >  	if (!is_edp(intel_dp))
> >  		return true;
> >  
> > +	/*
> > +	 * On ILK we may get here with LVDS already registered. Since the
> 
> ILK,SNB,IVB, if you want to accurately list the platforms.

Oops. I made the wrong assumption that IBX/CPT=ILK. Will fix this.

> 
> > +	 * driver uses the only internal power sequencer available for both
> > +	 * eDP and LVDS bail out early in this case to prevent interfering
> > +	 * with an already powered-on LVDS power sequencer.
> > +	 */
> > +	for_each_intel_encoder(dev, intel_encoder) {
> > +		if (intel_encoder->type == INTEL_OUTPUT_LVDS) {
> > +			DRM_INFO("LVDS was detected, not registering eDP\n");
> > +			return false;
> > +		}
> > +	}
> 
> We could abort much earlier, in the encoder init.

Yes, with an is_edp() check. Although preserving eDP detect for a non-
active LVDS output as discussed with Chris, intel_edp_init_connector()
would have to know about such an LVDS output to save/restore the PPS
state. Do you still want me then to move this earlier passing a flag to
intel_edp_init_connector()?

> > +
> >  	pps_lock(intel_dp);
> >  	intel_edp_panel_vdd_sanitize(intel_dp);
> > +	intel_dp_init_panel_power_sequencer_registers(dev, intel_dp);
> >  	pps_unlock(intel_dp);
> 
> For VLV/CHV we do this stuff in the encoder init already. Maybe we
> should move all that stuff here as well?

Ok, I did this:
https://github.com/ideak/linux/commit/72a224980515a87d6102c0f5c63306d35b337efe

AUX should be also inited after PPS setup, so I also moved that after PPS setup.
Ideally we had separate AUX init/register phases, then we could init AUX upfront
for both DP and eDP and register it after eDP init. B/c of the AUX/I2C
register/init is also conflated atm, this needs more work, I think Chris has
already something to separate those.

> > 
> >  	/* Cache DPCD and EDID for edp. */
> > @@ -5334,11 +5348,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
> >  		return false;
> >  	}
> >  
> > -	/* We now know it's not a ghost, init power sequence regs. */
> > -	pps_lock(intel_dp);
> > -	intel_dp_init_panel_power_sequencer_registers(dev, intel_dp);
> > -	pps_unlock(intel_dp);
> > -
> >  	mutex_lock(&dev->mode_config.mutex);
> >  	edid = drm_get_edid(connector, &intel_dp->aux.ddc);
> >  	if (edid) {
> > -- 
> > 2.5.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2016-06-20 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 15:48 [PATCH] drm/i915/ilk: Don't attempt to register eDP if LVDS was detected Imre Deak
2016-06-17 16:09 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-06-17 20:39 ` [PATCH] " Chris Wilson
2016-06-17 21:29 ` [PATCH v2 1/2] " Imre Deak
2016-06-17 22:35   ` Chris Wilson
2016-06-19 10:18     ` Imre Deak
2016-06-20  7:54       ` Chris Wilson
2016-06-20 13:40         ` Imre Deak
2016-06-20  8:43   ` Chris Wilson
2016-06-17 21:29 ` [PATCH v2 2/2] drm/i915: Initialize the PPS HW before its first use Imre Deak
2016-06-20 10:39 ` [PATCH] drm/i915/ilk: Don't attempt to register eDP if LVDS was detected Ville Syrjälä
2016-06-20 13:56   ` Imre Deak [this message]

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=1466430970.4889.35.camel@intel.com \
    --to=imre.deak@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.