summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_irq.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-08-06 14:49:53 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-06 22:39:28 +0200
commit4ed0ce3d0bccd74416ba6beb33a8a79d1617e97b (patch)
treed8898f1d518a7141d425cccae24a23b719a2df43 /drivers/gpu/drm/drm_irq.c
parentffe7c73a8d4f0caeebd5d220ddbf7126a4daca1f (diff)
downloadtalos-op-linux-4ed0ce3d0bccd74416ba6beb33a8a79d1617e97b.tar.gz
talos-op-linux-4ed0ce3d0bccd74416ba6beb33a8a79d1617e97b.zip
drm: Disable vblank interrupt immediately when drm_vblank_offdelay<0
Make drm_vblank_put() disable the vblank interrupt immediately when the refcount drops to zero and drm_vblank_offdelay<0. v2: Preserve the current drm_vblank_offdelay==0 'never disable' behaviur Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r--drivers/gpu/drm/drm_irq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index b2428cb0c64d..99145c4d536b 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -993,10 +993,13 @@ void drm_vblank_put(struct drm_device *dev, int crtc)
BUG_ON(atomic_read(&vblank->refcount) == 0);
/* Last user schedules interrupt disable */
- if (atomic_dec_and_test(&vblank->refcount) &&
- (drm_vblank_offdelay > 0))
- mod_timer(&vblank->disable_timer,
- jiffies + ((drm_vblank_offdelay * HZ)/1000));
+ if (atomic_dec_and_test(&vblank->refcount)) {
+ if (drm_vblank_offdelay < 0)
+ vblank_disable_fn((unsigned long)vblank);
+ else if (drm_vblank_offdelay > 0)
+ mod_timer(&vblank->disable_timer,
+ jiffies + ((drm_vblank_offdelay * HZ)/1000));
+ }
}
EXPORT_SYMBOL(drm_vblank_put);
OpenPOWER on IntegriCloud