diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-16 17:11:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-16 17:11:43 -0400 |
commit | 2e57572a50a4de41c6cbc879a4866a312d4cd316 (patch) | |
tree | c4f58ec96c06642c4b415b881d3f0a3b673d5b44 /drivers/gpu/drm/drm_lock.c | |
parent | 9b2e43ae4e9609f80034dfe8de895045cac52d77 (diff) | |
parent | f948cc6ab9e61a8e88d70ee9aafc690e6d26f92c (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts:
arch/sparc64/kernel/pci_psycho.c
Diffstat (limited to 'drivers/gpu/drm/drm_lock.c')
-rw-r--r-- | drivers/gpu/drm/drm_lock.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index 0998723cde79..a4caf95485d7 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c | |||
@@ -105,14 +105,19 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
105 | ret ? "interrupted" : "has lock"); | 105 | ret ? "interrupted" : "has lock"); |
106 | if (ret) return ret; | 106 | if (ret) return ret; |
107 | 107 | ||
108 | sigemptyset(&dev->sigmask); | 108 | /* don't set the block all signals on the master process for now |
109 | sigaddset(&dev->sigmask, SIGSTOP); | 109 | * really probably not the correct answer but lets us debug xkb |
110 | sigaddset(&dev->sigmask, SIGTSTP); | 110 | * xserver for now */ |
111 | sigaddset(&dev->sigmask, SIGTTIN); | 111 | if (!file_priv->master) { |
112 | sigaddset(&dev->sigmask, SIGTTOU); | 112 | sigemptyset(&dev->sigmask); |
113 | dev->sigdata.context = lock->context; | 113 | sigaddset(&dev->sigmask, SIGSTOP); |
114 | dev->sigdata.lock = dev->lock.hw_lock; | 114 | sigaddset(&dev->sigmask, SIGTSTP); |
115 | block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask); | 115 | sigaddset(&dev->sigmask, SIGTTIN); |
116 | sigaddset(&dev->sigmask, SIGTTOU); | ||
117 | dev->sigdata.context = lock->context; | ||
118 | dev->sigdata.lock = dev->lock.hw_lock; | ||
119 | block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask); | ||
120 | } | ||
116 | 121 | ||
117 | if (dev->driver->dma_ready && (lock->flags & _DRM_LOCK_READY)) | 122 | if (dev->driver->dma_ready && (lock->flags & _DRM_LOCK_READY)) |
118 | dev->driver->dma_ready(dev); | 123 | dev->driver->dma_ready(dev); |
@@ -150,6 +155,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
150 | { | 155 | { |
151 | struct drm_lock *lock = data; | 156 | struct drm_lock *lock = data; |
152 | unsigned long irqflags; | 157 | unsigned long irqflags; |
158 | void (*tasklet_func)(struct drm_device *); | ||
153 | 159 | ||
154 | if (lock->context == DRM_KERNEL_CONTEXT) { | 160 | if (lock->context == DRM_KERNEL_CONTEXT) { |
155 | DRM_ERROR("Process %d using kernel context %d\n", | 161 | DRM_ERROR("Process %d using kernel context %d\n", |
@@ -158,14 +164,11 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
158 | } | 164 | } |
159 | 165 | ||
160 | spin_lock_irqsave(&dev->tasklet_lock, irqflags); | 166 | spin_lock_irqsave(&dev->tasklet_lock, irqflags); |
161 | 167 | tasklet_func = dev->locked_tasklet_func; | |
162 | if (dev->locked_tasklet_func) { | 168 | dev->locked_tasklet_func = NULL; |
163 | dev->locked_tasklet_func(dev); | ||
164 | |||
165 | dev->locked_tasklet_func = NULL; | ||
166 | } | ||
167 | |||
168 | spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); | 169 | spin_unlock_irqrestore(&dev->tasklet_lock, irqflags); |
170 | if (tasklet_func != NULL) | ||
171 | tasklet_func(dev); | ||
169 | 172 | ||
170 | atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); | 173 | atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); |
171 | 174 | ||