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 */
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 */
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);
}
}
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);
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;
* 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];
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]);
}
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 &&
else
dev->vblank_enabled[crtc] = 1;
}
- DRM_SPINUNLOCK_IRQRESTORE(&dev->vbl_lock, irqflags);
+ DRM_SPINUNLOCK_IRQRESTORE(&dev->irq_lock, irqflags);
return ret;
}