Skip to content

Commit 69d516c

Browse files
David Herrmannairlied
authored andcommitted
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>
1 parent edf0ac7 commit 69d516c

2 files changed

Lines changed: 13 additions & 14 deletions

File tree

‎drivers/gpu/drm/drm_lock.c‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv)
120120
sigaddset(&dev->sigmask, SIGTTOU);
121121
dev->sigdata.context = lock->context;
122122
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);
124124
}
125125

126126
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)
286286
* If the lock is not held, then let the signal proceed as usual. If the lock
287287
* is held, then set the contended flag and keep the signal blocked.
288288
*
289-
* \param priv pointer to a drm_sigdata structure.
289+
* \param priv pointer to a drm_device structure.
290290
* \return one if the signal should be delivered normally, or zero if the
291291
* signal should be blocked.
292292
*/
293293
static int drm_notifier(void *priv)
294294
{
295-
struct drm_sigdata *s = (struct drm_sigdata *) priv;
295+
struct drm_device *dev = priv;
296+
struct drm_hw_lock *lock = dev->sigdata.lock;
296297
unsigned int old, new, prev;
297298

298299
/* 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)
301302
return 1;
302303

303304
/* Otherwise, set flag to force call to
304305
drmUnlock */
305306
do {
306-
old = s->lock->lock;
307+
old = lock->lock;
307308
new = old | _DRM_LOCK_CONT;
308-
prev = cmpxchg(&s->lock->lock, old, new);
309+
prev = cmpxchg(&lock->lock, old, new);
309310
} while (prev != old);
310311
return 0;
311312
}

‎include/drm/drmP.h‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,6 @@ struct drm_sg_mem {
432432
dma_addr_t *busaddr;
433433
};
434434

435-
struct drm_sigdata {
436-
int context;
437-
struct drm_hw_lock *lock;
438-
};
439-
440-
441435
/**
442436
* Kernel side of a mapping
443437
*/
@@ -1035,9 +1029,13 @@ struct drm_device {
10351029

10361030
struct drm_sg_mem *sg; /**< Scatter gather memory */
10371031
unsigned int num_crtcs; /**< Number of CRTCs on this device */
1038-
struct drm_sigdata sigdata; /**< For block_all_signals */
10391032
sigset_t sigmask;
10401033

1034+
struct {
1035+
int context;
1036+
struct drm_hw_lock *lock;
1037+
} sigdata;
1038+
10411039
struct drm_local_map *agp_buffer_map;
10421040
unsigned int agp_buffer_token;
10431041

0 commit comments

Comments
 (0)