From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 05/10] drm/i915: Use drm_vblank_count() on gen2 for crc frame count
Date: Wed, 16 Dec 2015 14:51:20 +0200 [thread overview]
Message-ID: <20151216125120.GZ4437@intel.com> (raw)
In-Reply-To: <20151216103019.GX30437@phenom.ffwll.local>
On Wed, Dec 16, 2015 at 11:30:19AM +0100, Daniel Vetter wrote:
> On Mon, Dec 14, 2015 at 06:23:44PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Gen2 doesn't have a hardware frame counter, so let's use the sw
> > counter value instead.
> >
> > Testcase: igt/kms_pipe_crc_basic/read-crc-pipe-?-frame-sequence
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> I think the better test is skip the testcase if all frame numbers are 0.
> Not sure it's worth it to hack this up.
What's the problem with it? A few extra lines of code?
>
> But if you disagree I'd just throw out all the max_vblank_count checks and
> unconditionally enable the vblank counter and just always use
> drm_vblank_count. I don't think this can hurt use while we use the CRC,
> since it shouldn't generate more interrupts.
I'd rather not do that since the vblank interrupts might hide some bugs
(eg. missing crc done interrupts). Also I'm not convinced the software
counter isn't racy wrt. the crc done interrupt. Would need to check on
every platform to make sure the vblank interrupt is raised and processed
before the crc done interrupt, or we'd need to switch over to using
the vblank interrupt for crc gathering.
Note that I didn't actually check which order the interrupts fire on
gen2, but this was enough to make the current tests pass at least.
> -Daniel
>
> > ---
> > drivers/gpu/drm/i915/i915_debugfs.c | 11 +++++++++++
> > drivers/gpu/drm/i915/i915_irq.c | 5 ++++-
> > 2 files changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> > index 96d6e5de0811..695c69e85374 100644
> > --- a/drivers/gpu/drm/i915/i915_debugfs.c
> > +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> > @@ -4021,6 +4021,14 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
> > if (!entries)
> > return -ENOMEM;
> >
> > + if (dev->max_vblank_count == 0) {
> > + ret = drm_vblank_get(dev, pipe);
> > + if (ret) {
> > + kfree(entries);
> > + return ret;
> > + }
> > + }
> > +
> > /*
> > * When IPS gets enabled, the pipe CRC changes. Since IPS gets
> > * enabled and disabled dynamically based on package C states,
> > @@ -4073,6 +4081,9 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
> > hsw_trans_edp_pipe_A_crc_wa(dev, false);
> >
> > hsw_enable_ips(crtc);
> > +
> > + if (dev->max_vblank_count == 0)
> > + drm_vblank_put(dev, pipe);
> > }
> >
> > return 0;
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index 86664d1b3389..37ec8427359a 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -1533,7 +1533,10 @@ static void display_pipe_crc_irq_handler(struct drm_device *dev, enum pipe pipe,
> >
> > entry = &pipe_crc->entries[head];
> >
> > - entry->frame = dev->driver->get_vblank_counter(dev, pipe);
> > + if (dev->max_vblank_count == 0)
> > + entry->frame = drm_vblank_count(dev, pipe);
> > + else
> > + entry->frame = dev->driver->get_vblank_counter(dev, pipe);
> > entry->crc[0] = crc0;
> > entry->crc[1] = crc1;
> > entry->crc[2] = crc2;
> > --
> > 2.4.10
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-12-16 12:51 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-14 16:23 [PATCH 00/10] drm/i915: Fixes from my attempt at running igt on gen2 ville.syrjala
2015-12-14 16:23 ` [PATCH 01/10] drm/i915: Release mmaps on partial ggtt vma unbind ville.syrjala
2015-12-14 17:01 ` Chris Wilson
2015-12-14 17:26 ` Ville Syrjälä
2015-12-14 16:23 ` [PATCH 02/10] drm/i915: Cleanup phys status page too ville.syrjala
2015-12-14 17:04 ` Chris Wilson
2016-01-11 18:48 ` [PATCH v2 " ville.syrjala
2016-01-12 10:00 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 03/10] drm/i915: Write out crc frame counts in hex ville.syrjala
2015-12-16 10:23 ` Daniel Vetter
2015-12-16 10:58 ` Ville Syrjälä
2015-12-16 11:09 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 04/10] drm/i915: Wait for pipe to start before sampling vblank timestamps on gen2 ville.syrjala
2015-12-16 10:25 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 05/10] drm/i915: Use drm_vblank_count() on gen2 for crc frame count ville.syrjala
2015-12-16 10:30 ` Daniel Vetter
2015-12-16 12:51 ` Ville Syrjälä [this message]
2015-12-16 15:28 ` Daniel Vetter
2015-12-16 17:22 ` Ville Syrjälä
2015-12-21 11:54 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 06/10] drm/i915: Enable vblank_disable_immediate on gen2 ville.syrjala
2015-12-16 10:31 ` Daniel Vetter
2015-12-16 10:41 ` Chris Wilson
2015-12-14 16:23 ` [PATCH 07/10] drm/i915: Allow 27 bytes child_dev for VBT <109 ville.syrjala
2015-12-16 8:58 ` Jani Nikula
2015-12-14 16:23 ` [PATCH 08/10] drm/i915: Expect child dev size of 22 bytes for VBT < 106 ville.syrjala
2015-12-16 8:58 ` Jani Nikula
2015-12-14 16:23 ` [PATCH 09/10] drm/i915: Reject < 8 byte batches on 830/845 ville.syrjala
2015-12-14 17:07 ` Chris Wilson
2015-12-14 17:29 ` Ville Syrjälä
2015-12-16 10:36 ` Daniel Vetter
2015-12-16 10:43 ` Chris Wilson
2015-12-16 10:50 ` Daniel Vetter
2015-12-14 16:23 ` [PATCH 10/10] drm/i915: Use MI_BATCH_BUFFER_START " ville.syrjala
2015-12-14 16:58 ` Chris Wilson
2015-12-14 17:25 ` Ville Syrjälä
2015-12-15 10:09 ` Chris Wilson
2015-12-15 10:24 ` Chris Wilson
2015-12-15 11:05 ` Ville Syrjälä
2015-12-15 11:22 ` Chris Wilson
2015-12-15 11:43 ` Ville Syrjälä
2016-01-12 7:49 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-12 14:54 ` [PATCH 00/10] drm/i915: Fixes from my attempt at running igt on gen2 Ville Syrjälä
2016-01-12 16:02 ` 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=20151216125120.GZ4437@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel@ffwll.ch \
--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 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.