Deleted Added
full compact
drm_lock.c (189048) drm_lock.c (189869)
1/*-
2 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

--- 15 unchanged lines hidden (view full) ---

24 *
25 * Authors:
26 * Rickard E. (Rik) Faith <faith@valinux.com>
27 * Gareth Hughes <gareth@valinux.com>
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

--- 15 unchanged lines hidden (view full) ---

24 *
25 * Authors:
26 * Rickard E. (Rik) Faith <faith@valinux.com>
27 * Gareth Hughes <gareth@valinux.com>
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/drm/drm_lock.c 189048 2009-02-25 18:25:47Z rnoland $");
32__FBSDID("$FreeBSD: head/sys/dev/drm/drm_lock.c 189869 2009-03-16 08:19:11Z rnoland $");
33
34/** @file drm_lock.c
35 * Implementation of the ioctls and other support code for dealing with the
36 * hardware lock.
37 *
38 * The DRM hardware lock is a shared structure between the kernel and userland.
39 *
40 * On uncontended access where the new context was the last context, the

--- 36 unchanged lines hidden (view full) ---

77 dev->lock.file_priv = file_priv;
78 dev->lock.lock_time = jiffies;
79 atomic_inc(&dev->counts[_DRM_STAT_LOCKS]);
80 break; /* Got lock */
81 }
82
83 /* Contention */
84 ret = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock,
33
34/** @file drm_lock.c
35 * Implementation of the ioctls and other support code for dealing with the
36 * hardware lock.
37 *
38 * The DRM hardware lock is a shared structure between the kernel and userland.
39 *
40 * On uncontended access where the new context was the last context, the

--- 36 unchanged lines hidden (view full) ---

77 dev->lock.file_priv = file_priv;
78 dev->lock.lock_time = jiffies;
79 atomic_inc(&dev->counts[_DRM_STAT_LOCKS]);
80 break; /* Got lock */
81 }
82
83 /* Contention */
84 ret = mtx_sleep((void *)&dev->lock.lock_queue, &dev->dev_lock,
85 PZERO | PCATCH, "drmlk2", 0);
85 PCATCH, "drmlk2", 0);
86 if (ret != 0)
87 break;
88 }
89 DRM_UNLOCK();
90 DRM_DEBUG("%d %s\n", lock->context, ret ? "interrupted" : "has lock");
91
92 if (ret != 0)
93 return ret;

--- 101 unchanged lines hidden ---
86 if (ret != 0)
87 break;
88 }
89 DRM_UNLOCK();
90 DRM_DEBUG("%d %s\n", lock->context, ret ? "interrupted" : "has lock");
91
92 if (ret != 0)
93 return ret;

--- 101 unchanged lines hidden ---