public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Force PSR exit when IRQ_HPD is detected on eDP.
Date: Wed, 2 Dec 2015 17:29:09 +0000	[thread overview]
Message-ID: <1449077364.1387.140.camel@intel.com> (raw)
In-Reply-To: <20151202094225.GV4437@intel.com>

On Wed, 2015-12-02 at 11:42 +0200, Ville Syrjälä wrote:
> On Tue, Dec 01, 2015 at 07:44:00PM +0000, Vivi, Rodrigo wrote:
> > On Tue, 2015-12-01 at 20:56 +0200, Ville Syrjälä wrote:
> > > On Wed, Nov 18, 2015 at 11:19:06AM -0800, Rodrigo Vivi wrote:
> > > > According to VESA spec: "If a Source device receives and 
> > > > IRQ_HPD
> > > > while in a PSR active state, and cannot identify what caused 
> > > > the
> > > > IRQ_HPD to be generated, based on Sink device status registers,
> > > > the Source device can take implementation-specific action.
> > > > One such action can be to exit and then re-enter a PSR active
> > > > state."
> > > > 
> > > > Since we aren't checking for any sink status registers and we
> > > >  aren't looking for any other implementation-specific action,
> > > > in case we receive any IRQ_HPD and psr is active let's force
> > > > the exit and reschedule it back.
> > > > 
> > > > v2: IRQ_HPD means short HPD so handle it correctly
> > > >     as Ville pointed out.
> > > > 
> > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > 
> > > Do we have a device that needs this for something? 
> > 
> > hopefully not. and I'm glad that I never had a case with PSR that I
> > needed it.... I was just trying to follow VESA spec a bit to avoid
> > issues.
> > 
> > I've seeing short pulses with some KBL, but also that came along 
> > with
> > bad flickerings so PSR shouldn't be the worst problem when this 
> > short
> > pulse on port A happens ;)
> > 
> > > Since it's totally
> > > implementation specific I would expect that something like VBT 
> > > would
> > > tell us if we need to do something on random short HPDs from the 
> > > panel.
> > 
> > hm, I was more afraid from the Sink implementation side... if they 
> > were
> > generating IRQ_HPD for some errors where they believe HW will send 
> > a
> > frame update.
> > 
> > > 
> > > As far as the implementation goes, can't we just call 
> > > intel_psr_flush()
> > > so that the frontbuffer tracking keeps in sync with the actual 
> > > PSR
> > > state?
> > 
> > that is a good idea... I believe when I first added this patch we
> > weren't relying fully on flush being inactivate+flush, but now with 
> > all
> > other patches merged I believe this would be better.
> > 
> > But what are your overall opinion now? should I come with a v3 
> > using
> > the flush function or should we just ignore this patch?
> 
> Dunno. I suppose it can't do too much harm. Well, unless there's a 
> sink
> that keeps signalling something unrelated to us that we don't 
> understand,
> and thus would kick it out of PSR all the time.

yeah, good point... So I will hold this one for now if we need I can
rework the v3 with flush and send again in the future.

Thanks,
Rodrigo.

> 
> > 
> > Thanks for your review and comments!
> > 
> > > 
> > > > ---
> > > >  drivers/gpu/drm/i915/intel_dp.c  |  3 +++
> > > >  drivers/gpu/drm/i915/intel_drv.h |  1 +
> > > >  drivers/gpu/drm/i915/intel_psr.c | 33 
> > > > +++++++++++++++++++++++++++++++++
> > > >  3 files changed, 37 insertions(+)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/intel_dp.c 
> > > > b/drivers/gpu/drm/i915/intel_dp.c
> > > > index bec443a..ca7a798 100644
> > > > --- a/drivers/gpu/drm/i915/intel_dp.c
> > > > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > > > @@ -5004,6 +5004,9 @@ intel_dp_hpd_pulse(struct 
> > > > intel_digital_port 
> > > > *intel_dig_port, bool long_hpd)
> > > >  			goto mst_fail;
> > > >  		}
> > > >  	} else {
> > > > +		if (intel_dig_port->base.type == 
> > > > INTEL_OUTPUT_EDP)
> > > > +			intel_psr_irq_hpd(dev);
> > > > +
> > > >  		if (intel_dp->is_mst) {
> > > >  			if 
> > > > (intel_dp_check_mst_status(intel_dp) == 
> > > > -EINVAL)
> > > >  				goto mst_fail;
> > > > diff --git a/drivers/gpu/drm/i915/intel_drv.h 
> > > > b/drivers/gpu/drm/i915/intel_drv.h
> > > > index ab5c147..1d61551 100644
> > > > --- a/drivers/gpu/drm/i915/intel_drv.h
> > > > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > > > @@ -1401,6 +1401,7 @@ void intel_psr_flush(struct drm_device 
> > > > *dev,
> > > >  void intel_psr_init(struct drm_device *dev);
> > > >  void intel_psr_single_frame_update(struct drm_device *dev,
> > > >  				   unsigned frontbuffer_bits);
> > > > +void intel_psr_irq_hpd(struct drm_device *dev);
> > > >  
> > > >  /* intel_runtime_pm.c */
> > > >  int intel_power_domains_init(struct drm_i915_private *);
> > > > diff --git a/drivers/gpu/drm/i915/intel_psr.c 
> > > > b/drivers/gpu/drm/i915/intel_psr.c
> > > > index bc5ea2a..465d36b 100644
> > > > --- a/drivers/gpu/drm/i915/intel_psr.c
> > > > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > > > @@ -765,6 +765,39 @@ void intel_psr_flush(struct drm_device 
> > > > *dev,
> > > >  }
> > > >  
> > > >  /**
> > > > + * intel_psr_irq_hpd - Let PSR aware of IRQ_HPD
> > > > + * @dev: DRM device
> > > > + *
> > > > + * This function is called when IRQ_HPD is received on eDP.
> > > > + */
> > > > +void intel_psr_irq_hpd(struct drm_device *dev)
> > > > +{
> > > > +	struct drm_i915_private *dev_priv = dev->dev_private;
> > > > +	int delay_ms = HAS_DDI(dev) ? 100 : 500;
> > > > +
> > > > +	mutex_lock(&dev_priv->psr.lock);
> > > > +
> > > > +	/*
> > > > +	 * According to VESA spec "If a Source device receives 
> > > > and 
> > > > IRQ_HPD
> > > > +	 * while in a PSR active state, and cannot identify 
> > > > what 
> > > > caused the
> > > > +	 * IRQ_HPD to be generated, based on Sink device 
> > > > status 
> > > > registers,
> > > > +	 * the Source device can take implementation-specific 
> > > > action.
> > > > +	 * One such action can be to exit and then re-enter a 
> > > > PSR 
> > > > active
> > > > +	 * state." Since we aren't checking for any sink 
> > > > status 
> > > > registers
> > > > +	 * and we aren't looking for any other implementation
> > > > -specific
> > > > +	 * action, in case we receive any IRQ_HPD and psr is 
> > > > active let's
> > > > +	 * force the exit and reschedule it back.
> > > > +	 */
> > > > +	if (dev_priv->psr.active) {
> > > > +		intel_psr_exit(dev);
> > > > +		schedule_delayed_work(&dev_priv->psr.work,
> > > > +				     
> > > >  msecs_to_jiffies(delay_ms));
> > > > +	}
> > > > +
> > > > +	mutex_unlock(&dev_priv->psr.lock);
> > > > +}
> > > > +
> > > > +/**
> > > >   * intel_psr_init - Init basic PSR work and mutex.
> > > >   * @dev: DRM device
> > > >   *
> > > > -- 
> > > > 2.4.3
> > > 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-02 17:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 21:19 [PATCH 0/4] PSR general improvements and stabilization Rodrigo Vivi
2015-11-11 21:19 ` [PATCH 1/4] drm/i915: Force PSR exit when IRQ_HPD is detected on eDP Rodrigo Vivi
2015-11-16 16:55   ` Ville Syrjälä
2015-11-18 19:19     ` [PATCH] " Rodrigo Vivi
2015-11-23 21:29       ` Rodrigo Vivi
2015-12-01 18:56       ` Ville Syrjälä
2015-12-01 19:44         ` Vivi, Rodrigo
2015-12-02  9:42           ` Ville Syrjälä
2015-12-02 17:29             ` Vivi, Rodrigo [this message]
2015-11-11 21:19 ` [PATCH 2/4] drm/i915: Remove duplicated dpcd write on hsw_psr_enable_sink Rodrigo Vivi
2015-11-12 22:46   ` [PATCH] " Rodrigo Vivi
2015-11-16 16:44     ` Paulo Zanoni
2015-11-11 21:20 ` [PATCH 3/4] drm/i915: PSR: Let's rely more on frontbuffer tracking Rodrigo Vivi
2015-11-14  0:56   ` [PATCH] " Rodrigo Vivi
2015-11-16 18:57     ` Paulo Zanoni
2015-11-16 20:39       ` Vivi, Rodrigo
2015-11-18 19:21       ` [PATCH 1/2] " Rodrigo Vivi
2015-11-18 19:27         ` Zanoni, Paulo R
2015-11-19 11:16           ` Jani Nikula
2015-11-19 11:24             ` Zanoni, Paulo R
2015-11-19 12:03               ` Damien Lespiau
2015-11-11 21:20 ` [PATCH 4/4] drm/i915: PSR: Mask LPSP hw tracking back again Rodrigo Vivi
2015-11-16 19:27   ` Paulo Zanoni
2015-11-18  0:01     ` Vivi, Rodrigo
2015-11-18 19:21     ` [PATCH 2/2] " Rodrigo Vivi
2015-11-18 19:29       ` Zanoni, Paulo R
2015-11-18 21:49     ` Rodrigo Vivi
2015-11-23 21:52       ` Rodrigo Vivi
2015-11-24 12:29         ` Daniel Vetter
2015-11-24 17:12 ` [PATCH 0/4] PSR general improvements and stabilization Daniel Stone
2015-11-24 20:53   ` Vivi, Rodrigo
2015-11-25  8:42     ` 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=1449077364.1387.140.camel@intel.com \
    --to=rodrigo.vivi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox