Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 5/5] drm/vblank: Lock down vblank->hwmode more
Date: Mon, 8 May 2017 14:33:58 +0300	[thread overview]
Message-ID: <20170508113358.GP12629@intel.com> (raw)
In-Reply-To: <20170504131930.f47qqrwfbadsciq7@phenom.ffwll.local>

On Thu, May 04, 2017 at 03:20:22PM +0200, Daniel Vetter wrote:
> On Wed, May 03, 2017 at 05:09:08PM +0300, Ville Syrjälä wrote:
> > On Wed, May 03, 2017 at 09:26:38AM +0200, Daniel Vetter wrote:
> > > In the previous patch we've implemented hwmode tracking a la i915 for
> > > the vblank timestamp calculations. But that was just the basic
> > > semantics, i915 has some nice sanity checks to make sure we keep
> > > getting this right. Move them over too.
> > > 
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
> > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_irq.c            |  8 +++++++-
> > >  drivers/gpu/drm/i915/i915_irq.c      | 10 ++++++----
> > >  drivers/gpu/drm/i915/intel_display.c | 11 ++---------
> > >  3 files changed, 15 insertions(+), 14 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> > > index 89f0928b042a..942183a2aa3c 100644
> > > --- a/drivers/gpu/drm/drm_irq.c
> > > +++ b/drivers/gpu/drm/drm_irq.c
> > > @@ -775,8 +775,10 @@ bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
> > >  	/* If mode timing undefined, just return as no-op:
> > >  	 * Happens during initial modesetting of a crtc.
> > >  	 */
> > > -	if (mode->crtc_clock == 0) {
> > > +	if (WARN_ON(mode->crtc_clock == 0)) {
> > >  		DRM_DEBUG("crtc %u: Noop due to uninitialized mode.\n", pipe);
> > > +		WARN_ON(drm_drv_uses_atomic_modeset(dev));
> > 
> > I would make these _ONCE() otherwise the machine might end up
> > practically dead.
> 
> Will do.
> 
> > > +
> > >  		return false;
> > >  	}
> > >  
> > > @@ -1338,6 +1340,10 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
> > >  		send_vblank_event(dev, e, seq, &now);
> > >  	}
> > >  	spin_unlock_irqrestore(&dev->event_lock, irqflags);
> > > +
> > > +	/* Will be reset by the modeset helpers when re-enabling the crtc by
> > > +	 * calling drm_calc_timestamping_constants(). */
> > > +	vblank->hwmode.crtc_clock = 0;
> > >  }
> > >  EXPORT_SYMBOL(drm_crtc_vblank_off);
> > 
> > Shouldn't we do this in drm_crtc_vblank_reset() as well?
> > 
> > Hmm. Except we call that after drm_calc_timestamping_constants(). I
> > guess we should be able to move the reset() into
> > intel_modeset_readout_hw_state(). And possibly move the vblank_on()
> > call as well?
> 
> Yeah, it'd be nice to clean this stuff up some more, but there's also the
> problem that legacy and new drivers callc drm_calc_timestamping_constants
> at opposite ends of the modeset sequence. Doing more here is a bunch more
> work, maybe for the next patche series ...
> 
> I don't think we need to call it in _reset, at least at boot-up it should
> be 0 already. And for s/r we already shut down the pipe on suspend, so
> it's gone through this here.

Hmm. Indeed that seems like it should cover it.

> 
> With the _ONCE nit address (and the build breakage I've introduced in this
> version fixed), ack from you on the entire series?

Sure, for the series
Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-05-08 11:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03  7:26 [PATCH 0/5] vblanke cleanup resend Daniel Vetter
2017-05-03  7:26 ` [PATCH 1/5] drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool Daniel Vetter
2017-05-03  7:26 ` [PATCH 2/5] drm/vblank: Switch to bool in_vblank_irq in get_vblank_timestamp Daniel Vetter
2017-05-04 10:08   ` kbuild test robot
2017-05-03  7:26 ` [PATCH 3/5] drm/vblank: Add FIXME comments about moving the vblank ts hooks Daniel Vetter
2017-05-03  7:26 ` [PATCH 4/5] drm/vblank: drop the mode argument from drm_calc_vbltimestamp_from_scanoutpos Daniel Vetter
2017-05-03  7:26 ` [PATCH 5/5] drm/vblank: Lock down vblank->hwmode more Daniel Vetter
2017-05-03 14:09   ` Ville Syrjälä
2017-05-04 13:20     ` Daniel Vetter
2017-05-08 11:33       ` Ville Syrjälä [this message]
2017-05-03  7:46 ` ✓ Fi.CI.BAT: success for vblanke cleanup resend Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2017-05-09 14:03 [PATCH 1/5] drm/vblank: Switch drm_driver->get_vblank_timestamp to return a bool Daniel Vetter
2017-05-09 14:03 ` [PATCH 5/5] drm/vblank: Lock down vblank->hwmode more 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=20170508113358.GP12629@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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