Lines Matching refs:lock

33  * of the DRM heavyweight hardware lock.
34 * The lock is a read-write lock. Taking it in read mode and write mode
39 * It's allowed to leave kernel space with the vt lock held.
40 * If a user-space process dies while having the vt-lock,
41 * it will be released during the file descriptor release. The vt lock
42 * excludes write lock and read lock.
44 * The suspend mode is used to lock out all TTM users when preparing for
59 * @base: ttm base object used solely to release the lock if the client
60 * holding the lock dies.
61 * @queue: Queue for processes waiting for lock change-of-status.
62 * @lock: Spinlock protecting some lock members.
63 * @rw: Read-write lock counter. Protected by @lock.
64 * @flags: Lock state. Protected by @lock.
65 * @kill_takers: Boolean whether to kill takers of the lock.
71 struct mtx lock;
83 * @lock: Pointer to a struct ttm_lock
84 * Initializes the lock.
86 extern void ttm_lock_init(struct ttm_lock *lock);
91 * @lock: Pointer to a struct ttm_lock
93 * Releases a read lock.
95 extern void ttm_read_unlock(struct ttm_lock *lock);
100 * @lock: Pointer to a struct ttm_lock
101 * @interruptible: Interruptible sleeping while waiting for a lock.
103 * Takes the lock in read mode.
107 extern int ttm_read_lock(struct ttm_lock *lock, bool interruptible);
112 * @lock: Pointer to a struct ttm_lock
113 * @interruptible: Interruptible sleeping while waiting for a lock.
115 * Tries to take the lock in read mode. If the lock is already held
116 * in write mode, the function will return -EBUSY. If the lock is held
121 * -EBUSY The lock was already held in write mode.
124 extern int ttm_read_trylock(struct ttm_lock *lock, bool interruptible);
129 * @lock: Pointer to a struct ttm_lock
131 * Downgrades a write lock to a read lock.
133 extern void ttm_lock_downgrade(struct ttm_lock *lock);
138 * @lock: Pointer to a struct ttm_lock
140 * Takes the lock in suspend mode. Excludes read and write mode.
142 extern void ttm_suspend_lock(struct ttm_lock *lock);
147 * @lock: Pointer to a struct ttm_lock
149 * Releases a suspend lock
151 extern void ttm_suspend_unlock(struct ttm_lock *lock);
156 * @lock: Pointer to a struct ttm_lock
157 * @interruptible: Interruptible sleeping while waiting for a lock.
158 * @tfile: Pointer to a struct ttm_object_file to register the lock with.
160 * Takes the lock in vt mode.
165 extern int ttm_vt_lock(struct ttm_lock *lock, bool interruptible,
171 * @lock: Pointer to a struct ttm_lock
173 * Releases a vt lock.
175 * -EINVAL If the lock was not held.
177 extern int ttm_vt_unlock(struct ttm_lock *lock);
182 * @lock: Pointer to a struct ttm_lock
184 * Releases a write lock.
186 extern void ttm_write_unlock(struct ttm_lock *lock);
191 * @lock: Pointer to a struct ttm_lock
192 * @interruptible: Interruptible sleeping while waiting for a lock.
194 * Takes the lock in write mode.
198 extern int ttm_write_lock(struct ttm_lock *lock, bool interruptible);
200 void ttm_write_lock_downgrade(struct ttm_lock *lock);
205 * @lock: Pointer to a struct ttm_lock
206 * @val: Boolean whether to kill processes taking the lock.
207 * @signal: Signal to send to the process taking the lock.
209 * The kill-when-taking-lock functionality is used to kill processes that keep
212 * - X server takes lock in write mode.
215 * - X server releases the lock on file release.
216 * - Another dri client wants to render, takes the lock and is killed.
219 static inline void ttm_lock_set_kill(struct ttm_lock *lock, bool val,
222 lock->kill_takers = val;
224 lock->signal = signal;