summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@nietzche.virtuousgeek.org>2008-01-23 08:39:57 -0800
committerJesse Barnes <jbarnes@nietzche.virtuousgeek.org>2008-01-23 08:39:57 -0800
commitb5a34f5da50e22ecb80853f0f422beb90857dc2d (patch)
tree2941cc5c521d7e948e99fa51f17843e45e104077
parentcb917843711ab5fe22f311cbd3eb597bce105df5 (diff)
Fix thinko in get_vblank_counter
Should use vtotal not htotal to figure out if we're in a vblank period.
-rw-r--r--shared-core/i915_irq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index 7ad21a97..56bcac9c 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -347,7 +347,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int plane)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
unsigned long high_frame;
unsigned long low_frame;
- unsigned long pipedsl, vblank, htotal;
+ unsigned long pipedsl, vblank, vtotal;
u32 high1, high2, low, count;
int pipe;
@@ -356,7 +356,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int plane)
low_frame = pipe ? PIPEBFRAMEPIXEL : PIPEAFRAMEPIXEL;
pipedsl = pipe ? PIPEBDSL : PIPEADSL;
vblank = pipe ? VBLANK_B : VBLANK_A;
- htotal = pipe ? HTOTAL_B : HTOTAL_A;
+ vtotal = pipe ? VTOTAL_B : VTOTAL_A;
if (!i915_pipe_enabled(dev, pipe)) {
printk(KERN_ERR "trying to get vblank count for disabled "
@@ -386,7 +386,7 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int plane)
* an incremented count to stay accurate
*/
if ((I915_READ(pipedsl) >= (I915_READ(vblank) & VBLANK_START_MASK)) ||
- (I915_READ(pipedsl) < (I915_READ(htotal) & HACTIVE_MASK)))
+ (I915_READ(pipedsl) < (I915_READ(vtotal) & VACTIVE_MASK)))
count++;
return count;