From: Imre Deak <imre.deak@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/i915: Fix gen3/4 vblank counter wraparound
Date: Thu, 07 Nov 2013 18:16:47 +0200 [thread overview]
Message-ID: <1383841007.2445.0.camel@ideak-mobl> (raw)
In-Reply-To: <1383753389-12763-4-git-send-email-rodrigo.vivi@gmail.com>
On Wed, 2013-11-06 at 13:56 -0200, Rodrigo Vivi wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> When the hardware frame counter reads 0xffffff and we're already past
> vblank start, we'd return 0x1000000 as the vblank counter value. Once
> we'd cross into the next frame's active portion, the vblank counter
> would wrap to 0. So we're reporting two different vblank counter values
> for the same frame.
>
> Fix the problem by masking the cooked value by 0xffffff to make sure
> the counter wraps already after vblank start.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
> ---
> drivers/gpu/drm/i915/i915_irq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 2a44816..c474dac 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -583,7 +583,7 @@ static u32 i915_get_vblank_counter(struct drm_device *dev, int pipe)
> * Cook up a vblank counter by also checking the pixel
> * counter against vblank start.
> */
> - return ((high1 << 8) | low) + (pixel >= vbl_start);
> + return (((high1 << 8) | low) + (pixel >= vbl_start)) & 0xffffff;
> }
>
> static u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2013-11-07 16:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 15:56 [PATCH 0/5] drm-intel-collector - update Rodrigo Vivi
2013-11-06 15:56 ` [PATCH 1/5] drm/i915: Asynchronously perform the set-base for a simple modeset Rodrigo Vivi
2013-11-06 15:56 ` [PATCH 2/5] drm/i915: Initialise min/max frequencies before updating RPS registers Rodrigo Vivi
2013-11-07 17:43 ` Ville Syrjälä
2013-11-07 18:13 ` Daniel Vetter
2013-11-06 15:56 ` [PATCH 3/5] drm/i915: Fix gen3/4 vblank counter wraparound Rodrigo Vivi
2013-11-07 16:16 ` Imre Deak [this message]
2013-11-07 16:20 ` Daniel Vetter
2013-11-06 15:56 ` [PATCH 4/5] drm/i915: Use frame counter for intel_wait_for_vblank() on CTG Rodrigo Vivi
2013-11-07 16:39 ` Imre Deak
2013-11-06 15:56 ` [PATCH 5/5] drm/i915: Require HW contexts (when possible) Rodrigo Vivi
2013-11-07 8:35 ` 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=1383841007.2445.0.camel@ideak-mobl \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=rodrigo.vivi@gmail.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