summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2008-03-03 14:49:49 +0800
committerZou Nan hai <nanhai.zou@intel.com>2008-03-03 14:49:49 +0800
commit63fd6f284ddd1096d34b39941683ae244c1e01fc (patch)
tree00a69619af152259848763c66c9e0716ed74817e
parent09999c90ab1bf3f7d8b277895c962c8a7b3afc18 (diff)
[i915] 2D driver may reset Frame count value, this may lead driver
to leap it's vblank count a huge value. This will stall some applications that switch video mode if vblank_mode is set to a non zero value in drirc.
-rw-r--r--shared-core/i915_irq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index fd08b6e8..126f0379 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -406,6 +406,13 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int plane)
if (i915_in_vblank(dev, pipe))
count++;
#endif
+ /* count may be reset by other driver(e.g. 2D driver),
+ we have no way to know if it is wrapped or resetted
+ when count is zero. do a rough guess.
+ */
+ if (count == 0 && dev->last_vblank[pipe] < dev->max_vblank_count/2)
+ dev->last_vblank[pipe] = 0;
+
return count;
}