summaryrefslogtreecommitdiff
path: root/bsd-core
diff options
context:
space:
mode:
authorRobert Noland <rnoland@wombat.2hip.net>2008-06-01 16:17:31 -0400
committerEric Anholt <eric@anholt.net>2008-06-01 20:33:30 -0700
commit4ce47fd328cd885d66abdd42db1f7c054bd44498 (patch)
treeffbde5d05772b3a3f5058e50a4f76b5529aedaae /bsd-core
parentac4da869285173ad0ac947bdf41ffe10efe21c05 (diff)
[FreeBSD] Get rid of vbl_lock and re-use irq_lock.
Diffstat (limited to 'bsd-core')
-rw-r--r--bsd-core/drmP.h5
-rw-r--r--bsd-core/drm_irq.c14
2 files changed, 7 insertions, 12 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index 4c35cdb2..21cf623a 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -788,11 +788,10 @@ struct drm_device {
wait_queue_head_t *vbl_queue; /* vblank wait queue */
atomic_t *_vblank_count; /* number of VBLANK interrupts */
/* (driver must alloc the right number of counters) */
- struct mtx vbl_lock;
struct drm_vbl_sig_list *vbl_sigs; /* signal list to send on VBLANK */
atomic_t vbl_signal_pending; /* number of signals pending on all crtcs*/
atomic_t *vblank_refcount; /* number of users of vblank interrupts per crtc */
- u32 *last_vblank; /* protected by dev->vbl_lock, used */
+ u32 *last_vblank; /* protected by dev->irq_lock, used */
/* for wraparound handling */
u32 *vblank_offset; /* used to track how many vblanks */
@@ -802,8 +801,6 @@ struct drm_device {
struct callout vblank_disable_timer;
unsigned long max_vblank_count; /* size of vblank counter register */
int num_crtcs;
- atomic_t vbl_received;
- atomic_t vbl_received2;
#ifdef __FreeBSD__
struct sigio *buf_sigio; /* Processes waiting for SIGIO */
diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c
index 4b10ba4f..57a70263 100644
--- a/bsd-core/drm_irq.c
+++ b/bsd-core/drm_irq.c
@@ -73,13 +73,13 @@ static void vblank_disable_fn(void *arg)
int i;
for (i = 0; i < dev->num_crtcs; i++) {
- DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
+ DRM_SPINLOCK_IRQSAVE(&dev->irq_lock, irqflags);
if (atomic_read(&dev->vblank_refcount[i]) == 0 &&
dev->vblank_enabled[i]) {
dev->driver.disable_vblank(dev, i);
dev->vblank_enabled[i] = 0;
}
- DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
+ DRM_SPINUNLOCK_IRQRESTORE(&dev->irq_lock, irqflags);
}
}
@@ -92,7 +92,6 @@ static void drm_vblank_cleanup(struct drm_device *dev)
callout_drain(&dev->vblank_disable_timer);
vblank_disable_fn((void *)dev);
- DRM_SPINUNINIT(&dev->vbl_lock);
drm_free(dev->vbl_queue, sizeof(*dev->vbl_queue) * dev->num_crtcs,
DRM_MEM_DRIVER);
@@ -119,7 +118,6 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
int i, ret = -ENOMEM;
callout_init(&dev->vblank_disable_timer, 0);
- DRM_SPININIT(&dev->vbl_lock, "drm_vblk");
atomic_set(&dev->vbl_signal_pending, 0);
dev->num_crtcs = num_crtcs;
@@ -339,7 +337,7 @@ void drm_update_vblank_count(struct drm_device *dev, int crtc)
* a long time.
*/
cur_vblank = dev->driver.get_vblank_counter(dev, crtc);
- DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
+ DRM_SPINLOCK_IRQSAVE(&dev->irq_lock, irqflags);
if (cur_vblank < dev->last_vblank[crtc]) {
diff = dev->max_vblank_count -
dev->last_vblank[crtc];
@@ -348,7 +346,7 @@ void drm_update_vblank_count(struct drm_device *dev, int crtc)
diff = cur_vblank - dev->last_vblank[crtc];
}
dev->last_vblank[crtc] = cur_vblank;
- DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
+ DRM_SPINUNLOCK_IRQRESTORE(&dev->irq_lock, irqflags);
atomic_add(diff, &dev->_vblank_count[crtc]);
}
@@ -358,7 +356,7 @@ int drm_vblank_get(struct drm_device *dev, int crtc)
unsigned long irqflags;
int ret = 0;
- DRM_SPINLOCK_IRQSAVE(&dev->vbl_lock, irqflags);
+ DRM_SPINLOCK_IRQSAVE(&dev->irq_lock, irqflags);
/* Going from 0->1 means we have to enable interrupts again */
atomic_add_acq_int(&dev->vblank_refcount[crtc], 1);
if (dev->vblank_refcount[crtc] == 1 &&
@@ -369,7 +367,7 @@ int drm_vblank_get(struct drm_device *dev, int crtc)
else
dev->vblank_enabled[crtc] = 1;
}
- DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
+ DRM_SPINUNLOCK_IRQRESTORE(&dev->irq_lock, irqflags);
return ret;
}