drm: Really never disable vblank irqs for offdelay==0
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 10 Sep 2014 15:36:08 +0000 (17:36 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 11 Sep 2014 11:31:57 +0000 (13:31 +0200)
With the new support for immediate vblank disabling we always disabled
the vblank interrupt right away, irrespective of the vblank offdelay
setting.

But being able to let vblanks run forever is fairly useful for
debugging, so restore that behaviour.

Suggested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/drm_irq.c

index 9be760145cb7dcf7585bd037edc7db9f3739203c..87d148cec877a3349866b88400a5f75c46b3fdfb 100644 (file)
@@ -1005,9 +1005,11 @@ void drm_vblank_put(struct drm_device *dev, int crtc)
 
        /* Last user schedules interrupt disable */
        if (atomic_dec_and_test(&vblank->refcount)) {
-               if (dev->vblank_disable_immediate || drm_vblank_offdelay < 0)
+               if (drm_vblank_offdelay == 0)
+                       return;
+               else if (dev->vblank_disable_immediate || drm_vblank_offdelay < 0)
                        vblank_disable_fn((unsigned long)vblank);
-               else if (drm_vblank_offdelay > 0)
+               else
                        mod_timer(&vblank->disable_timer,
                                  jiffies + ((drm_vblank_offdelay * HZ)/1000));
        }