From: Daniel Vetter <daniel@ffwll.ch>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 04/16] drm/i915: Sample the frame counter instead of a timestamp for CRCs
Date: Wed, 16 Oct 2013 15:51:40 +0200 [thread overview]
Message-ID: <20131016135140.GK4830@phenom.ffwll.local> (raw)
In-Reply-To: <20131016132932.GY13047@intel.com>
On Wed, Oct 16, 2013 at 04:29:32PM +0300, Ville Syrjälä wrote:
> On Tue, Oct 15, 2013 at 06:55:30PM +0100, Damien Lespiau wrote:
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_debugfs.c | 4 ++--
> > drivers/gpu/drm/i915/i915_drv.h | 2 +-
> > drivers/gpu/drm/i915/i915_irq.c | 8 ++------
> > 3 files changed, 5 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 991abff..58c6fd4 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -1748,14 +1748,14 @@ static int i915_pipe_crc(struct seq_file *m, void *data)
> > return 0;
> > }
> >
> > - seq_puts(m, " timestamp CRC1 CRC2 CRC3 CRC4 CRC5\n");
> > + seq_puts(m, " frame CRC1 CRC2 CRC3 CRC4 CRC5\n");
> > head = atomic_read(&pipe_crc->head);
> > tail = atomic_read(&pipe_crc->tail);
> >
> > while (CIRC_CNT(head, tail, INTEL_PIPE_CRC_ENTRIES_NR) >= 1) {
> > struct intel_pipe_crc_entry *entry = &pipe_crc->entries[tail];
> >
> > - seq_printf(m, "%12u %8x %8x %8x %8x %8x\n", entry->timestamp,
> > + seq_printf(m, "%8u %8x %8x %8x %8x %8x\n", entry->frame,
> > entry->crc[0], entry->crc[1], entry->crc[2],
> > entry->crc[3], entry->crc[4]);
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 7a1ed3a..cd87919 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1228,7 +1228,7 @@ enum intel_pipe_crc_source {
> > };
> >
> > struct intel_pipe_crc_entry {
> > - uint32_t timestamp;
> > + uint32_t frame;
> > uint32_t crc[5];
> > };
> >
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index 73d76af..0b21828 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -1195,8 +1195,7 @@ static void ivb_pipe_crc_update(struct drm_device *dev, enum pipe pipe)
> > struct drm_i915_private *dev_priv = dev->dev_private;
> > struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[pipe];
> > struct intel_pipe_crc_entry *entry;
> > - ktime_t now;
> > - int ts, head, tail;
> > + int head, tail;
> >
> > head = atomic_read(&pipe_crc->head);
> > tail = atomic_read(&pipe_crc->tail);
> > @@ -1208,10 +1207,7 @@ static void ivb_pipe_crc_update(struct drm_device *dev, enum pipe pipe)
> >
> > entry = &pipe_crc->entries[head];
> >
> > - now = ktime_get();
> > - ts = ktime_to_us(now);
> > -
> > - entry->timestamp = ts;
> > + entry->frame = I915_READ(PIPEFRAME(pipe));
>
> BTW that's the wrong register for ctg+. It should be PIPE_FRMCOUNT_GM45.
> But it would be better if you just call
> dev->driver->get_vblank_counter(). Then you get the correct answer for
> everything except gen2, and for gen2 we could implement a software
> frame counter if need be.
Hm, maybe we should even cobble it out of the drm vblank support code, to
make sure that the vblank frame numbers from the crc debugfs align with
timestamps for pageflips. But this is definitely a good idea. And afaik
gen2 doesn't have crc support (not even gen3 iirc). I'll do this in my
bikeshed series.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-10-16 13:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 17:55 Pipe CRCs v1 Damien Lespiau
2013-10-15 17:55 ` [PATCH 01/16] drm/i915: Expose latest 200 CRC value for pipe through debugfs Damien Lespiau
2013-10-16 10:29 ` Ville Syrjälä
2013-10-17 11:32 ` He, Shuang
2013-10-15 17:55 ` [PATCH 02/16] drm/i915: Add a control file for pipe CRCs Damien Lespiau
2013-10-15 17:55 ` [PATCH 03/16] drm/i915: Keep the CRC values into a circular buffer Damien Lespiau
2013-10-15 17:55 ` [PATCH 04/16] drm/i915: Sample the frame counter instead of a timestamp for CRCs Damien Lespiau
2013-10-16 13:29 ` Ville Syrjälä
2013-10-16 13:51 ` Daniel Vetter [this message]
2013-10-16 13:58 ` Ville Syrjälä
2013-10-16 14:04 ` Ville Syrjälä
2013-10-15 17:55 ` [PATCH 05/16] drm/i915: Make switching to the same CRC source a no-op Damien Lespiau
2013-10-15 17:55 ` [PATCH 06/16] drm/i915: Enforce going back to none before changing CRC source Damien Lespiau
2013-10-15 17:55 ` [PATCH 07/16] drm/i915: Empty the circular buffer when asked for a new source Damien Lespiau
2013-10-15 17:55 ` [PATCH 08/16] drm/i915: Dynamically allocate the CRC circular buffer Damien Lespiau
2013-10-15 17:55 ` [PATCH 09/16] drm/i915: Generalize the CRC command format for future work Damien Lespiau
2013-10-15 17:55 ` [PATCH 10/16] drm/i915: Rename i915_pipe_crc_ctl to i915_display_crc_ctl Damien Lespiau
2013-10-15 17:55 ` [PATCH 11/16] drm/i915: Warn if we receive an interrupt after freeing the buffer Damien Lespiau
2013-10-15 17:55 ` [PATCH 12/16] drm/i915: Add log messages when CRCs collection is started/stopped Damien Lespiau
2013-10-15 17:55 ` [PATCH 13/16] drm/i915: Move drm_add_fake_info_node() higher in the file Damien Lespiau
2013-10-15 17:55 ` [PATCH 14/16] drm/i915: Implement blocking read for pipe CRC files Damien Lespiau
2013-10-15 17:55 ` [PATCH 15/16] drm/i915: Only one open() allowed on pipe CRC result files Damien Lespiau
2013-10-15 17:55 ` [PATCH 16/16] drm/i915: Enable pipe CRCs Damien Lespiau
2013-10-16 10:02 ` Pipe CRCs v1 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=20131016135140.GK4830@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--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