]> git.hungrycats.org Git - linux/commitdiff
drm/i915: apply G45 vblank count code to all G4x chips and fix max_frame_count
authorJesse Barnes <jbarnes@virtuousgeek.org>
Tue, 5 May 2009 20:13:16 +0000 (13:13 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 16 Aug 2009 21:18:20 +0000 (14:18 -0700)
(cherry picked from commit 42c2798b35b95c471877133e19ccc3cab00e9b65)

All G4x and newer chips use the new style frame count register, with a
full 32 bit frame count.  Update the code to reflect this.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_irq.c

index 0ccb63ee50ee5fea5b2232e6b3b481c108d56f03..bb58797992cd13c35cc2132b4e1db27f9704ae4e 100644 (file)
@@ -1153,8 +1153,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
 #endif
 
        dev->driver->get_vblank_counter = i915_get_vblank_counter;
-       if (IS_GM45(dev))
+       dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
+       if (IS_G4X(dev)) {
+               dev->max_vblank_count = 0xffffffff; /* full 32 bit counter */
                dev->driver->get_vblank_counter = gm45_get_vblank_counter;
+       }
 
        i915_gem_load(dev);
 
index 98bb4c878c4ef892a5aeb42b64a335e95eb45b24..8ee09695933918a88a50a6804978824292a53a30 100644 (file)
@@ -572,8 +572,6 @@ int i915_driver_irq_postinstall(struct drm_device *dev)
 
        dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
 
-       dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
-
        /* Unmask the interrupts that we always want on. */
        dev_priv->irq_mask_reg = ~I915_INTERRUPT_ENABLE_FIX;