/* If the lock is not held, then let the signal proceed as usual. If the lock is held, then set the contended flag and keep the signal blocked. */
static int drm_notifier(void *priv)
/* If the lock is not held, then let the signal proceed as usual. If the lock is held, then set the contended flag and keep the signal blocked. */
static int drm_notifier(void *priv)
{
	struct drm_sigdata *s = (struct drm_sigdata *) priv;
	unsigned int old, new, prev;
	if (!s->lock || !_DRM_LOCK_IS_HELD(s->lock->lock)
	    || _DRM_LOCKING_CONTEXT(s->lock->lock) != s->context)
		return 1;
	do {
		old = s->lock->lock;
		new = old | _DRM_LOCK_CONT;
		prev = cmpxchg(&s->lock->lock, old, new);
	} while (prev != old);
	return 0;
}