aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_irq.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-03-22 22:28:33 -0400
committerDave Airlie <airlied@linux.ie>2007-03-22 22:28:33 -0400
commit040ac32048d5efabd557c1e0a6ab8aec2c710c56 (patch)
treeba714a33105695c7d57ff833dbd18875ddb82492 /drivers/char/drm/drm_irq.c
parent4b560fde06aeb342f3ff0bce924627ab722d251a (diff)
drm: fix driver deadlock with AIGLX and reclaim_buffers_locked
Bugzilla Bug #9457 Add refcounting of user waiters to the DRM hardware lock, so that we can use DRM_LOCK_CONT flag more conservatively. Also add a kernel waiter refcount that if nonzero transfers the lock for the kernel context when it is released. This is useful when waiting for idle and can be used for very simple fence object driver implementations for the new memory manager 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/drm/drm_irq.c b/drivers/char/drm/drm_irq.c
index 9d00c51fe2c4..2e75331fd83e 100644
--- a/drivers/char/drm/drm_irq.c
+++ b/drivers/char/drm/drm_irq.c
@@ -424,7 +424,7 @@ static void drm_locked_tasklet_func(unsigned long data)
424 spin_lock_irqsave(&dev->tasklet_lock, irqflags); 424 spin_lock_irqsave(&dev->tasklet_lock, irqflags);
425 425
426 if (!dev->locked_tasklet_func || 426 if (!dev->locked_tasklet_func ||
427 !drm_lock_take(&dev->lock.hw_lock->lock, 427 !drm_lock_take(&dev->lock,
428 DRM_KERNEL_CONTEXT)) { 428 DRM_KERNEL_CONTEXT)) {
429 spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); 429 spin_unlock_irqrestore(&dev->tasklet_lock, irqflags);
430 return; 430 return;
@@ -435,7 +435,7 @@ static void drm_locked_tasklet_func(unsigned long data)
435 435
436 dev->locked_tasklet_func(dev); 436 dev->locked_tasklet_func(dev);
437 437
438 drm_lock_free(dev, &dev->lock.hw_lock->lock, 438 drm_lock_free(&dev->lock,
439 DRM_KERNEL_CONTEXT); 439 DRM_KERNEL_CONTEXT);
440 440
441 dev->locked_tasklet_func = NULL; 441 dev->locked_tasklet_func = NULL;