Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Herrmann and committed by
Dave Airlie
69d516c0 edf0ac7c

+13 -14
+8 -7
drivers/gpu/drm/drm_lock.c
··· 120 120 sigaddset(&dev->sigmask, SIGTTOU); 121 121 dev->sigdata.context = lock->context; 122 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 126 if (dev->driver->dma_quiescent && (lock->flags & _DRM_LOCK_QUIESCENT)) ··· 286 286 * If the lock is not held, then let the signal proceed as usual. If the lock 287 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 290 * \return one if the signal should be delivered normally, or zero if the 291 291 * signal should be blocked. 292 292 */ 293 293 static 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 297 unsigned int old, new, prev; 297 298 298 299 /* Allow signal delivery if lock isn't held */ 299 - if (!s->lock || !_DRM_LOCK_IS_HELD(s->lock->lock) 300 - || _DRM_LOCKING_CONTEXT(s->lock->lock) != s->context) 300 + if (!lock || !_DRM_LOCK_IS_HELD(lock->lock) 301 + || _DRM_LOCKING_CONTEXT(lock->lock) != dev->sigdata.context) 301 302 return 1; 302 303 303 304 /* Otherwise, set flag to force call to 304 305 drmUnlock */ 305 306 do { 306 - old = s->lock->lock; 307 + old = lock->lock; 307 308 new = old | _DRM_LOCK_CONT; 308 - prev = cmpxchg(&s->lock->lock, old, new); 309 + prev = cmpxchg(&lock->lock, old, new); 309 310 } while (prev != old); 310 311 return 0; 311 312 }
+5 -7
include/drm/drmP.h
··· 432 432 dma_addr_t *busaddr; 433 433 }; 434 434 435 - struct drm_sigdata { 436 - int context; 437 - struct drm_hw_lock *lock; 438 - }; 439 - 440 - 441 435 /** 442 436 * Kernel side of a mapping 443 437 */ ··· 1029 1035 1030 1036 struct drm_sg_mem *sg; /**< Scatter gather memory */ 1031 1037 unsigned int num_crtcs; /**< Number of CRTCs on this device */ 1032 - struct drm_sigdata sigdata; /**< For block_all_signals */ 1033 1038 sigset_t sigmask; 1039 + 1040 + struct { 1041 + int context; 1042 + struct drm_hw_lock *lock; 1043 + } sigdata; 1034 1044 1035 1045 struct drm_local_map *agp_buffer_map; 1036 1046 unsigned int agp_buffer_token;