From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: akash goel <akash.goels@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/9] drm/i915: Add a small adjustment to the pixel counter on interlaced modes
Date: Fri, 16 May 2014 13:49:03 +0300 [thread overview]
Message-ID: <20140516104903.GN27580@intel.com> (raw)
In-Reply-To: <CAK_0AV2_8UfHqFnS9jhCv=zu0tKVBKWVngAnh-1xZZEtFav9iQ@mail.gmail.com>
On Thu, May 15, 2014 at 08:23:47PM +0530, akash goel wrote:
> Reviewed the patch & it looks good.
> Just to confirm, this patch tries to address the case of a tiny window of
> transition, i.e. from the 1st field (last half line) to 2nd field (first
> half line).
The hardware counts things so that one field ends up being one line
taller than the other, ie. both half lines get accounted for the same
field (as far as the pixel counter is concerned at least).
So the total number of pixels in the fields is like this:
field A = htotal * floor(vtotal/2)
field B = htotal * ceil(vtotal/2)
But when we compute the scanout position we assume that the total
number of pixels is always 'htotal * floor(vtotal/2)'. So if we start
with a number that is greater than that, the value wraps back to zero
already before we reach the real 0. And then when we do reach the
real zero, the scanout position would appear to jump backwards. So this
patch eliminates that problem by making it appear that the scanout
position stops moving when we're on that last line of the taller field.
Occasionally non-moving (but still non-decreasing) scanout position
seems like a lesser evil than one that jumps back and forth at times.
And as stated, this more or less matches the scanline counter based
scanout position since the scanline counter doesn't include the half
lines.
>
> Reviewed-by: "Akash Goel <akash.goels@gmail.com>"
>
>
> On Tue, Apr 29, 2014 at 4:05 PM, <ville.syrjala@linux.intel.com> wrote:
>
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > In interlaced modes, the pixel counter counts all pixels,
> > so one field will have htotal more pixels. In order to avoid
> > the reported position from jumping backwards when the pixel
> > counter is beyond the length of the shorter field, just
> > clamp the position the length of the shorter field. This
> > matches how the scanline counter based position works since
> > the scanline counter doesn't count the two half lines.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_irq.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c
> > b/drivers/gpu/drm/i915/i915_irq.c
> > index 7e0d577..64cd888 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -844,6 +844,18 @@ static int i915_get_crtc_scanoutpos(struct drm_device
> > *dev, int pipe,
> > vtotal *= htotal;
> >
> > /*
> > + * In interlaced modes, the pixel counter counts all
> > pixels,
> > + * so one field will have htotal more pixels. In order to
> > avoid
> > + * the reported position from jumping backwards when the
> > pixel
> > + * counter is beyond the length of the shorter field, just
> > + * clamp the position the length of the shorter field. This
> > + * matches how the scanline counter based position works
> > since
> > + * the scanline counter doesn't count the two half lines.
> > + */
> > + if (position >= vtotal)
> > + position = vtotal - 1;
> > +
> > + /*
> > * Start of vblank interrupt is triggered at start of
> > hsync,
> > * just prior to the first active line of vblank. However
> > we
> > * consider lines to start at the leading edge of
> > horizontal
> > --
> > 1.8.3.2
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2014-05-16 10:49 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-29 10:35 [PATCH v4 0/9] drm/i915: Atomic sprites v4 ville.syrjala
2014-04-29 10:35 ` [PATCH 1/9] drm/i915: Fix scanout position for real ville.syrjala
2014-04-29 10:35 ` [PATCH v4 2/9] drm/i915: Add intel_get_crtc_scanline() ville.syrjala
2014-04-29 10:35 ` [PATCH v8 3/9] drm/i915: Make sprite updates atomic ville.syrjala
[not found] ` <CAHofq8MHrbki1XtXeMZGSDSABnu4LUkZDfbYWCvU5Nng0AjM5g@mail.gmail.com>
[not found] ` <E1F41119A09A1C4EACAB7A4603D2A6C918F9F47E@BGSMSX104.gar.corp.intel.com>
2014-05-19 10:38 ` FW: " Arun Murthy
2014-05-19 10:49 ` Ville Syrjälä
2014-05-19 11:08 ` Arun Murthy
2014-05-19 10:49 ` Murthy, Arun R
2014-05-19 10:57 ` G, Pallavi
2014-05-22 13:03 ` Daniel Vetter
2014-05-22 13:24 ` Ville Syrjälä
2014-04-29 10:35 ` [PATCH v2 4/9] drm/i915: Perform primary enable/disable atomically with sprite updates ville.syrjala
2014-05-19 10:13 ` G, Pallavi
2014-04-29 10:35 ` [PATCH v4 5/9] drm/i915: Add pipe update trace points ville.syrjala
2014-04-29 11:17 ` Daniel Vetter
2014-04-29 11:46 ` Ville Syrjälä
2014-04-29 10:35 ` [PATCH 6/9] drm/i915: Add a small adjustment to the pixel counter on interlaced modes ville.syrjala
2014-05-15 14:53 ` akash goel
2014-05-16 2:42 ` sourab gupta
2014-05-16 10:49 ` Ville Syrjälä [this message]
2014-04-29 10:35 ` [PATCH 7/9] drm/i915: Improve gen3/4 frame counter ville.syrjala
2014-05-15 14:46 ` akash goel
2014-05-16 2:37 ` sourab gupta
2014-04-29 10:35 ` [PATCH v2 8/9] drm/i915: Draw a picture about video timings ville.syrjala
2014-05-15 15:10 ` akash goel
2014-05-15 17:20 ` [PATCH v3 " ville.syrjala
2014-05-16 2:54 ` sourab gupta
2014-04-29 10:35 ` [PATCH 9/9] drm/i915: Fix gen2 and hsw scanline counter ville.syrjala
2014-05-15 17:23 ` [PATCH v2 9/9] drm/i915: Fix gen2 and hsw+ " ville.syrjala
2014-05-16 5:33 ` akash goel
2014-05-16 6:24 ` sourab gupta
2014-05-21 9:01 ` Ville Syrjälä
2014-04-29 10:44 ` [PATCH v4 0/9] drm/i915: Atomic sprites v4 Ville Syrjälä
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=20140516104903.GN27580@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=akash.goels@gmail.com \
--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