[Intel-gfx] [PATCH 3/3] drm/i915: Boost GPU frequency if we detect outstanding pageflips
Chris Wilson
chris at chris-wilson.co.uk
Tue Jun 10 13:49:40 CEST 2014
On Tue, Jun 10, 2014 at 02:41:20PM +0300, Ville Syrjälä wrote:
> On Tue, Jun 10, 2014 at 11:04:02AM +0100, Chris Wilson wrote:
> > If we hit a vblank and see that have a pageflip queue but not yet
> > processed, ensure that the GPU is running at maximum in order to clear
> > the backlog. Pageflips are only queued for the following vblank, if we
> > miss it, there will be a visible stutter. Boosting the GPU frequency
> > doesn't prevent us from missing the target vblank, but it should help
> > the subsequent frames hitting theirs.
> >
> > v2: Reorder vblank vs flip-complete so that we only check for a missed
> > flip after processing the completion events, and avoid spurious boosts.
> >
> > v3: Rename missed_vblank
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> > Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_display.c | 6 ++++++
> > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > drivers/gpu/drm/i915/intel_pm.c | 15 +++++++++++++++
> > 4 files changed, 23 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 10dd80a..33ed0c6 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -910,6 +910,7 @@ struct intel_gen6_power_mgmt {
> >
> > bool enabled;
> > struct delayed_work delayed_resume_work;
> > + struct work_struct boost_work;
> >
> > /*
> > * Protects RPS/RC6 register access and PCU communication.
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index 9ecc6bf..aeb58fa 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -9339,6 +9339,7 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
> > struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe];
> > struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > unsigned long flags;
> > + bool missed_vblank;
> >
> > if (crtc == NULL)
> > return;
> > @@ -9349,7 +9350,12 @@ void intel_check_page_flip(struct drm_device *dev, int pipe)
> > intel_crtc->unpin_work->sbc, crtc_sbc(intel_crtc));
> > page_flip_completed(intel_crtc);
> > }
> > + missed_vblank = (intel_crtc->unpin_work != NULL &&
> > + crtc_sbc(intel_crtc) - intel_crtc->unpin_work->sbc > 1);
>
> So this will boost when we notice that we've crossed into the second
> vblank since the flip was queued. I was wondering if we should try to
> boost already after the first vblank. But doing that is a bit more
> problematic since we process the "flip done" interrupt after the
> vblank interrupt. So simply changing the check to >0 would end up
> boosting every time even if the flip already happened and we're just
> about to complete it when we get to processing the "flip done"
> interrupt.
Exactly. It is a little too eager if we start boosting after one missed
vblank as we process the vblank before the flip-complete.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list