From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/19] drm/i915: Add support for detecting vblanks when hw frame counter is unavailable.
Date: Wed, 27 Apr 2016 17:23:06 +0300 [thread overview]
Message-ID: <20160427142306.GL4329@intel.com> (raw)
In-Reply-To: <20160427140616.GB20134@patrik-desktop.isw.intel.com>
On Wed, Apr 27, 2016 at 04:06:16PM +0200, Patrik Jakobsson wrote:
> On Tue, Apr 19, 2016 at 09:52:24AM +0200, Maarten Lankhorst wrote:
> > This uses the newly created drm_accurate_vblank_count_and_time to accurately
> > get a vblank count when the hw counter is unavailable.
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 10 ++++++++++
> > drivers/gpu/drm/i915/intel_drv.h | 3 +++
> > drivers/gpu/drm/i915/intel_sprite.c | 8 ++------
> > 3 files changed, 15 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index ccbc2a448258..2086e8bd10da 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -13530,6 +13530,16 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
> > return ret;
> > }
> >
> > +u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc)
> > +{
> > + struct drm_device *dev = crtc->base.dev;
> > +
> > + if (!dev->max_vblank_count)
> > + return drm_accurate_vblank_count(&crtc->base);
> > +
> > + return dev->driver->get_vblank_counter(dev, crtc->pipe);
> > +}
> > +
> > static void intel_atomic_wait_for_vblanks(struct drm_device *dev,
> > struct drm_i915_private *dev_priv,
> > unsigned crtc_mask)
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index fecc89600667..8efeb90eac07 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -1146,6 +1146,9 @@ intel_wait_for_vblank_if_active(struct drm_device *dev, int pipe)
> > if (crtc->active)
> > intel_wait_for_vblank(dev, pipe);
> > }
> > +
> > +u32 intel_crtc_get_vblank_counter(struct intel_crtc *crtc);
> > +
> > int ironlake_get_lanes_required(int target_clock, int link_bw, int bpp);
> > void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
> > struct intel_digital_port *dport,
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index 0f3e2303e0e9..e2de6b0df5a8 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -80,9 +80,7 @@ static int usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
> > */
> > void intel_pipe_update_start(struct intel_crtc *crtc)
> > {
> > - struct drm_device *dev = crtc->base.dev;
> > const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;
> > - enum pipe pipe = crtc->pipe;
> > long timeout = msecs_to_jiffies_timeout(1);
> > int scanline, min, max, vblank_start;
> > wait_queue_head_t *wq = drm_crtc_vblank_waitqueue(&crtc->base);
> > @@ -139,8 +137,7 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
> >
> > crtc->debug.scanline_start = scanline;
> > crtc->debug.start_vbl_time = ktime_get();
> > - crtc->debug.start_vbl_count =
> > - dev->driver->get_vblank_counter(dev, pipe);
> > + crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);
> >
> > trace_i915_pipe_update_vblank_evaded(crtc);
> > }
> > @@ -156,10 +153,9 @@ void intel_pipe_update_start(struct intel_crtc *crtc)
> > */
> > void intel_pipe_update_end(struct intel_crtc *crtc)
> > {
> > - struct drm_device *dev = crtc->base.dev;
> > enum pipe pipe = crtc->pipe;
> > int scanline_end = intel_get_crtc_scanline(crtc);
> > - u32 end_vbl_count = dev->driver->get_vblank_counter(dev, pipe);
> > + u32 end_vbl_count = intel_crtc_get_vblank_counter(crtc);
> > ktime_t end_vbl_time = ktime_get();
> >
> > trace_i915_pipe_update_end(crtc, end_vbl_count, scanline_end);
>
> Do we need to use intel_crtc_get_vblank_counter() in
> display_pipe_crc_irq_handler() as well?
There was a bit of talk whether we should use hw or sw counter for the
crc frame numbers, but I can't remember if we reached any real
conclusion. In the meantime the crc frame counters are all still zero
on gen2, meaning the tests don't work all that well. See [1].
And we still have the %8d bug highlited in that same patch series. Not
sure we reached any conclusion about that on either.
In any case using drm_accurate_vblank_count() from the irq handler
would be somewhat silly since the irq handler should have just updated
the sw counter to be uptodate, assuming we had vblank irqs enabled.
[1] https://lists.freedesktop.org/archives/intel-gfx/2015-December/083035.html
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-04-27 14:23 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 7:52 [PATCH 00/19] Rework page flip, remove cs flips, async unpin and unified pageflip Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 01/19] drm/core: Add drm_accurate_vblank_count, v4 Maarten Lankhorst
2016-04-25 4:35 ` Mario Kleiner
2016-04-25 6:32 ` [PATCH 01/19] drm/core: Add drm_accurate_vblank_count, v5 Maarten Lankhorst
2016-04-25 7:49 ` Mario Kleiner
2016-04-27 23:02 ` Mario Kleiner
2016-04-25 12:26 ` [PATCH 01/19] drm/core: Add drm_accurate_vblank_count, v4 Ville Syrjälä
2016-04-19 7:52 ` [PATCH 02/19] drm/i915: Remove stallcheck special handling, v2 Maarten Lankhorst
2016-04-27 13:24 ` Patrik Jakobsson
2016-04-28 8:48 ` Maarten Lankhorst
2016-04-28 9:54 ` Patrik Jakobsson
2016-04-28 10:20 ` Maarten Lankhorst
2016-05-03 13:48 ` Patrik Jakobsson
2016-05-03 14:15 ` Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 03/19] drm/i915: Remove intel_prepare_page_flip, v2 Maarten Lankhorst
2016-04-25 23:14 ` Patrik Jakobsson
2016-04-28 9:24 ` Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 04/19] drm/i915: Add support for detecting vblanks when hw frame counter is unavailable Maarten Lankhorst
2016-04-27 14:06 ` Patrik Jakobsson
2016-04-27 14:23 ` Ville Syrjälä [this message]
2016-05-10 12:30 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 05/19] drm/i915: Unify unpin_work and mmio_work into flip_work Maarten Lankhorst
2016-04-29 12:47 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 06/19] Revert "drm/i915: Avoid stalling on pending flips for legacy cursor updates" Maarten Lankhorst
2016-05-10 12:31 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 07/19] drm/i915: Allow mmio updates on all platforms, v2 Maarten Lankhorst
2016-04-19 12:48 ` Ville Syrjälä
2016-04-19 13:37 ` Maarten Lankhorst
2016-05-12 11:49 ` [RFC PATCH " Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 08/19] drm/i915: Convert flip_work to a list Maarten Lankhorst
2016-05-02 9:22 ` Patrik Jakobsson
2016-05-02 11:07 ` Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 09/19] drm/i915: Add the exclusive fence to plane_state Maarten Lankhorst
2016-05-03 12:47 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 10/19] drm/i915: Rework intel_crtc_page_flip to be almost atomic, v3 Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 11/19] drm/i915: Remove cs based page flip support Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 12/19] drm/i915: Remove use_mmio_flip kernel parameter Maarten Lankhorst
2016-05-11 8:48 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 13/19] drm/i915: Remove queue_flip pointer Maarten Lankhorst
2016-05-11 8:49 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 14/19] drm/i915: Pass atomic states to fbc update functions Maarten Lankhorst
2016-05-11 9:13 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 15/19] drm/i915: Prepare MST connector removal for async unpin Maarten Lankhorst
2016-05-11 9:26 ` Patrik Jakobsson
2016-04-19 7:52 ` [PATCH 16/19] drm/i915: Make unpin async Maarten Lankhorst
2016-04-25 16:26 ` Lionel Landwerlin
2016-04-25 16:26 ` Lionel Landwerlin
2016-04-26 7:14 ` Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 17/19] Reapply "drm/i915: Avoid stalling on pending flips for legacy cursor updates" Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 18/19] drm/i915: Check for unpin correctness Maarten Lankhorst
2016-04-19 7:52 ` [PATCH 19/19] drm/i915: Allow async update of pageflips Maarten Lankhorst
2016-04-19 8:19 ` Chris Wilson
2016-04-19 12:26 ` Maarten Lankhorst
2016-04-20 13:24 ` Daniel Vetter
2016-04-20 13:45 ` Chris Wilson
2016-04-20 7:39 ` Maarten Lankhorst
2016-04-19 8:27 ` ✗ Fi.CI.BAT: failure for Rework page flip, remove cs flips, async unpin and unified pageflip Patchwork
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=20160427142306.GL4329@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@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.