summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_irq.c
diff options
context:
space:
mode:
authorVille Syrjälä2013-11-06 16:56:27 +0100
committerDaniel Vetter2013-11-07 17:20:17 +0100
commitedc08d0a40f7ddab6bf7249e59ecf692d36c7192 (patch)
tree68d7e84d0b1f105c1b07356c42c889c9ae3cbd40 /drivers/gpu/drm/i915/i915_irq.c
parentdrm/i915/vlv: Workaround a punit issue in DDR data rate for 1333. (diff)
downloadkernel-qcow2-linux-edc08d0a40f7ddab6bf7249e59ecf692d36c7192.tar.gz
kernel-qcow2-linux-edc08d0a40f7ddab6bf7249e59ecf692d36c7192.tar.xz
kernel-qcow2-linux-edc08d0a40f7ddab6bf7249e59ecf692d36c7192.zip
drm/i915: Fix gen3/4 vblank counter wraparound
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> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index a228176676b2..c6176f337452 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)