diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-06-19 00:51:28 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-06-19 00:51:28 +0000 |
commit | 6f777bb938d6c2a94bd79b300674b0a40509aead (patch) | |
tree | 8bdebd0f67fbf31bb9f30516d4642629007af0fa /sys | |
parent | e7593dfd3bf30b03bc13c583d7d854d4033623a3 (diff) |
Check the right refcount so that the vblank irq has a hope of being
disabled when wished.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/drm_irq.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c index 3f9b0ac4c71..99d2e2b7de8 100644 --- a/sys/dev/pci/drm/drm_irq.c +++ b/sys/dev/pci/drm/drm_irq.c @@ -421,10 +421,11 @@ drm_vblank_get(struct drm_device *dev, int crtc) if (dev->vblank_refcount[crtc] == 1 && dev->vblank_enabled[crtc] == 0) { ret = dev->driver.enable_vblank(dev, crtc); - if (ret) + if (ret) { atomic_dec(&dev->vblank_refcount[crtc]); - else + } else { dev->vblank_enabled[crtc] = 1; + } } DRM_SPINUNLOCK(&dev->vbl_lock); @@ -437,7 +438,7 @@ drm_vblank_put(struct drm_device *dev, int crtc) DRM_SPINLOCK(&dev->vbl_lock); /* Last user schedules interrupt disable */ atomic_dec(&dev->vblank_refcount[crtc]); - if (&dev->vblank_refcount[crtc] == 0) + if (dev->vblank_refcount[crtc] == 0) timeout_add(&dev->vblank_disable_timer, 5*DRM_HZ); DRM_SPINUNLOCK(&dev->vbl_lock); } |