Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109197
b: refs/heads/master
c: e5b4f19
h: refs/heads/master
i:
  109195: 311f37d
v: v3
  • Loading branch information
Thomas Hellstrom authored and Dave Airlie committed Aug 24, 2008
1 parent 27044e7 commit 01bbf6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 649ffc06a62bf487b78440669bdfeb637f1d675b
refs/heads/master: e5b4f19417b75a2d7c1e36934f60a3e836c4337e
20 changes: 12 additions & 8 deletions trunk/drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,27 +400,31 @@ static void drm_locked_tasklet_func(unsigned long data)
{
struct drm_device *dev = (struct drm_device *)data;
unsigned long irqflags;

void (*tasklet_func)(struct drm_device *);

spin_lock_irqsave(&dev->tasklet_lock, irqflags);
tasklet_func = dev->locked_tasklet_func;
spin_unlock_irqrestore(&dev->tasklet_lock, irqflags);

if (!dev->locked_tasklet_func ||
if (!tasklet_func ||
!drm_lock_take(&dev->lock,
DRM_KERNEL_CONTEXT)) {
spin_unlock_irqrestore(&dev->tasklet_lock, irqflags);
return;
}

dev->lock.lock_time = jiffies;
atomic_inc(&dev->counts[_DRM_STAT_LOCKS]);

dev->locked_tasklet_func(dev);
spin_lock_irqsave(&dev->tasklet_lock, irqflags);
tasklet_func = dev->locked_tasklet_func;
dev->locked_tasklet_func = NULL;
spin_unlock_irqrestore(&dev->tasklet_lock, irqflags);

if (tasklet_func != NULL)
tasklet_func(dev);

drm_lock_free(&dev->lock,
DRM_KERNEL_CONTEXT);

dev->locked_tasklet_func = NULL;

spin_unlock_irqrestore(&dev->tasklet_lock, irqflags);
}

/**
Expand Down
12 changes: 5 additions & 7 deletions trunk/drivers/gpu/drm/drm_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
{
struct drm_lock *lock = data;
unsigned long irqflags;
void (*tasklet_func)(struct drm_device *);

if (lock->context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",
Expand All @@ -158,14 +159,11 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
}

spin_lock_irqsave(&dev->tasklet_lock, irqflags);

if (dev->locked_tasklet_func) {
dev->locked_tasklet_func(dev);

dev->locked_tasklet_func = NULL;
}

tasklet_func = dev->locked_tasklet_func;
dev->locked_tasklet_func = NULL;
spin_unlock_irqrestore(&dev->tasklet_lock, irqflags);
if (tasklet_func != NULL)
tasklet_func(dev);

atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]);

Expand Down

0 comments on commit 01bbf6d

Please sign in to comment.