public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/vlv: T12 eDP panel timing enforcement during reboot.
Date: Tue, 13 May 2014 15:43:52 -0700	[thread overview]
Message-ID: <20140513154352.3fa43553@jbarnes-desktop> (raw)
In-Reply-To: <20140513223230.GY3908@phenom.ffwll.local>

On Wed, 14 May 2014 00:32:30 +0200
Daniel Vetter <daniel@ffwll.ch> wrote:

> On Tue, May 13, 2014 at 02:53:22PM -0700, Jesse Barnes wrote:
> > On Tue, 13 May 2014 22:26:08 +0200
> > Daniel Vetter <daniel@ffwll.ch> wrote:
> > 
> > > On Tue, May 13, 2014 at 11:51:11AM -0700, clinton.a.taylor@intel.com wrote:
> > > > From: Clint Taylor <Clinton.A.Taylor@intel.com>
> > > > 
> > > > The panel power sequencer on vlv doesn't appear to accept changes to its T12 power down duration during warm reboots. This change forces a delay for warm reboots to the T12 panel timing as defined in the VBT table for the connected panel.
> > > > 
> > > > Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/intel_dp.c  |   43 ++++++++++++++++++++++++++++++++++++++
> > > >  drivers/gpu/drm/i915/intel_drv.h |    1 +
> > > >  2 files changed, 44 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> > > > index 5ca68aa9..03ac64f 100644
> > > > --- a/drivers/gpu/drm/i915/intel_dp.c
> > > > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > > > @@ -28,6 +28,8 @@
> > > >  #include <linux/i2c.h>
> > > >  #include <linux/slab.h>
> > > >  #include <linux/export.h>
> > > > +#include <linux/notifier.h>
> > > > +#include <linux/reboot.h>
> > > >  #include <drm/drmP.h>
> > > >  #include <drm/drm_crtc.h>
> > > >  #include <drm/drm_crtc_helper.h>
> > > > @@ -302,6 +304,39 @@ static u32 _pp_stat_reg(struct intel_dp *intel_dp)
> > > >  		return VLV_PIPE_PP_STATUS(vlv_power_sequencer_pipe(intel_dp));
> > > >  }
> > > >  
> > > > +/* Reboot notifier handler to shutdown panel power to gaurantee T12 timing */
> > > > +static int edp_notify_handler(struct notifier_block *this, unsigned long code,
> > > > +							  void *unused)
> > > > +{
> > > > +	struct intel_dp *intel_dp = container_of(this, typeof(* intel_dp),
> > > > +						 edp_notifier);
> > > > +	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> > > > +	struct drm_device *dev = intel_dig_port->base.base.dev;
> > > > +	struct drm_i915_private *dev_priv = dev->dev_private;
> > > > +	u32 pp;
> > > > +	u32 pp_ctrl_reg, pp_div_reg;
> > > > +	enum pipe pipe = vlv_power_sequencer_pipe(intel_dp);
> > > > +
> > > > +	if (!is_edp(intel_dp))
> > > > +		return 0;
> > > > +
> > > > +	if (IS_VALLEYVIEW(dev)) {
> > > > +		pp_ctrl_reg = VLV_PIPE_PP_CONTROL(pipe);
> > > > +		pp_div_reg  = VLV_PIPE_PP_DIVISOR(pipe);
> > > > +		if (code == SYS_RESTART) {
> > > > +			pr_crit("eDP Notifier Handler\n");
> > > > +			pp = I915_READ(VLV_PIPE_PP_DIVISOR(pipe));
> > > > +			pp &= PP_REFERENCE_DIVIDER_MASK;
> > > > +			I915_WRITE(pp_div_reg , pp | 0x1F);
> > > > +			I915_WRITE(pp_ctrl_reg,
> > > > +				   PANEL_UNLOCK_REGS | PANEL_POWER_OFF);
> > > > +			/* VBT entries are in tenths of uS convert to mS */
> > > > +			msleep(dev_priv->vbt.edp_pps.t11_t12 / 10);
> > > 
> > > Imo just compute the desired delay before setting up this reboot handler
> > > and pass it as the argument.
> > > 
> > > But that leaves a bit the question why we don't need that everywhere else
> > > and what exactly this does? I'm a bit confused with the commit message.
> > > -Daniel
> > 
> > We could potentially do it on other platforms, but it's really only
> > needed on those that don't do any display stuff in the BIOS (e.g.
> > Chromebooks).  In that case, a warm reboot might immediately jump back
> > to driver init, and if we haven't full done a PPS, we'll get into
> > trouble and potentially confuse the panel in the worst case.
> > 
> > Previous BIOS-free systems may have had this problem too, but this was
> > the first one we got an actual eDP timing spec violation about, so it's
> > a good first step.  It can easily be extended as needed.
> > 
> > Computing the delay ahead of time in eDP init would make it more
> > platform agnostic, and we could key off a separate flag as to whether
> > the delay was needed, but the above is pretty simple too, albeit VLV
> > specific.
> > 
> > The pr_crit() could probably be dropped though, and the magic 0x1f
> > needs a comment.
> 
> In that case I think rolling this out everywhere can't hurt. Gives us a
> notch more testing and rebooting tends to not be a performance critical
> thing really.
> 
> Otoh I've thought the hardware ensure that the t12 timing is obeyed under
> all cases? Does that get lost in the reset?

Yeah on reset the PPS will get reset too, so the off->on delay may not
be honored.

-- 
Jesse Barnes, Intel Open Source Technology Center

  reply	other threads:[~2014-05-13 22:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13 18:51 [PATCH] drm/i915/vlv: T12 eDP panel timing enforcement during reboot clinton.a.taylor
2014-05-13 20:26 ` Daniel Vetter
2014-05-13 21:53   ` Jesse Barnes
2014-05-13 22:32     ` Daniel Vetter
2014-05-13 22:43       ` Jesse Barnes [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-05-16 21:30 clinton.a.taylor
2014-05-27  7:58 ` Jani Nikula
2014-06-02 18:34 clinton.a.taylor
2014-06-03  8:11 ` Jani Nikula
2014-06-03 16:37 clinton.a.taylor
2014-06-04 12:22 ` Jani Nikula
2014-07-02  7:30 ` Jani Nikula
2014-07-02  8:35   ` Jani Nikula
2014-07-02 14:40     ` Paulo Zanoni
2014-07-03 22:07       ` Clint Taylor
2014-07-04 12:26         ` Paulo Zanoni
2014-07-07 17:19           ` Clint Taylor
2014-07-03 17:35     ` Clint Taylor
2014-07-03 20:44       ` Jani Nikula
2014-07-07  8:45         ` Daniel Vetter
2014-07-07 20:01 clinton.a.taylor
2014-07-08 14:06 ` Paulo Zanoni
2014-07-08 14:55   ` Daniel Vetter

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=20140513154352.3fa43553@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=daniel@ffwll.ch \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox