From 948af0bd9b9eade489599d7ec160d42706331779 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 25 Feb 2009 14:19:01 -0600 Subject: i915: Backport jbarnes gm45 vblank counter patch. --- shared-core/i915_irq.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'shared-core/i915_irq.c') diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 77ff8d8b..50ff93a4 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -167,6 +167,19 @@ u32 i915_get_vblank_counter(struct drm_device *dev, int pipe) return count; } +u32 gm45_get_vblank_counter(struct drm_device *dev, int pipe) +{ + drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; + int reg = pipe ? PIPEB_FRMCOUNT_GM45 : PIPEA_FRMCOUNT_GM45; + + if (!i915_pipe_enabled(dev, pipe)) { + DRM_ERROR("trying to get vblank count for disabled pipe %d\n", pipe); + return 0; + } + + return I915_READ(reg); +} + irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) { struct drm_device *dev = (struct drm_device *) arg; -- cgit v1.2.3