aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm
diff options
context:
space:
mode:
author=?utf-8?q?Michel_D=C3=A4nzer?= <michel@tungstengraphics.com>2006-10-24 09:30:01 -0400
committerairlied <airlied@linux.ie>2006-12-06 23:53:29 -0500
commit8163e418f71e46a28bac6625b4c633c13bd53c8d (patch)
tree57f15bc4ed9b8a12f50a4e993b3be9cd7363f739 /drivers/char/drm
parent507c0185a72e89002757a58f6c64de3df84da0de (diff)
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')
-rw-r--r--drivers/char/drm/drm_irq.c4
-rw-r--r--drivers/char/drm/drm_stub.c1
2 files changed, 3 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)
119 init_waitqueue_head(&dev->vbl_queue); 119 init_waitqueue_head(&dev->vbl_queue);
120 120
121 spin_lock_init(&dev->vbl_lock); 121 spin_lock_init(&dev->vbl_lock);
122 spin_lock_init(&dev->tasklet_lock);
123 122
124 INIT_LIST_HEAD(&dev->vbl_sigs.head); 123 INIT_LIST_HEAD(&dev->vbl_sigs.head);
125 INIT_LIST_HEAD(&dev->vbl_sigs2.head); 124 INIT_LIST_HEAD(&dev->vbl_sigs2.head);
@@ -456,7 +455,8 @@ void drm_locked_tasklet(drm_device_t *dev, void (*func)(drm_device_t*))
456 unsigned long irqflags; 455 unsigned long irqflags;
457 static DECLARE_TASKLET(drm_tasklet, drm_locked_tasklet_func, 0); 456 static DECLARE_TASKLET(drm_tasklet, drm_locked_tasklet_func, 0);
458 457
459 if (test_bit(TASKLET_STATE_SCHED, &drm_tasklet.state)) 458 if (!drm_core_check_feature(dev, DRIVER_HAVE_IRQ) ||
459 test_bit(TASKLET_STATE_SCHED, &drm_tasklet.state))
460 return; 460 return;
461 461
462 spin_lock_irqsave(&dev->tasklet_lock, irqflags); 462 spin_lock_irqsave(&dev->tasklet_lock, irqflags);
diff --git a/drivers/char/drm/drm_stub.c b/drivers/char/drm/drm_stub.c
index 6f748e194cf9..5fd6dc0870cf 100644
--- a/drivers/char/drm/drm_stub.c
+++ b/drivers/char/drm/drm_stub.c
@@ -61,6 +61,7 @@ static int drm_fill_in_dev(drm_device_t * dev, struct pci_dev *pdev,
61 61
62 spin_lock_init(&dev->count_lock); 62 spin_lock_init(&dev->count_lock);
63 spin_lock_init(&dev->drw_lock); 63 spin_lock_init(&dev->drw_lock);
64 spin_lock_init(&dev->tasklet_lock);
64 init_timer(&dev->timer); 65 init_timer(&dev->timer);
65 mutex_init(&dev->struct_mutex); 66 mutex_init(&dev->struct_mutex);
66 mutex_init(&dev->ctxlist_mutex); 67 mutex_init(&dev->ctxlist_mutex);