From 6f777bb938d6c2a94bd79b300674b0a40509aead Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Thu, 19 Jun 2008 00:51:28 +0000 Subject: Check the right refcount so that the vblank irq has a hope of being disabled when wished. --- sys/dev/pci/drm/drm_irq.c | 7 ++++--- 1 file 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); } -- cgit v1.2.3