diff options
author | =?utf-8?q?Michel_D=C3=A4nzer?= <michel@tungstengraphics.com> | 2006-10-24 15:30:01 +0200 |
---|---|---|
committer | airlied <airlied@linux.ie> | 2006-12-07 05:53:29 +0100 |
commit | 8163e418f71e46a28bac6625b4c633c13bd53c8d (patch) | |
tree | 57f15bc4ed9b8a12f50a4e993b3be9cd7363f739 /drivers/char/drm/drm_irq.c | |
parent | drm: drm_rmdraw: Declare id and idx as signed so testing for < 0 works as int... (diff) | |
download | linux-8163e418f71e46a28bac6625b4c633c13bd53c8d.tar.xz linux-8163e418f71e46a28bac6625b4c633c13bd53c8d.zip |
drm: 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.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_irq.c')
-rw-r--r-- | drivers/char/drm/drm_irq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c index 2b10e5b60cfa..b08608a9f026 100644 --- a/drivers/char/drm/drm_irq.c +++ b/drivers/char/drm/drm_irq.c @@ -119,7 +119,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); @@ -456,7 +455,8 @@ void drm_locked_tasklet(drm_device_t *dev, void (*func)(drm_device_t*)) unsigned long 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); |