Merge remote-tracking branch 'airlied/drm-next' into topic/vblank-rework
[cascardo/linux.git] / drivers / gpu / drm / i915 / i915_irq.c
index 8b158f0..7391697 100644 (file)
@@ -1020,7 +1020,7 @@ static int i915_get_crtc_scanoutpos(struct drm_device *dev, int pipe,
 
        /* In vblank? */
        if (in_vbl)
-               ret |= DRM_SCANOUTPOS_INVBL;
+               ret |= DRM_SCANOUTPOS_IN_VBLANK;
 
        return ret;
 }
@@ -4701,6 +4701,14 @@ void intel_irq_init(struct drm_device *dev)
                dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
        }
 
+       /*
+        * Opt out of the vblank disable timer on everything except gen2.
+        * Gen2 doesn't have a hardware frame counter and so depends on
+        * vblank interrupts to produce sane vblank seuquence numbers.
+        */
+       if (!IS_GEN2(dev))
+               dev->vblank_disable_immediate = true;
+
        if (drm_core_check_feature(dev, DRIVER_MODESET)) {
                dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
                dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;