aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_lock.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-08-29 06:12:39 -0400
committerDave Airlie <airlied@redhat.com>2014-09-10 03:41:55 -0400
commit69d516c0a990b42c4d55f7631fa28cc41bfcc8f0 (patch)
tree7b412692e7e8e74ecdc123d863524985929f5945 /drivers/gpu/drm/drm_lock.c
parentedf0ac7c67ce596f43d66a781660889bbdcc9505 (diff)
drm: inline "struct drm_sigdata"
The sigdata structure is only used to group two fields in drm_device. Inline it and make it an unnamed object. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_lock.c')
-rw-r--r--drivers/gpu/drm/drm_lock.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c
index e26b59e385ff..60f148134e6a 100644
--- a/drivers/gpu/drm/drm_lock.c
+++ b/drivers/gpu/drm/drm_lock.c
@@ -120,7 +120,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
120 sigaddset(&dev->sigmask, SIGTTOU); 120 sigaddset(&dev->sigmask, SIGTTOU);
121 dev->sigdata.context = lock->context; 121 dev->sigdata.context = lock->context;
122 dev->sigdata.lock = master->lock.hw_lock; 122 dev->sigdata.lock = master->lock.hw_lock;
123 block_all_signals(drm_notifier, &dev->sigdata, &dev->sigmask); 123 block_all_signals(drm_notifier, dev, &dev->sigmask);
124 } 124 }
125 125
126 if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT)) 126 if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT))
@@ -286,26 +286,27 @@ int drm_lock_free(struct drm_lock_data *lock_data, unsigned int context)
286 * If the lock is not held, then let the signal proceed as usual. If the lock 286 * If the lock is not held, then let the signal proceed as usual. If the lock
287 * is held, then set the contended flag and keep the signal blocked. 287 * is held, then set the contended flag and keep the signal blocked.
288 * 288 *
289 * \param priv pointer to a drm_sigdata structure. 289 * \param priv pointer to a drm_device structure.
290 * \return one if the signal should be delivered normally, or zero if the 290 * \return one if the signal should be delivered normally, or zero if the
291 * signal should be blocked. 291 * signal should be blocked.
292 */ 292 */
293static int drm_notifier(void *priv) 293static int drm_notifier(void *priv)
294{ 294{
295 struct drm_sigdata *s = (struct drm_sigdata *) priv; 295 struct drm_device *dev = priv;
296 struct drm_hw_lock *lock = dev->sigdata.lock;
296 unsigned int old, new, prev; 297 unsigned int old, new, prev;
297 298
298 /* Allow signal delivery if lock isn't held */ 299 /* Allow signal delivery if lock isn't held */
299 if (!s->lock || !_DRM_LOCK_IS_HELD(s->lock->lock) 300 if (!lock || !_DRM_LOCK_IS_HELD(lock->lock)
300 || _DRM_LOCKING_CONTEXT(s->lock->lock) != s->context) 301 || _DRM_LOCKING_CONTEXT(lock->lock) != dev->sigdata.context)
301 return 1; 302 return 1;
302 303
303 /* Otherwise, set flag to force call to 304 /* Otherwise, set flag to force call to
304 drmUnlock */ 305 drmUnlock */
305 do { 306 do {
306 old = s->lock->lock; 307 old = lock->lock;
307 new = old | _DRM_LOCK_CONT; 308 new = old | _DRM_LOCK_CONT;
308 prev = cmpxchg(&s->lock->lock, old, new); 309 prev = cmpxchg(&lock->lock, old, new);
309 } while (prev != old); 310 } while (prev != old);
310 return 0; 311 return 0;
311} 312}