aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_lock.c')
-rw-r--r--drivers/gpu/drm/drm_lock.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index 9bf93bc9a32c..632ae243ede0 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -37,6 +37,8 @@
37 37
38static int drm_notifier(void *priv); 38static int drm_notifier(void *priv);
39 39
40static int drm_lock_take(struct drm_lock_data *lock_data, unsigned int context);
41
40/** 42/**
41 * Lock ioctl. 43 * Lock ioctl.
42 * 44 *
@@ -124,9 +126,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
124 block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask); 126 block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask);
125 } 127 }
126 128
127 if (dev->driver->dma_ready && (lock->flags & _DRM_LOCK_READY))
128 dev->driver->dma_ready(dev);
129
130 if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT)) 129 if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT))
131 { 130 {
132 if (dev->driver->dma_quiescent(dev)) { 131 if (dev->driver->dma_quiescent(dev)) {
@@ -136,12 +135,6 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
136 } 135 }
137 } 136 }
138 137
139 if (dev->driver->kernel_context_switch &&
140 dev->last_context != lock->context) {
141 dev->driver->kernel_context_switch(dev, dev->last_context,
142 lock->context);
143 }
144
145 return 0; 138 return 0;
146} 139}
147 140
@@ -169,15 +162,8 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
169 162
170 atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]); 163 atomic_inc(&dev->counts[_DRM_STAT_UNLOCKS]);
171 164
172 /* kernel_context_switch isn't used by any of the x86 drm 165 if (drm_lock_free(&master->lock, lock->context)) {
173 * modules but is required by the Sparc driver. 166 /* FIXME: Should really bail out here. */
174 */
175 if (dev->driver->kernel_context_switch_unlock)
176 dev->driver->kernel_context_switch_unlock(dev);
177 else {
178 if (drm_lock_free(&master->lock, lock->context)) {
179 /* FIXME: Should really bail out here. */
180 }
181 } 167 }
182 168
183 unblock_all_signals(); 169 unblock_all_signals();
@@ -193,6 +179,7 @@ int drm_unlock(struct drm_device *dev, void *data, struct drm_file *file_priv)
193 * 179 *
194 * Attempt to mark the lock as held by the given context, via the \p cmpxchg instruction. 180 * Attempt to mark the lock as held by the given context, via the \p cmpxchg instruction.
195 */ 181 */
182static
196int drm_lock_take(struct drm_lock_data *lock_data, 183int drm_lock_take(struct drm_lock_data *lock_data,
197 unsigned int context) 184 unsigned int context)
198{ 185{
@@ -229,7 +216,6 @@ int drm_lock_take(struct drm_lock_data *lock_data,
229 } 216 }
230 return 0; 217 return 0;
231} 218}
232EXPORT_SYMBOL(drm_lock_take);
233 219
234/** 220/**
235 * This takes a lock forcibly and hands it to context. Should ONLY be used 221 * This takes a lock forcibly and hands it to context. Should ONLY be used
@@ -297,7 +283,6 @@ int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context)
297 wake_up_interruptible(&lock_data->lock_queue); 283 wake_up_interruptible(&lock_data->lock_queue);
298 return 0; 284 return 0;
299} 285}
300EXPORT_SYMBOL(drm_lock_free);
301 286
302/** 287/**
303 * If we get here, it means that the process has called DRM_IOCTL_LOCK 288 * If we get here, it means that the process has called DRM_IOCTL_LOCK
@@ -360,7 +345,6 @@ void drm_idlelock_take(struct drm_lock_data *lock_data)
360 } 345 }
361 spin_unlock_bh(&lock_data->spinlock); 346 spin_unlock_bh(&lock_data->spinlock);
362} 347}
363EXPORT_SYMBOL(drm_idlelock_take);
364 348
365void drm_idlelock_release(struct drm_lock_data *lock_data) 349void drm_idlelock_release(struct drm_lock_data *lock_data)
366{ 350{
@@ -380,8 +364,6 @@ void drm_idlelock_release(struct drm_lock_data *lock_data)
380 } 364 }
381 spin_unlock_bh(&lock_data->spinlock); 365 spin_unlock_bh(&lock_data->spinlock);
382} 366}
383EXPORT_SYMBOL(drm_idlelock_release);
384
385 367
386int drm_i_have_hw_lock(struct drm_device *dev, struct drm_file *file_priv) 368int drm_i_have_hw_lock(struct drm_device *dev, struct drm_file *file_priv)
387{ 369{
@@ -390,5 +372,3 @@ int drm_i_have_hw_lock(struct drm_device *dev, struct drm_file *file_priv)
390 _DRM_LOCK_IS_HELD(master->lock.hw_lock->lock) && 372 _DRM_LOCK_IS_HELD(master->lock.hw_lock->lock) &&
391 master->lock.file_priv == file_priv); 373 master->lock.file_priv == file_priv);
392} 374}
393
394EXPORT_SYMBOL(drm_i_have_hw_lock);