diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2006-10-02 11:04:42 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2006-10-02 11:04:42 +0200 |
commit | 3a16e615cabfed18b1891a732e7243ef41dc0ad0 (patch) | |
tree | 7e1ae6d6c458c37b308a24d492f428ba63d4951e /linux-core/drm_irq.c | |
parent | d58389968124191a546a14b42ef84edc224be23d (diff) |
Make locked tasklet handling more robust.
Initialize the spinlock unconditionally when struct drm_device is filled in,
and return early in drm_locked_tasklet() if the driver doesn't support IRQs.
Diffstat (limited to 'linux-core/drm_irq.c')
-rw-r--r-- | linux-core/drm_irq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index d1a6a6b1..41038fd7 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -118,7 +118,6 @@ static int drm_irq_install(drm_device_t * dev) init_waitqueue_head(&dev->vbl_queue); spin_lock_init(&dev->vbl_lock); - spin_lock_init(&dev->tasklet_lock); INIT_LIST_HEAD(&dev->vbl_sigs.head); INIT_LIST_HEAD(&dev->vbl_sigs2.head); @@ -458,7 +457,8 @@ void drm_locked_tasklet(drm_device_t *dev, void (*func)(drm_device_t*)) unsigned int irqflags; static DECLARE_TASKLET(drm_tasklet, drm_locked_tasklet_func, 0); - if (test_bit(TASKLET_STATE_SCHED, &drm_tasklet.state)) + if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ) || + test_bit(TASKLET_STATE_SCHED, &drm_tasklet.state)) return; spin_lock_irqsave(&dev->tasklet_lock, irqflags); |